Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Acpica access #138

Merged
merged 3 commits into from
May 17, 2016
Merged

Acpica access #138

merged 3 commits into from
May 17, 2016

Conversation

zetalog
Copy link
Contributor

@zetalog zetalog commented May 3, 2016

2 issues are detected by coverity unit tests.

@zetalog zetalog force-pushed the acpica-access branch 4 times, most recently from ca6a1ed to 9a9e07d Compare May 3, 2016 06:21
@@ -167,13 +167,21 @@ AcpiHwGetAccessBitWidth (

if (!Reg->AccessWidth)
{
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO)
if (Reg->BitWidth && !(Reg->BitWidth & 0x07) &&
ACPI_IS_POWER_OF_TWO (Reg->BitWidth >> 3))
{
Copy link
Contributor Author

@zetalog zetalog May 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks we could further limit this to:
if (!Reg->BitOffset && Reg->BitWidth &&
ACPI_IS_POWER_OF_TWO (Reg->BitWidth) && ACPI_IS_ALIGNED(Reg->BitWidth, 8) &&
ACPI_IS_ALIGNED(Reg->Address, Reg->BitWidth))

Lv Zheng added 3 commits May 4, 2016 10:22
This patch fixes 2 issues in AccessWidth/BitOffset support and adds
comments to justify the BitOffset/BitWidth style macro usages. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
This patch introduces ACPI_IS_ALIGNED() macro. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
The old register descriptors are translated in AcpiTbInitGenericAddress()
with AccessWidth being filled with 0. This breaks code in
AcpiHwGetAccessBitWidth() when the registers are 16-bit IO ports and their
BitWidth fields are filled with 16. The rapid fix is meant to make code
written for AcpiHwGetAccessBitWidth() regression safer before the issue is
correctly fixed from AcpiTbInitGenericAddress(). Reported by
John Baldwin <jhb@freebsd.org>, Fixed by Lv Zheng <lv.zheng@intel.com>,
Tested by Jung-uk Kim <jkim@freebsd.org>.

Reported-by: John Baldwin <jhb@freebsd.org>
Tested-by: Jung-uk Kim <jkim@freebsd.org>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
@zetalog
Copy link
Contributor Author

zetalog commented May 9, 2016

Hi,

Patches in this pull request are all in Linux upstream.
Could we get this merged?

Thanks
-Lv

@acpibob acpibob merged commit c450c13 into acpica:master May 17, 2016
@zetalog zetalog deleted the acpica-access branch May 18, 2016 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants