All of lore.kernel.org
 help / color / mirror / Atom feed
From: gengdongjiu <gengdongjiu@huawei.com>
To: rjw@rjwysocki.net, lenb@kernel.org, tbaicar@codeaurora.org,
	will.deacon@arm.com, james.morse@arm.com, bp@suse.de,
	prarit@redhat.com, andriy.shevchenko@linux.intel.com,
	zjzhang@codeaurora.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] acpi: ghes: fix the OSPM acknowledges error flow
Date: Fri, 4 Aug 2017 17:53:24 +0800	[thread overview]
Message-ID: <aecef50c-37f8-3e18-c9e9-d042aa8abbb9@huawei.com> (raw)
In-Reply-To: <1501774945-31726-1-git-send-email-gengdongjiu@huawei.com>

Hi,
   please ignore this fix, original logic is right. the Read ACK register directly contain the ACK value, not the ACK address.


On 2017/8/3 23:42, Dongjiu Geng wrote:
> In GHESv2, The read_ack_register is used to specify the
> location of the read ack register, it is only the physical
> address, but not the value. so needs to continue reading
> the address to get the right value. Also It needs to write
> the ack value to the right physical address.
> 
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> ---
>  drivers/acpi/apei/ghes.c | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index bb83044..44bb65f 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -703,16 +703,25 @@ static void ghes_estatus_cache_add(
>  static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
>  {
>  	int rc;
> -	u64 val = 0;
> +	u64 ack_paddr;
> +	u64 ack_val = 0;
>  
> -	rc = apei_read(&val, &gv2->read_ack_register);
> +	rc = apei_read(&ack_paddr, &gv2->read_ack_register);
>  	if (rc)
>  		return rc;
>  
> -	val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
> -	val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
> +	if (!ack_paddr)
> +		return -ENOENT;
> +
> +	ghes_copy_tofrom_phys(&ack_val, ack_paddr,
> +			      sizeof(u64), 1);
>  
> -	return apei_write(val, &gv2->read_ack_register);
> +	ack_val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
> +	ack_val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
> +
> +	ghes_copy_tofrom_phys(&ack_val, ack_paddr,
> +				sizeof(u64), 0);
> +	return 0;
>  }
>  
>  static void __ghes_panic(struct ghes *ghes)
> 


WARNING: multiple messages have this Message-ID (diff)
From: gengdongjiu <gengdongjiu@huawei.com>
To: <rjw@rjwysocki.net>, <lenb@kernel.org>, <tbaicar@codeaurora.org>,
	<will.deacon@arm.com>, <james.morse@arm.com>, <bp@suse.de>,
	<prarit@redhat.com>, <andriy.shevchenko@linux.intel.com>,
	<zjzhang@codeaurora.org>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] acpi: ghes: fix the OSPM acknowledges error flow
Date: Fri, 4 Aug 2017 17:53:24 +0800	[thread overview]
Message-ID: <aecef50c-37f8-3e18-c9e9-d042aa8abbb9@huawei.com> (raw)
In-Reply-To: <1501774945-31726-1-git-send-email-gengdongjiu@huawei.com>

Hi,
   please ignore this fix, original logic is right. the Read ACK register directly contain the ACK value, not the ACK address.


On 2017/8/3 23:42, Dongjiu Geng wrote:
> In GHESv2, The read_ack_register is used to specify the
> location of the read ack register, it is only the physical
> address, but not the value. so needs to continue reading
> the address to get the right value. Also It needs to write
> the ack value to the right physical address.
> 
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> ---
>  drivers/acpi/apei/ghes.c | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index bb83044..44bb65f 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -703,16 +703,25 @@ static void ghes_estatus_cache_add(
>  static int ghes_ack_error(struct acpi_hest_generic_v2 *gv2)
>  {
>  	int rc;
> -	u64 val = 0;
> +	u64 ack_paddr;
> +	u64 ack_val = 0;
>  
> -	rc = apei_read(&val, &gv2->read_ack_register);
> +	rc = apei_read(&ack_paddr, &gv2->read_ack_register);
>  	if (rc)
>  		return rc;
>  
> -	val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
> -	val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
> +	if (!ack_paddr)
> +		return -ENOENT;
> +
> +	ghes_copy_tofrom_phys(&ack_val, ack_paddr,
> +			      sizeof(u64), 1);
>  
> -	return apei_write(val, &gv2->read_ack_register);
> +	ack_val &= gv2->read_ack_preserve << gv2->read_ack_register.bit_offset;
> +	ack_val |= gv2->read_ack_write    << gv2->read_ack_register.bit_offset;
> +
> +	ghes_copy_tofrom_phys(&ack_val, ack_paddr,
> +				sizeof(u64), 0);
> +	return 0;
>  }
>  
>  static void __ghes_panic(struct ghes *ghes)
> 

  reply	other threads:[~2017-08-04  9:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 15:42 [PATCH] acpi: ghes: fix the OSPM acknowledges error flow Dongjiu Geng
2017-08-03 15:42 ` Dongjiu Geng
2017-08-04  9:53 ` gengdongjiu [this message]
2017-08-04  9:53   ` gengdongjiu

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=aecef50c-37f8-3e18-c9e9-d042aa8abbb9@huawei.com \
    --to=gengdongjiu@huawei.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@suse.de \
    --cc=james.morse@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=tbaicar@codeaurora.org \
    --cc=will.deacon@arm.com \
    --cc=zjzhang@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.