mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xi Pardee <xi.pardee@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: irenic.rajneesh@gmail.com, david.e.box@linux.intel.com,
	Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v2 07/11] platform/x86:intel/pmc: Check return value of ioremap
Date: Mon, 9 Sep 2024 23:53:47 -0700	[thread overview]
Message-ID: <21b8777a-827b-4729-a8d3-36024983dc2c@linux.intel.com> (raw)
In-Reply-To: <b3665329-dbe9-d78d-a988-b7c346b069de@linux.intel.com>


On 8/29/2024 4:06 AM, Ilpo Järvinen wrote:
> On Wed, 28 Aug 2024, Xi Pardee wrote:
>
>> Check the return value of ioremap operation and return ENOMEM when
>> the operation fails for better error handling.
>>
>> Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
>> ---
>>   drivers/platform/x86/intel/pmc/ssram_telemetry.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/platform/x86/intel/pmc/ssram_telemetry.c b/drivers/platform/x86/intel/pmc/ssram_telemetry.c
>> index 73c727042ca6..f625d39d1aa3 100644
>> --- a/drivers/platform/x86/intel/pmc/ssram_telemetry.c
>> +++ b/drivers/platform/x86/intel/pmc/ssram_telemetry.c
>> @@ -84,6 +84,9 @@ pmc_core_ssram_get_pmc(struct pmc_dev *pmcdev, unsigned int pmc_idx, u32 offset)
>>   	ssram_base = ssram_pcidev->resource[0].start;
>>   	tmp_ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);
>>   
>> +	if (!tmp_ssram)
>> +		return -ENOMEM;
>> +
>>   	if (pmc_idx != PMC_IDX_MAIN) {
>>   		/*
>>   		 * The secondary PMC BARS (which are behind hidden PCI devices)
> Is this a fix to the current code? And should have Fixes tag and go
> first because of that?
This is an improvement of the current code. We should check the value of 
ioremap before using it to avoid
failure in the later process. I can add a fixes tag to it. Should this 
patch be its own patch series and not
include in this one? Or should it be moved to be the first patch of this 
series?

Thanks!
Xi
>

  reply	other threads:[~2024-09-10  6:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 22:29 [PATCH v2 00/11] Create Intel PMC SSRAM Telemetry driver Xi Pardee
2024-08-28 22:29 ` [PATCH v2 01/11] platform/x86:intel/pmc: Move PMC Core related functions Xi Pardee
2024-08-29 10:49   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 02/11] platform/x86:intel/pmc: Rename core_ssram to ssram_telemetry Xi Pardee
2024-08-29 10:50   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 03/11] platform/x86:intel/pmc: Move PMC devid to core.h Xi Pardee
2024-08-29 10:52   ` Ilpo Järvinen
2024-09-10  6:55     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 04/11] platform/x86:intel/pmc: Convert index variables to be unsigned Xi Pardee
2024-08-29 10:54   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 05/11] platform/x86:intel/pmc: Remove unneeded h file inclusion Xi Pardee
2024-08-29 11:02   ` Ilpo Järvinen
2024-09-10  7:08     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 06/11] platform/x86:intel/pmc: Remove unneeded io operations Xi Pardee
2024-08-28 22:29 ` [PATCH v2 07/11] platform/x86:intel/pmc: Check return value of ioremap Xi Pardee
2024-08-29 11:06   ` Ilpo Järvinen
2024-09-10  6:53     ` Xi Pardee [this message]
2024-08-28 22:29 ` [PATCH v2 08/11] platform/x86:intel/pmc: Create Intel PMC SSRAM Telemetry driver Xi Pardee
2024-08-29 12:02   ` Ilpo Järvinen
2024-09-10 19:57     ` Xi Pardee
2024-08-28 22:29 ` [PATCH v2 09/11] platform/x86:intel/pmc: Add Lunar Lake SSRAM devid Xi Pardee
2024-08-29 12:03   ` Ilpo Järvinen
2024-08-28 22:29 ` [PATCH v2 10/11] platform/x86:intel/pmt: Get PMC from SSRAM for Lunar Lake Xi Pardee
2024-08-28 22:29 ` [PATCH v2 11/11] platform/x86:intel/pmc: Get LPM information " Xi Pardee
2024-08-29 12:13   ` Ilpo Järvinen
2024-09-10  0:49     ` Xi Pardee

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=21b8777a-827b-4729-a8d3-36024983dc2c@linux.intel.com \
    --to=xi.pardee@linux.intel.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=platform-driver-x86@vger.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

all inboxes | Powered by JetHome®