LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Kuppuswamy Sathyanarayanan  <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	"x86@kernel.org" <x86@kernel.org>,
	Wim Van Sebroeck <wim@iguana.be>, Ingo Molnar <mingo@redhat.com>,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Zha Qipeng <qipeng.zha@intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"dvhart@infradead.org" <dvhart@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Lee Jones <lee.jones@linaro.org>,
	Andy Shevchenko <andy@infradead.org>,
	Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>,
	linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	Sathyanarayanan Kuppuswamy Natarajan <sathyaosid@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [RFC v8 1/7] platform/x86: intel_punit_ipc: Fix resource ioremap warning
Date: Fri, 3 Nov 2017 14:13:09 +0200	[thread overview]
Message-ID: <CAHp75VffZCTgsbgm3RU-vAL4Xf1A60NtDaFwaLQRp5UqtztfuQ@mail.gmail.com> (raw)
In-Reply-To: <0ed06c9aabd0f6d707f3ab8024282a764ffe0318.1509268570.git.sathyanarayanan.kuppuswamy@linux.intel.com>

On Sun, Oct 29, 2017 at 11:49 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> For PUNIT device, ISPDRIVER_IPC and GTDDRIVER_IPC resources are not
> mandatory. So when PMC IPC driver creates a PUNIT device, if these
> resources are not available then it creates dummy resource entries for
> these missing resources. But during PUNIT device probe, doing ioremap on
> these dummy resources generates following warning messages.
>
> intel_punit_ipc: can't request region for resource [mem 0x00000000]
> intel_punit_ipc: can't request region for resource [mem 0x00000000]
> intel_punit_ipc: can't request region for resource [mem 0x00000000]
> intel_punit_ipc: can't request region for resource [mem 0x00000000]
>
> This patch fixes this issue by adding extra check for resource size
> before performing ioremap operation.

I think I already told that this one had been pushed to my review and
testing queue, thanks!

>
> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/platform/x86/intel_punit_ipc.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> Changes since v7:
>  * None
>
> Changes since v6:
>  * None
>
> Changes since v5:
>  * None
>
> Changes since v4:
>  * None
>
> diff --git a/drivers/platform/x86/intel_punit_ipc.c b/drivers/platform/x86/intel_punit_ipc.c
> index a47a41f..b5b8901 100644
> --- a/drivers/platform/x86/intel_punit_ipc.c
> +++ b/drivers/platform/x86/intel_punit_ipc.c
> @@ -252,28 +252,28 @@ static int intel_punit_get_bars(struct platform_device *pdev)
>          * - GTDRIVER_IPC BASE_IFACE
>          */
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[ISPDRIVER_IPC][BASE_DATA] = addr;
>         }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 3);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[ISPDRIVER_IPC][BASE_IFACE] = addr;
>         }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 4);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[GTDRIVER_IPC][BASE_DATA] = addr;
>         }
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 5);
> -       if (res) {
> +       if (res && resource_size(res) > 1) {
>                 addr = devm_ioremap_resource(&pdev->dev, res);
>                 if (!IS_ERR(addr))
>                         punit_ipcdev->base[GTDRIVER_IPC][BASE_IFACE] = addr;
> --
> 2.7.4
>



-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2017-11-03 12:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-29  9:49 [RFC v8 0/7] SCU/PMC/PUNIT Inter-Processor Communication(IPC) driver cleanup sathyanarayanan.kuppuswamy
2017-10-29  9:49 ` [RFC v8 1/7] platform/x86: intel_punit_ipc: Fix resource ioremap warning sathyanarayanan.kuppuswamy
2017-11-03 12:13   ` Andy Shevchenko [this message]
2017-10-29  9:49 ` [RFC v8 2/7] platform/x86: intel_pmc_ipc: Use MFD framework to create dependent devices sathyanarayanan.kuppuswamy
2017-11-23 11:49   ` Heikki Krogerus
2017-11-23 17:08     ` Guenter Roeck
2018-01-21  4:42     ` sathya
2017-10-29  9:49 ` [RFC v8 3/7] platform/x86: intel_pmc_ipc: Use regmap calls for GCR updates sathyanarayanan.kuppuswamy
2017-11-23 12:29   ` Heikki Krogerus
2017-10-29  9:49 ` [RFC v8 4/7] platform: x86: Add generic Intel IPC driver sathyanarayanan.kuppuswamy
2017-11-23 13:29   ` Heikki Krogerus
2018-01-21  4:59     ` sathya
2017-10-29  9:49 ` [RFC v8 5/7] platform/x86: intel_punit_ipc: Use generic intel ipc device calls sathyanarayanan.kuppuswamy
2017-10-29  9:49 ` [RFC v8 6/7] platform/x86: intel_pmc_ipc: Use generic Intel IPC " sathyanarayanan.kuppuswamy
2017-10-29  9:50 ` [RFC v8 7/7] platform/x86: intel_scu_ipc: " sathyanarayanan.kuppuswamy
2017-11-23 13:56 ` [RFC v8 0/7] SCU/PMC/PUNIT Inter-Processor Communication(IPC) driver cleanup Heikki Krogerus

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=CAHp75VffZCTgsbgm3RU-vAL4Xf1A60NtDaFwaLQRp5UqtztfuQ@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=hpa@zytor.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=qipeng.zha@intel.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=sathyaosid@gmail.com \
    --cc=souvik.k.chakravarty@intel.com \
    --cc=tglx@linutronix.de \
    --cc=wim@iguana.be \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).