login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
17
Re: [PATCH 3/4] [Patch-next] ACPI, APEI Fix the return value(==NULL) of acpi_pre_map always.
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Jin Dongming
Subject:
Re: [PATCH 3/4] [Patch-next] ACPI, APEI Fix the return value(==NULL) of acpi_pre_map always.
Date: Monday, August 16, 2010 - 9:47 pm
(2010/08/17 13:15), Huang Ying wrote:
quoted text
> On Tue, 2010-08-17 at 10:43 +0800, Jin Dongming wrote: >> (2010/08/17 10:37), Huang Ying wrote: >>> On Tue, 2010-08-17 at 08:56 +0800, Jin Dongming wrote: >>>> acpi_pre_map() is used for remapping the physical address of I/O, so >>>> it should be return NULL or remapped virtual address. The problem >>>> is whether I/O remapping is successful or not, the function returns >>>> NULL always. >>> >>> No. NULL is returned for error path only. Please check the code again. >> >> There three places used the local variable vaddr in acpi_pre_map() in next-tree. >> 1. 115 vaddr = __acpi_try_ioremap(paddr, size); >> 2. 122 vaddr = ioremap(pg_off, pg_sz); >> 3. 135 vaddr = __acpi_try_ioremap(paddr, size); >> >> Let's think about the following statement. >> Assumption: the physical address has never been remapped. >> Step: >> 1. vaddr == NULL >> Because the physical address is not registered in the acpi_iomaps, >> it should be returned NULL from __acpi_try_ioremap(). >> >> 2. vaddr == the virtual address of the physical address. >> Here if ioremap is successful, the value of vaddr should be >> the virtual address returned from ioremap(). >> >> 3. vaddr == NULL <== IMPORTANT >> Here it is because the physical address has not been registered >> in the acpi_iomaps yet, it still return NULL from __acpi_try_ioremap(). >> So it is why vaddr == NULL, even if the physical address has never >> been remapped. >> >> Result: vaddr == NULL. > > return vaddr + (paddr - pg_off), is not NULL for common cases. > >> And if the vaddr is not NULL, it could not be added into acpi_iomaps. >> Codes in acpi_pre_map() is like following. >> >> 134 spin_lock_irqsave(&acpi_iomaps_lock, flags); >> 135 vaddr = __acpi_try_ioremap(paddr, size); <== the 3rd step >> 136 if (vaddr) { >> 137 spin_unlock_irqrestore(&acpi_iomaps_lock, flags); >> 138 iounmap(map->vaddr); >> 139 kfree(map); >> 140 return vaddr; >> 141 } >> 142 list_add_tail_rcu(&map->list, &acpi_iomaps); <== add into acpi_iomaps. >> 143 spin_unlock_irqrestore(&acpi_iomaps_lock, flags); > > Oops, this is a bug, and your patch really fix it. But I think you > should change the patch description. NULL is not returned in almost all > cases. Because (paddr - pg_off) is not zero in common cases. > > Best Regards, > Huang Ying >
OK. I will modify the description of this patch and resend it. Best Regards, Jin Dongming
quoted text
> > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to
majordomo@vger.kernel.org
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at
http://www.tux.org/lkml/
> >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH 3/4] [Patch-next] ACPI, APEI Fix the return value(= ...
, Jin Dongming
, (Mon Aug 16, 5:56 pm)
Re: [PATCH 3/4] [Patch-next] ACPI, APEI Fix the return val ...
, Huang Ying
, (Mon Aug 16, 6:37 pm)
Re: [PATCH 3/4] [Patch-next] ACPI, APEI Fix the return val ...
, Jin Dongming
, (Mon Aug 16, 7:43 pm)
Re: [PATCH 3/4] [Patch-next] ACPI, APEI Fix the return val ...
, Huang Ying
, (Mon Aug 16, 9:15 pm)
Re: [PATCH 3/4] [Patch-next] ACPI, APEI Fix the return val ...
, Jin Dongming
, (Mon Aug 16, 9:47 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate