From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Alexander Rauth <alexander.rauth@promotion-ie.de>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: EC: limit multibyte access to EC to 8 byte
Date: Fri, 16 Apr 2010 21:24:31 +0400 [thread overview]
Message-ID: <4BC89D4F.8060509@suse.de> (raw)
In-Reply-To: <1271434066-7292-1-git-send-email-alexander.rauth@promotion-ie.de>
Hi Alexander,
Thanks, but we already have patch to do just that.
See https://bugzilla.kernel.org/show_bug.cgi?id=15749
Regards,
Alex.
16.04.2010 20:07, Alexander Rauth пишет:
> commit dadf28a10c3eb29421837a2e413ab869ebd9e168 enabled multibyte
> access to EC, but ignored that the consuming function expects the
> bitfields to be in chunks of maximal 64 bit. So limit multibyte
> access to 8 byte to prevent error in the ACPI layer.
>
> Signed-off-by: Alexander Rauth<alexander.rauth@promotion-ie.de>
> ---
> drivers/acpi/acpica/exprep.c | 17 +++++++++++------
> 1 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
> index a610ebe..58659af 100644
> --- a/drivers/acpi/acpica/exprep.c
> +++ b/drivers/acpi/acpica/exprep.c
> @@ -471,13 +471,18 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
> /* allow full data read from EC address space */
> if (obj_desc->field.region_obj->region.space_id ==
> ACPI_ADR_SPACE_EC) {
> - if (obj_desc->common_field.bit_length> 8)
> - obj_desc->common_field.access_bit_width =
> - ACPI_ROUND_UP(obj_desc->common_field.
> - bit_length, 8);
> + if (obj_desc->common_field.bit_length> 8) {
> + if (obj_desc->common_field.bit_length<= 64) {
> + obj_desc->common_field.access_bit_width =
> + ACPI_ROUND_UP(obj_desc->common_field.
> + bit_length, 8);
> + } else {
> + obj_desc->common_field.access_bit_width = 64;
> + }
> obj_desc->common_field.access_byte_width =
> - ACPI_DIV_8(obj_desc->common_field.
> - access_bit_width);
> + ACPI_DIV_8(obj_desc->common_field.
> + access_bit_width);
> + }
> }
>
> ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: Alexander Rauth <alexander.rauth@promotion-ie.de>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: EC: limit multibyte access to EC to 8 byte
Date: Fri, 16 Apr 2010 21:24:31 +0400 [thread overview]
Message-ID: <4BC89D4F.8060509@suse.de> (raw)
In-Reply-To: <1271434066-7292-1-git-send-email-alexander.rauth@promotion-ie.de>
Hi Alexander,
Thanks, but we already have patch to do just that.
See https://bugzilla.kernel.org/show_bug.cgi?id=15749
Regards,
Alex.
16.04.2010 20:07, Alexander Rauth пишет:
> commit dadf28a10c3eb29421837a2e413ab869ebd9e168 enabled multibyte
> access to EC, but ignored that the consuming function expects the
> bitfields to be in chunks of maximal 64 bit. So limit multibyte
> access to 8 byte to prevent error in the ACPI layer.
>
> Signed-off-by: Alexander Rauth<alexander.rauth@promotion-ie.de>
> ---
> drivers/acpi/acpica/exprep.c | 17 +++++++++++------
> 1 files changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
> index a610ebe..58659af 100644
> --- a/drivers/acpi/acpica/exprep.c
> +++ b/drivers/acpi/acpica/exprep.c
> @@ -471,13 +471,18 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)
> /* allow full data read from EC address space */
> if (obj_desc->field.region_obj->region.space_id ==
> ACPI_ADR_SPACE_EC) {
> - if (obj_desc->common_field.bit_length> 8)
> - obj_desc->common_field.access_bit_width =
> - ACPI_ROUND_UP(obj_desc->common_field.
> - bit_length, 8);
> + if (obj_desc->common_field.bit_length> 8) {
> + if (obj_desc->common_field.bit_length<= 64) {
> + obj_desc->common_field.access_bit_width =
> + ACPI_ROUND_UP(obj_desc->common_field.
> + bit_length, 8);
> + } else {
> + obj_desc->common_field.access_bit_width = 64;
> + }
> obj_desc->common_field.access_byte_width =
> - ACPI_DIV_8(obj_desc->common_field.
> - access_bit_width);
> + ACPI_DIV_8(obj_desc->common_field.
> + access_bit_width);
> + }
> }
>
> ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
next prev parent reply other threads:[~2010-04-16 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-16 16:07 [PATCH] ACPI: EC: limit multibyte access to EC to 8 byte Alexander Rauth
2010-04-16 17:24 ` Alexey Starikovskiy [this message]
2010-04-16 17:24 ` Alexey Starikovskiy
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=4BC89D4F.8060509@suse.de \
--to=astarikovskiy@suse.de \
--cc=alexander.rauth@promotion-ie.de \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@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 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.