LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap
From: Yasuaki Ishimatsu @ 2012-07-11  5:52 UTC (permalink / raw)
  To: Wen Congyang
  Cc: len.brown, linux-acpi, linux-kernel, linux-mm, paulus,
	minchan.kim, kosaki.motohiro, rientjes, cl, linuxppc-dev, akpm,
	liuj97
In-Reply-To: <4FFD09D5.8010605@cn.fujitsu.com>

2012/07/11 14:06, Wen Congyang wrote:
Hi Wen,

> At 07/09/2012 06:33 PM, Yasuaki Ishimatsu Wrote:
>> I don't think that all pages of virtual mapping in removed memory can be
>> freed, since page which type is MIX_SECTION_INFO is difficult to free.
>> So, the patch only frees page which type is SECTION_INFO at first.
>>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Jiang Liu <liuj97@gmail.com>
>> CC: Len Brown <len.brown@intel.com>
>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> CC: Paul Mackerras <paulus@samba.org>
>> CC: Christoph Lameter <cl@linux.com>
>> Cc: Minchan Kim <minchan.kim@gmail.com>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> CC: Wen Congyang <wency@cn.fujitsu.com>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>
>> ---
>>   arch/x86/mm/init_64.c |   91 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   include/linux/mm.h    |    2 +
>>   mm/memory_hotplug.c   |    5 ++
>>   mm/sparse.c           |    5 +-
>>   4 files changed, 101 insertions(+), 2 deletions(-)
>>
>> Index: linux-3.5-rc4/include/linux/mm.h
>> ===================================================================
>> --- linux-3.5-rc4.orig/include/linux/mm.h	2012-07-03 14:22:18.530011567 +0900
>> +++ linux-3.5-rc4/include/linux/mm.h	2012-07-03 14:22:20.999983872 +0900
>> @@ -1588,6 +1588,8 @@ int vmemmap_populate(struct page *start_
>>   void vmemmap_populate_print_last(void);
>>   void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
>>   				  unsigned long size);
>> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
>> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
>>
>>   enum mf_flags {
>>   	MF_COUNT_INCREASED = 1 << 0,
>> Index: linux-3.5-rc4/mm/sparse.c
>> ===================================================================
>> --- linux-3.5-rc4.orig/mm/sparse.c	2012-07-03 14:21:45.071429805 +0900
>> +++ linux-3.5-rc4/mm/sparse.c	2012-07-03 14:22:21.000983767 +0900
>> @@ -614,12 +614,13 @@ static inline struct page *kmalloc_secti
>>   	/* This will make the necessary allocations eventually. */
>>   	return sparse_mem_map_populate(pnum, nid);
>>   }
>> -static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
>> +static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
>>   {
>> -	return; /* XXX: Not implemented yet */
>> +	vmemmap_kfree(page, nr_pages);
> 
> Hmm, I think you try to free the memory allocated in kmalloc_section_memmap().

Yes.

> 
>>   }
>>   static void free_map_bootmem(struct page *page, unsigned long nr_pages)
>>   {
>> +	vmemmap_free_bootmem(page, nr_pages);
>>   }
> 
> Hmm, which function is the memory you try to free allocated in?

The function try to free memory allocated from bootmem. The memory has
been registered by get_page_bootmem(). So we can free the memory by
put_page_bootmem().

> 
>>   #else
>>   static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>> Index: linux-3.5-rc4/arch/x86/mm/init_64.c
>> ===================================================================
>> --- linux-3.5-rc4.orig/arch/x86/mm/init_64.c	2012-07-03 14:22:18.538011465 +0900
>> +++ linux-3.5-rc4/arch/x86/mm/init_64.c	2012-07-03 14:22:21.007983103 +0900
>> @@ -978,6 +978,97 @@ vmemmap_populate(struct page *start_page
>>   	return 0;
>>   }
>>
>> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
>> +				      struct page **pp)
>> +{
>> +	pgd_t *pgd;
>> +	pud_t *pud;
>> +	pmd_t *pmd;
>> +	pte_t *pte;
>> +	unsigned long next;
>> +
>> +	*pp = NULL;
>> +
>> +	pgd = pgd_offset_k(addr);
>> +	if (pgd_none(*pgd))
>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
> 
> Hmm, why not goto next pgd?

Does it mean "return (addr + PGDIR_SIZE) & PGDIR_MASK"?

> 
>> +
>> +	pud = pud_offset(pgd, addr);
>> +	if (pud_none(*pud))
>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>> +
>> +	if (!cpu_has_pse) {
>> +		next = (addr + PAGE_SIZE) & PAGE_MASK;
>> +		pmd = pmd_offset(pud, addr);
>> +		if (pmd_none(*pmd))
>> +			return next;
>> +
>> +		pte = pte_offset_kernel(pmd, addr);
>> +		if (pte_none(*pte))
>> +			return next;
>> +
>> +		*pp = pte_page(*pte);
>> +		pte_clear(&init_mm, addr, pte);
> 
> I think you should flush tlb here.

Thanks, I'll update it.

> 
>> +	} else {
>> +		next = pmd_addr_end(addr, end);
>> +
>> +		pmd = pmd_offset(pud, addr);
>> +		if (pmd_none(*pmd))
>> +			return next;
>> +
>> +		*pp = pmd_page(*pmd);
>> +		pmd_clear(pmd);
>> +	}
>> +
>> +	return next;
>> +}
>> +
>> +void __meminit
>> +vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>> +{
>> +	unsigned long addr = (unsigned long)memmap;
>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>> +	unsigned long next;
>> +	unsigned int order;
>> +	struct page *page;
>> +
>> +	for (; addr < end; addr = next) {
>> +		page = NULL;
>> +		next = find_and_clear_pte_page(addr, end, &page);
>> +		if (!page)
>> +			continue;
>> +
>> +		if (is_vmalloc_addr(page_address(page)))
>> +			vfree(page_address(page));
> 
> Hmm, the memory is allocated in vmemmap_alloc_block(), and the address
> can not be vmalloc address.

Does it mean the if sentence is unnecessary?

> 
>> +		else {
>> +			order = next - addr;
>> +			free_pages((unsigned long)page_address(page),
>> +				   get_order(order));
> 
> OOPS. I think we cannot free pages here.
> 
> sizeof(struct page) is less than PAGE_SIZE. We store more than one struct
> page in the same page. If you free it here while the other struct page
> is in use, it is very dangerous.

The memory has page structures for hot-removed memory. So nobody is using
these pages, since the hot-removed memory has been offlined.

>> +		}
>> +	}
>> +}
>> +
>> +void __meminit
>> +vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>> +{
>> +	unsigned long addr = (unsigned long)memmap;
>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>> +	unsigned long next;
>> +	struct page *page;
>> +	unsigned long magic;
>> +
>> +	for (; addr < end; addr = next) {
>> +		page = NULL;
>> +		next = find_and_clear_pte_page(addr, end, &page);
>> +		if (!page)
>> +			continue;
>> +
>> +		magic = (unsigned long) page->lru.next;
>> +		if (magic == SECTION_INFO)
>> +			put_page_bootmem(page);
>> +	}
>> +}
>> +
>>   void __meminit
>>   register_page_bootmem_memmap(unsigned long section_nr, struct page *start_page,
>>   			     unsigned long size)
>> Index: linux-3.5-rc4/mm/memory_hotplug.c
>> ===================================================================
>> --- linux-3.5-rc4.orig/mm/memory_hotplug.c	2012-07-03 14:22:18.522011667 +0900
>> +++ linux-3.5-rc4/mm/memory_hotplug.c	2012-07-03 14:22:21.012982694 +0900
>> @@ -303,6 +303,8 @@ static int __meminit __add_section(int n
>>   #ifdef CONFIG_SPARSEMEM_VMEMMAP
> 
> I think this line can be removed now.

I'll update it.

Thanks,
Yasuaki Ishimatsu

> 
> Thanks
> Wen Congyang
> 
>>   static int __remove_section(struct zone *zone, struct mem_section *ms)
>>   {
>> +	unsigned long flags;
>> +	struct pglist_data *pgdat = zone->zone_pgdat;
>>   	int ret;
>>
>>   	if (!valid_section(ms))
>> @@ -310,6 +312,9 @@ static int __remove_section(struct zone
>>
>>   	ret = unregister_memory_section(ms);
>>
>> +	pgdat_resize_lock(pgdat, &flags);
>> +	sparse_remove_one_section(zone, ms);
>> +	pgdat_resize_unlock(pgdat, &flags);
>>   	return ret;
>>   }
>>   #else
>>
>>
> 

^ permalink raw reply

* Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap
From: Wen Congyang @ 2012-07-11  6:25 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: len.brown, linux-acpi, linux-kernel, linux-mm, paulus,
	minchan.kim, kosaki.motohiro, rientjes, cl, linuxppc-dev, akpm,
	liuj97
In-Reply-To: <4FFD14B0.9010606@jp.fujitsu.com>

At 07/11/2012 01:52 PM, Yasuaki Ishimatsu Wrote:
> 2012/07/11 14:06, Wen Congyang wrote:
> Hi Wen,
> 
>> At 07/09/2012 06:33 PM, Yasuaki Ishimatsu Wrote:
>>> I don't think that all pages of virtual mapping in removed memory can be
>>> freed, since page which type is MIX_SECTION_INFO is difficult to free.
>>> So, the patch only frees page which type is SECTION_INFO at first.
>>>
>>> CC: David Rientjes <rientjes@google.com>
>>> CC: Jiang Liu <liuj97@gmail.com>
>>> CC: Len Brown <len.brown@intel.com>
>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> CC: Paul Mackerras <paulus@samba.org>
>>> CC: Christoph Lameter <cl@linux.com>
>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>
>>> ---
>>>   arch/x86/mm/init_64.c |   91 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>   include/linux/mm.h    |    2 +
>>>   mm/memory_hotplug.c   |    5 ++
>>>   mm/sparse.c           |    5 +-
>>>   4 files changed, 101 insertions(+), 2 deletions(-)
>>>
>>> Index: linux-3.5-rc4/include/linux/mm.h
>>> ===================================================================
>>> --- linux-3.5-rc4.orig/include/linux/mm.h	2012-07-03 14:22:18.530011567 +0900
>>> +++ linux-3.5-rc4/include/linux/mm.h	2012-07-03 14:22:20.999983872 +0900
>>> @@ -1588,6 +1588,8 @@ int vmemmap_populate(struct page *start_
>>>   void vmemmap_populate_print_last(void);
>>>   void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
>>>   				  unsigned long size);
>>> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
>>> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
>>>
>>>   enum mf_flags {
>>>   	MF_COUNT_INCREASED = 1 << 0,
>>> Index: linux-3.5-rc4/mm/sparse.c
>>> ===================================================================
>>> --- linux-3.5-rc4.orig/mm/sparse.c	2012-07-03 14:21:45.071429805 +0900
>>> +++ linux-3.5-rc4/mm/sparse.c	2012-07-03 14:22:21.000983767 +0900
>>> @@ -614,12 +614,13 @@ static inline struct page *kmalloc_secti
>>>   	/* This will make the necessary allocations eventually. */
>>>   	return sparse_mem_map_populate(pnum, nid);
>>>   }
>>> -static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
>>> +static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
>>>   {
>>> -	return; /* XXX: Not implemented yet */
>>> +	vmemmap_kfree(page, nr_pages);
>>
>> Hmm, I think you try to free the memory allocated in kmalloc_section_memmap().
> 
> Yes.
> 
>>
>>>   }
>>>   static void free_map_bootmem(struct page *page, unsigned long nr_pages)
>>>   {
>>> +	vmemmap_free_bootmem(page, nr_pages);
>>>   }
>>
>> Hmm, which function is the memory you try to free allocated in?
> 
> The function try to free memory allocated from bootmem. The memory has
> been registered by get_page_bootmem(). So we can free the memory by
> put_page_bootmem().

OK, I will read these codes, and check it.

> 
>>
>>>   #else
>>>   static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>>> Index: linux-3.5-rc4/arch/x86/mm/init_64.c
>>> ===================================================================
>>> --- linux-3.5-rc4.orig/arch/x86/mm/init_64.c	2012-07-03 14:22:18.538011465 +0900
>>> +++ linux-3.5-rc4/arch/x86/mm/init_64.c	2012-07-03 14:22:21.007983103 +0900
>>> @@ -978,6 +978,97 @@ vmemmap_populate(struct page *start_page
>>>   	return 0;
>>>   }
>>>
>>> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
>>> +				      struct page **pp)
>>> +{
>>> +	pgd_t *pgd;
>>> +	pud_t *pud;
>>> +	pmd_t *pmd;
>>> +	pte_t *pte;
>>> +	unsigned long next;
>>> +
>>> +	*pp = NULL;
>>> +
>>> +	pgd = pgd_offset_k(addr);
>>> +	if (pgd_none(*pgd))
>>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>>
>> Hmm, why not goto next pgd?
> 
> Does it mean "return (addr + PGDIR_SIZE) & PGDIR_MASK"?
> 
>>
>>> +
>>> +	pud = pud_offset(pgd, addr);
>>> +	if (pud_none(*pud))
>>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>>> +
>>> +	if (!cpu_has_pse) {
>>> +		next = (addr + PAGE_SIZE) & PAGE_MASK;
>>> +		pmd = pmd_offset(pud, addr);
>>> +		if (pmd_none(*pmd))
>>> +			return next;
>>> +
>>> +		pte = pte_offset_kernel(pmd, addr);
>>> +		if (pte_none(*pte))
>>> +			return next;
>>> +
>>> +		*pp = pte_page(*pte);
>>> +		pte_clear(&init_mm, addr, pte);
>>
>> I think you should flush tlb here.
> 
> Thanks, I'll update it.
> 
>>
>>> +	} else {
>>> +		next = pmd_addr_end(addr, end);
>>> +
>>> +		pmd = pmd_offset(pud, addr);
>>> +		if (pmd_none(*pmd))
>>> +			return next;
>>> +
>>> +		*pp = pmd_page(*pmd);
>>> +		pmd_clear(pmd);
>>> +	}
>>> +
>>> +	return next;
>>> +}
>>> +
>>> +void __meminit
>>> +vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +	unsigned long addr = (unsigned long)memmap;
>>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>>> +	unsigned long next;
>>> +	unsigned int order;
>>> +	struct page *page;
>>> +
>>> +	for (; addr < end; addr = next) {
>>> +		page = NULL;
>>> +		next = find_and_clear_pte_page(addr, end, &page);
>>> +		if (!page)
>>> +			continue;
>>> +
>>> +		if (is_vmalloc_addr(page_address(page)))
>>> +			vfree(page_address(page));
>>
>> Hmm, the memory is allocated in vmemmap_alloc_block(), and the address
>> can not be vmalloc address.
> 
> Does it mean the if sentence is unnecessary?
> 
>>
>>> +		else {
>>> +			order = next - addr;
>>> +			free_pages((unsigned long)page_address(page),
>>> +				   get_order(order));
>>
>> OOPS. I think we cannot free pages here.
>>
>> sizeof(struct page) is less than PAGE_SIZE. We store more than one struct
>> page in the same page. If you free it here while the other struct page
>> is in use, it is very dangerous.
> 
> The memory has page structures for hot-removed memory. So nobody is using
> these pages, since the hot-removed memory has been offlined.

The memory has page structures for hot-removed memory, but it may contain
page structures for the other hot-added memory.

IIUC, If we use sparse-vmemmap, all page structures is stored here.

Thanks
Wen Congyang

> 
>>> +		}
>>> +	}
>>> +}
>>> +
>>> +void __meminit
>>> +vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>> +{
>>> +	unsigned long addr = (unsigned long)memmap;
>>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>>> +	unsigned long next;
>>> +	struct page *page;
>>> +	unsigned long magic;
>>> +
>>> +	for (; addr < end; addr = next) {
>>> +		page = NULL;
>>> +		next = find_and_clear_pte_page(addr, end, &page);
>>> +		if (!page)
>>> +			continue;
>>> +
>>> +		magic = (unsigned long) page->lru.next;
>>> +		if (magic == SECTION_INFO)
>>> +			put_page_bootmem(page);
>>> +	}
>>> +}
>>> +
>>>   void __meminit
>>>   register_page_bootmem_memmap(unsigned long section_nr, struct page *start_page,
>>>   			     unsigned long size)
>>> Index: linux-3.5-rc4/mm/memory_hotplug.c
>>> ===================================================================
>>> --- linux-3.5-rc4.orig/mm/memory_hotplug.c	2012-07-03 14:22:18.522011667 +0900
>>> +++ linux-3.5-rc4/mm/memory_hotplug.c	2012-07-03 14:22:21.012982694 +0900
>>> @@ -303,6 +303,8 @@ static int __meminit __add_section(int n
>>>   #ifdef CONFIG_SPARSEMEM_VMEMMAP
>>
>> I think this line can be removed now.
> 
> I'll update it.
> 
> Thanks,
> Yasuaki Ishimatsu
> 
>>
>> Thanks
>> Wen Congyang
>>
>>>   static int __remove_section(struct zone *zone, struct mem_section *ms)
>>>   {
>>> +	unsigned long flags;
>>> +	struct pglist_data *pgdat = zone->zone_pgdat;
>>>   	int ret;
>>>
>>>   	if (!valid_section(ms))
>>> @@ -310,6 +312,9 @@ static int __remove_section(struct zone
>>>
>>>   	ret = unregister_memory_section(ms);
>>>
>>> +	pgdat_resize_lock(pgdat, &flags);
>>> +	sparse_remove_one_section(zone, ms);
>>> +	pgdat_resize_unlock(pgdat, &flags);
>>>   	return ret;
>>>   }
>>>   #else
>>>
>>>
>>
> 
> 
> 
> 

^ permalink raw reply

* Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap
From: Yasuaki Ishimatsu @ 2012-07-11  6:48 UTC (permalink / raw)
  To: Wen Congyang
  Cc: len.brown, linux-acpi, linux-kernel, linux-mm, paulus,
	minchan.kim, kosaki.motohiro, rientjes, cl, linuxppc-dev, akpm,
	liuj97
In-Reply-To: <4FFD1C71.2020404@cn.fujitsu.com>

Hi Wen,

2012/07/11 15:25, Wen Congyang wrote:
> At 07/11/2012 01:52 PM, Yasuaki Ishimatsu Wrote:
>> 2012/07/11 14:06, Wen Congyang wrote:
>> Hi Wen,
>>
>>> At 07/09/2012 06:33 PM, Yasuaki Ishimatsu Wrote:
>>>> I don't think that all pages of virtual mapping in removed memory can be
>>>> freed, since page which type is MIX_SECTION_INFO is difficult to free.
>>>> So, the patch only frees page which type is SECTION_INFO at first.
>>>>
>>>> CC: David Rientjes <rientjes@google.com>
>>>> CC: Jiang Liu <liuj97@gmail.com>
>>>> CC: Len Brown <len.brown@intel.com>
>>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>> CC: Paul Mackerras <paulus@samba.org>
>>>> CC: Christoph Lameter <cl@linux.com>
>>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>>
>>>> ---
>>>>    arch/x86/mm/init_64.c |   91 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>    include/linux/mm.h    |    2 +
>>>>    mm/memory_hotplug.c   |    5 ++
>>>>    mm/sparse.c           |    5 +-
>>>>    4 files changed, 101 insertions(+), 2 deletions(-)
>>>>
>>>> Index: linux-3.5-rc4/include/linux/mm.h
>>>> ===================================================================
>>>> --- linux-3.5-rc4.orig/include/linux/mm.h	2012-07-03 14:22:18.530011567 +0900
>>>> +++ linux-3.5-rc4/include/linux/mm.h	2012-07-03 14:22:20.999983872 +0900
>>>> @@ -1588,6 +1588,8 @@ int vmemmap_populate(struct page *start_
>>>>    void vmemmap_populate_print_last(void);
>>>>    void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
>>>>    				  unsigned long size);
>>>> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
>>>> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
>>>>
>>>>    enum mf_flags {
>>>>    	MF_COUNT_INCREASED = 1 << 0,
>>>> Index: linux-3.5-rc4/mm/sparse.c
>>>> ===================================================================
>>>> --- linux-3.5-rc4.orig/mm/sparse.c	2012-07-03 14:21:45.071429805 +0900
>>>> +++ linux-3.5-rc4/mm/sparse.c	2012-07-03 14:22:21.000983767 +0900
>>>> @@ -614,12 +614,13 @@ static inline struct page *kmalloc_secti
>>>>    	/* This will make the necessary allocations eventually. */
>>>>    	return sparse_mem_map_populate(pnum, nid);
>>>>    }
>>>> -static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
>>>> +static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
>>>>    {
>>>> -	return; /* XXX: Not implemented yet */
>>>> +	vmemmap_kfree(page, nr_pages);
>>>
>>> Hmm, I think you try to free the memory allocated in kmalloc_section_memmap().
>>
>> Yes.
>>
>>>
>>>>    }
>>>>    static void free_map_bootmem(struct page *page, unsigned long nr_pages)
>>>>    {
>>>> +	vmemmap_free_bootmem(page, nr_pages);
>>>>    }
>>>
>>> Hmm, which function is the memory you try to free allocated in?
>>
>> The function try to free memory allocated from bootmem. The memory has
>> been registered by get_page_bootmem(). So we can free the memory by
>> put_page_bootmem().
> 
> OK, I will read these codes, and check it.
> 
>>
>>>
>>>>    #else
>>>>    static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>>>> Index: linux-3.5-rc4/arch/x86/mm/init_64.c
>>>> ===================================================================
>>>> --- linux-3.5-rc4.orig/arch/x86/mm/init_64.c	2012-07-03 14:22:18.538011465 +0900
>>>> +++ linux-3.5-rc4/arch/x86/mm/init_64.c	2012-07-03 14:22:21.007983103 +0900
>>>> @@ -978,6 +978,97 @@ vmemmap_populate(struct page *start_page
>>>>    	return 0;
>>>>    }
>>>>
>>>> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
>>>> +				      struct page **pp)
>>>> +{
>>>> +	pgd_t *pgd;
>>>> +	pud_t *pud;
>>>> +	pmd_t *pmd;
>>>> +	pte_t *pte;
>>>> +	unsigned long next;
>>>> +
>>>> +	*pp = NULL;
>>>> +
>>>> +	pgd = pgd_offset_k(addr);
>>>> +	if (pgd_none(*pgd))
>>>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>>>
>>> Hmm, why not goto next pgd?
>>
>> Does it mean "return (addr + PGDIR_SIZE) & PGDIR_MASK"?
>>
>>>
>>>> +
>>>> +	pud = pud_offset(pgd, addr);
>>>> +	if (pud_none(*pud))
>>>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>>>> +
>>>> +	if (!cpu_has_pse) {
>>>> +		next = (addr + PAGE_SIZE) & PAGE_MASK;
>>>> +		pmd = pmd_offset(pud, addr);
>>>> +		if (pmd_none(*pmd))
>>>> +			return next;
>>>> +
>>>> +		pte = pte_offset_kernel(pmd, addr);
>>>> +		if (pte_none(*pte))
>>>> +			return next;
>>>> +
>>>> +		*pp = pte_page(*pte);
>>>> +		pte_clear(&init_mm, addr, pte);
>>>
>>> I think you should flush tlb here.
>>
>> Thanks, I'll update it.
>>
>>>
>>>> +	} else {
>>>> +		next = pmd_addr_end(addr, end);
>>>> +
>>>> +		pmd = pmd_offset(pud, addr);
>>>> +		if (pmd_none(*pmd))
>>>> +			return next;
>>>> +
>>>> +		*pp = pmd_page(*pmd);
>>>> +		pmd_clear(pmd);
>>>> +	}
>>>> +
>>>> +	return next;
>>>> +}
>>>> +
>>>> +void __meminit
>>>> +vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>>> +{
>>>> +	unsigned long addr = (unsigned long)memmap;
>>>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>>>> +	unsigned long next;
>>>> +	unsigned int order;
>>>> +	struct page *page;
>>>> +
>>>> +	for (; addr < end; addr = next) {
>>>> +		page = NULL;
>>>> +		next = find_and_clear_pte_page(addr, end, &page);
>>>> +		if (!page)
>>>> +			continue;
>>>> +
>>>> +		if (is_vmalloc_addr(page_address(page)))
>>>> +			vfree(page_address(page));
>>>
>>> Hmm, the memory is allocated in vmemmap_alloc_block(), and the address
>>> can not be vmalloc address.
>>
>> Does it mean the if sentence is unnecessary?
>>
>>>
>>>> +		else {
>>>> +			order = next - addr;
>>>> +			free_pages((unsigned long)page_address(page),
>>>> +				   get_order(order));
>>>
>>> OOPS. I think we cannot free pages here.
>>>
>>> sizeof(struct page) is less than PAGE_SIZE. We store more than one struct
>>> page in the same page. If you free it here while the other struct page
>>> is in use, it is very dangerous.
>>
>> The memory has page structures for hot-removed memory. So nobody is using
>> these pages, since the hot-removed memory has been offlined.
> 
> The memory has page structures for hot-removed memory, but it may contain
> page structures for the other hot-added memory.

Yes. There may be such corner case. But when does the corner case appear?
When removed memory is not aligned to PMD_SIZE/PAGE_SIZE, does the corner
case appear? Do you know it?

Thank,
Yasuaki Ishimatsu

> 
> IIUC, If we use sparse-vmemmap, all page structures is stored here.
> 
> Thanks
> Wen Congyang
> 
>>
>>>> +		}
>>>> +	}
>>>> +}
>>>> +
>>>> +void __meminit
>>>> +vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>>> +{
>>>> +	unsigned long addr = (unsigned long)memmap;
>>>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>>>> +	unsigned long next;
>>>> +	struct page *page;
>>>> +	unsigned long magic;
>>>> +
>>>> +	for (; addr < end; addr = next) {
>>>> +		page = NULL;
>>>> +		next = find_and_clear_pte_page(addr, end, &page);
>>>> +		if (!page)
>>>> +			continue;
>>>> +
>>>> +		magic = (unsigned long) page->lru.next;
>>>> +		if (magic == SECTION_INFO)
>>>> +			put_page_bootmem(page);
>>>> +	}
>>>> +}
>>>> +
>>>>    void __meminit
>>>>    register_page_bootmem_memmap(unsigned long section_nr, struct page *start_page,
>>>>    			     unsigned long size)
>>>> Index: linux-3.5-rc4/mm/memory_hotplug.c
>>>> ===================================================================
>>>> --- linux-3.5-rc4.orig/mm/memory_hotplug.c	2012-07-03 14:22:18.522011667 +0900
>>>> +++ linux-3.5-rc4/mm/memory_hotplug.c	2012-07-03 14:22:21.012982694 +0900
>>>> @@ -303,6 +303,8 @@ static int __meminit __add_section(int n
>>>>    #ifdef CONFIG_SPARSEMEM_VMEMMAP
>>>
>>> I think this line can be removed now.
>>
>> I'll update it.
>>
>> Thanks,
>> Yasuaki Ishimatsu
>>
>>>
>>> Thanks
>>> Wen Congyang
>>>
>>>>    static int __remove_section(struct zone *zone, struct mem_section *ms)
>>>>    {
>>>> +	unsigned long flags;
>>>> +	struct pglist_data *pgdat = zone->zone_pgdat;
>>>>    	int ret;
>>>>
>>>>    	if (!valid_section(ms))
>>>> @@ -310,6 +312,9 @@ static int __remove_section(struct zone
>>>>
>>>>    	ret = unregister_memory_section(ms);
>>>>
>>>> +	pgdat_resize_lock(pgdat, &flags);
>>>> +	sparse_remove_one_section(zone, ms);
>>>> +	pgdat_resize_unlock(pgdat, &flags);
>>>>    	return ret;
>>>>    }
>>>>    #else
>>>>
>>>>
>>>
>>
>>
>>
>>
> 

^ permalink raw reply

* RE: [PATCH 4/4] Talitos: fix the issue of dma memory leak
From: Geanta Neag Horia Ioan-B05471 @ 2012-07-11  7:09 UTC (permalink / raw)
  To: Liu Qiang-B32616
  Cc: Li Yang-R58472, Phillips Kim-R1AAHA, Herbert Xu,
	linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David S. Miller
In-Reply-To: <1341900014-20915-1-git-send-email-qiang.liu@freescale.com>

On Tue, 10 Jul 2012 09:00:14 +0300, Qiang Liu <qiang.liu@freescale.com> wro=
te:
> An error will be happened when test with mass data:
> "DMA-API: device driver tries to sync DMA memory it has not allocated";
> "DMA-API: debugging out of memory - disabling"
> dma mapping memory of request->desc is not released by right device,
> it should be private->dev but not dev;
>=20
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
> ---
>  drivers/crypto/talitos.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
> index 81f8497..a7da48c 100644
> --- a/drivers/crypto/talitos.c
> +++ b/drivers/crypto/talitos.c
> @@ -264,7 +264,7 @@ static void flush_channel(struct device *dev, int
> ch, int error, int reset_ch)
>  			else
>  				status =3D error;
> -		dma_unmap_single(dev, request->dma_desc,
> +		 dma_unmap_single(priv->dev, request->dma_desc,
>  				 sizeof(struct talitos_desc),
>  				 DMA_BIDIRECTIONAL);

Are you sure this fix applies to the upstream version of talitos?
(i.e. have you encountered the error while running on cryptodev.git ?)

Looks to me this is a fix for the not-upstreamed-yet NAPI patch
(which needs to be reworked according to Dave's feedback).

When you respin the patch series, consider removing this one.

Cheers,
Horia

^ permalink raw reply

* RE: [PATCH 4/4] Talitos: fix the issue of dma memory leak
From: Liu Qiang-B32616 @ 2012-07-11  7:18 UTC (permalink / raw)
  To: Geanta Neag Horia Ioan-B05471
  Cc: Li Yang-R58472, Phillips Kim-R1AAHA, Herbert Xu,
	linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	David S. Miller
In-Reply-To: <FD18E5D573A8AB48A365D4D78185DE9923CC29@039-SN1MPN1-001.039d.mgd.msft.net>

> -----Original Message-----
> From: Geanta Neag Horia Ioan-B05471
> Sent: Wednesday, July 11, 2012 3:09 PM
> To: Liu Qiang-B32616
> Cc: linux-crypto@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; Li Yang-
> R58472; Phillips Kim-R1AAHA; Herbert Xu; David S. Miller
> Subject: RE: [PATCH 4/4] Talitos: fix the issue of dma memory leak
>=20
> On Tue, 10 Jul 2012 09:00:14 +0300, Qiang Liu <qiang.liu@freescale.com>
> wrote:
> > An error will be happened when test with mass data:
> > "DMA-API: device driver tries to sync DMA memory it has not
> > allocated";
> > "DMA-API: debugging out of memory - disabling"
> > dma mapping memory of request->desc is not released by right device,
> > it should be private->dev but not dev;
> >
> > Cc: Herbert Xu <herbert@gondor.apana.org.au>
> > Cc: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
> > ---
> >  drivers/crypto/talitos.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-) diff --git
> > a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index
> > 81f8497..a7da48c 100644
> > --- a/drivers/crypto/talitos.c
> > +++ b/drivers/crypto/talitos.c
> > @@ -264,7 +264,7 @@ static void flush_channel(struct device *dev, int
> > ch, int error, int reset_ch)
> >  			else
> >  				status =3D error;
> > -		dma_unmap_single(dev, request->dma_desc,
> > +		 dma_unmap_single(priv->dev, request->dma_desc,
> >  				 sizeof(struct talitos_desc),
> >  				 DMA_BIDIRECTIONAL);
>=20
> Are you sure this fix applies to the upstream version of talitos?
> (i.e. have you encountered the error while running on cryptodev.git ?)
>=20
I found it on our own git, I'm going to test it. I will send the result lat=
er.
Thanks.

> Looks to me this is a fix for the not-upstreamed-yet NAPI patch (which
> needs to be reworked according to Dave's feedback).
>=20
> When you respin the patch series, consider removing this one.
Thanks for your mention, I will remove it if I cannot reproduce it.

> Cheers,
> Horia
>=20

^ permalink raw reply

* Re: [RFC PATCH v3 11/13] memory-hotplug : free memmap of sparse-vmemmap
From: Wen Congyang @ 2012-07-11  7:27 UTC (permalink / raw)
  To: Yasuaki Ishimatsu
  Cc: len.brown, linux-acpi, linux-kernel, linux-mm, paulus,
	minchan.kim, kosaki.motohiro, rientjes, cl, linuxppc-dev, akpm,
	liuj97
In-Reply-To: <4FFD21C2.6000201@jp.fujitsu.com>

At 07/11/2012 02:48 PM, Yasuaki Ishimatsu Wrote:
> Hi Wen,
> 
> 2012/07/11 15:25, Wen Congyang wrote:
>> At 07/11/2012 01:52 PM, Yasuaki Ishimatsu Wrote:
>>> 2012/07/11 14:06, Wen Congyang wrote:
>>> Hi Wen,
>>>
>>>> At 07/09/2012 06:33 PM, Yasuaki Ishimatsu Wrote:
>>>>> I don't think that all pages of virtual mapping in removed memory can be
>>>>> freed, since page which type is MIX_SECTION_INFO is difficult to free.
>>>>> So, the patch only frees page which type is SECTION_INFO at first.
>>>>>
>>>>> CC: David Rientjes <rientjes@google.com>
>>>>> CC: Jiang Liu <liuj97@gmail.com>
>>>>> CC: Len Brown <len.brown@intel.com>
>>>>> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>>> CC: Paul Mackerras <paulus@samba.org>
>>>>> CC: Christoph Lameter <cl@linux.com>
>>>>> Cc: Minchan Kim <minchan.kim@gmail.com>
>>>>> CC: Andrew Morton <akpm@linux-foundation.org>
>>>>> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>>>>> CC: Wen Congyang <wency@cn.fujitsu.com>
>>>>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>>>>>
>>>>> ---
>>>>>    arch/x86/mm/init_64.c |   91 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>>    include/linux/mm.h    |    2 +
>>>>>    mm/memory_hotplug.c   |    5 ++
>>>>>    mm/sparse.c           |    5 +-
>>>>>    4 files changed, 101 insertions(+), 2 deletions(-)
>>>>>
>>>>> Index: linux-3.5-rc4/include/linux/mm.h
>>>>> ===================================================================
>>>>> --- linux-3.5-rc4.orig/include/linux/mm.h	2012-07-03 14:22:18.530011567 +0900
>>>>> +++ linux-3.5-rc4/include/linux/mm.h	2012-07-03 14:22:20.999983872 +0900
>>>>> @@ -1588,6 +1588,8 @@ int vmemmap_populate(struct page *start_
>>>>>    void vmemmap_populate_print_last(void);
>>>>>    void register_page_bootmem_memmap(unsigned long section_nr, struct page *map,
>>>>>    				  unsigned long size);
>>>>> +void vmemmap_kfree(struct page *memmpa, unsigned long nr_pages);
>>>>> +void vmemmap_free_bootmem(struct page *memmpa, unsigned long nr_pages);
>>>>>
>>>>>    enum mf_flags {
>>>>>    	MF_COUNT_INCREASED = 1 << 0,
>>>>> Index: linux-3.5-rc4/mm/sparse.c
>>>>> ===================================================================
>>>>> --- linux-3.5-rc4.orig/mm/sparse.c	2012-07-03 14:21:45.071429805 +0900
>>>>> +++ linux-3.5-rc4/mm/sparse.c	2012-07-03 14:22:21.000983767 +0900
>>>>> @@ -614,12 +614,13 @@ static inline struct page *kmalloc_secti
>>>>>    	/* This will make the necessary allocations eventually. */
>>>>>    	return sparse_mem_map_populate(pnum, nid);
>>>>>    }
>>>>> -static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages)
>>>>> +static void __kfree_section_memmap(struct page *page, unsigned long nr_pages)
>>>>>    {
>>>>> -	return; /* XXX: Not implemented yet */
>>>>> +	vmemmap_kfree(page, nr_pages);
>>>>
>>>> Hmm, I think you try to free the memory allocated in kmalloc_section_memmap().
>>>
>>> Yes.
>>>
>>>>
>>>>>    }
>>>>>    static void free_map_bootmem(struct page *page, unsigned long nr_pages)
>>>>>    {
>>>>> +	vmemmap_free_bootmem(page, nr_pages);
>>>>>    }
>>>>
>>>> Hmm, which function is the memory you try to free allocated in?
>>>
>>> The function try to free memory allocated from bootmem. The memory has
>>> been registered by get_page_bootmem(). So we can free the memory by
>>> put_page_bootmem().
>>
>> OK, I will read these codes, and check it.
>>
>>>
>>>>
>>>>>    #else
>>>>>    static struct page *__kmalloc_section_memmap(unsigned long nr_pages)
>>>>> Index: linux-3.5-rc4/arch/x86/mm/init_64.c
>>>>> ===================================================================
>>>>> --- linux-3.5-rc4.orig/arch/x86/mm/init_64.c	2012-07-03 14:22:18.538011465 +0900
>>>>> +++ linux-3.5-rc4/arch/x86/mm/init_64.c	2012-07-03 14:22:21.007983103 +0900
>>>>> @@ -978,6 +978,97 @@ vmemmap_populate(struct page *start_page
>>>>>    	return 0;
>>>>>    }
>>>>>
>>>>> +unsigned long find_and_clear_pte_page(unsigned long addr, unsigned long end,
>>>>> +				      struct page **pp)
>>>>> +{
>>>>> +	pgd_t *pgd;
>>>>> +	pud_t *pud;
>>>>> +	pmd_t *pmd;
>>>>> +	pte_t *pte;
>>>>> +	unsigned long next;
>>>>> +
>>>>> +	*pp = NULL;
>>>>> +
>>>>> +	pgd = pgd_offset_k(addr);
>>>>> +	if (pgd_none(*pgd))
>>>>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>>>>
>>>> Hmm, why not goto next pgd?
>>>
>>> Does it mean "return (addr + PGDIR_SIZE) & PGDIR_MASK"?
>>>
>>>>
>>>>> +
>>>>> +	pud = pud_offset(pgd, addr);
>>>>> +	if (pud_none(*pud))
>>>>> +		return (addr + PAGE_SIZE) & PAGE_MASK;
>>>>> +
>>>>> +	if (!cpu_has_pse) {
>>>>> +		next = (addr + PAGE_SIZE) & PAGE_MASK;
>>>>> +		pmd = pmd_offset(pud, addr);
>>>>> +		if (pmd_none(*pmd))
>>>>> +			return next;
>>>>> +
>>>>> +		pte = pte_offset_kernel(pmd, addr);
>>>>> +		if (pte_none(*pte))
>>>>> +			return next;
>>>>> +
>>>>> +		*pp = pte_page(*pte);
>>>>> +		pte_clear(&init_mm, addr, pte);
>>>>
>>>> I think you should flush tlb here.
>>>
>>> Thanks, I'll update it.
>>>
>>>>
>>>>> +	} else {
>>>>> +		next = pmd_addr_end(addr, end);
>>>>> +
>>>>> +		pmd = pmd_offset(pud, addr);
>>>>> +		if (pmd_none(*pmd))
>>>>> +			return next;
>>>>> +
>>>>> +		*pp = pmd_page(*pmd);
>>>>> +		pmd_clear(pmd);
>>>>> +	}
>>>>> +
>>>>> +	return next;
>>>>> +}
>>>>> +
>>>>> +void __meminit
>>>>> +vmemmap_kfree(struct page *memmap, unsigned long nr_pages)
>>>>> +{
>>>>> +	unsigned long addr = (unsigned long)memmap;
>>>>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>>>>> +	unsigned long next;
>>>>> +	unsigned int order;
>>>>> +	struct page *page;
>>>>> +
>>>>> +	for (; addr < end; addr = next) {
>>>>> +		page = NULL;
>>>>> +		next = find_and_clear_pte_page(addr, end, &page);
>>>>> +		if (!page)
>>>>> +			continue;
>>>>> +
>>>>> +		if (is_vmalloc_addr(page_address(page)))
>>>>> +			vfree(page_address(page));
>>>>
>>>> Hmm, the memory is allocated in vmemmap_alloc_block(), and the address
>>>> can not be vmalloc address.
>>>
>>> Does it mean the if sentence is unnecessary?
>>>
>>>>
>>>>> +		else {
>>>>> +			order = next - addr;
>>>>> +			free_pages((unsigned long)page_address(page),
>>>>> +				   get_order(order));
>>>>
>>>> OOPS. I think we cannot free pages here.
>>>>
>>>> sizeof(struct page) is less than PAGE_SIZE. We store more than one struct
>>>> page in the same page. If you free it here while the other struct page
>>>> is in use, it is very dangerous.
>>>
>>> The memory has page structures for hot-removed memory. So nobody is using
>>> these pages, since the hot-removed memory has been offlined.
>>
>> The memory has page structures for hot-removed memory, but it may contain
>> page structures for the other hot-added memory.
> 
> Yes. There may be such corner case. But when does the corner case appear?
> When removed memory is not aligned to PMD_SIZE/PAGE_SIZE, does the corner
> case appear? Do you know it?

It does not depend whether the removed memory is aligned to PMD_SIZE/PAGE_SIZE.
If PAGE_SIZE % sizeof(struct page) != 0, this case will happen.

Thanks
Wen Congyang

> 
> Thank,
> Yasuaki Ishimatsu
> 
>>
>> IIUC, If we use sparse-vmemmap, all page structures is stored here.
>>
>> Thanks
>> Wen Congyang
>>
>>>
>>>>> +		}
>>>>> +	}
>>>>> +}
>>>>> +
>>>>> +void __meminit
>>>>> +vmemmap_free_bootmem(struct page *memmap, unsigned long nr_pages)
>>>>> +{
>>>>> +	unsigned long addr = (unsigned long)memmap;
>>>>> +	unsigned long end = (unsigned long)(memmap + nr_pages);
>>>>> +	unsigned long next;
>>>>> +	struct page *page;
>>>>> +	unsigned long magic;
>>>>> +
>>>>> +	for (; addr < end; addr = next) {
>>>>> +		page = NULL;
>>>>> +		next = find_and_clear_pte_page(addr, end, &page);
>>>>> +		if (!page)
>>>>> +			continue;
>>>>> +
>>>>> +		magic = (unsigned long) page->lru.next;
>>>>> +		if (magic == SECTION_INFO)
>>>>> +			put_page_bootmem(page);
>>>>> +	}
>>>>> +}
>>>>> +
>>>>>    void __meminit
>>>>>    register_page_bootmem_memmap(unsigned long section_nr, struct page *start_page,
>>>>>    			     unsigned long size)
>>>>> Index: linux-3.5-rc4/mm/memory_hotplug.c
>>>>> ===================================================================
>>>>> --- linux-3.5-rc4.orig/mm/memory_hotplug.c	2012-07-03 14:22:18.522011667 +0900
>>>>> +++ linux-3.5-rc4/mm/memory_hotplug.c	2012-07-03 14:22:21.012982694 +0900
>>>>> @@ -303,6 +303,8 @@ static int __meminit __add_section(int n
>>>>>    #ifdef CONFIG_SPARSEMEM_VMEMMAP
>>>>
>>>> I think this line can be removed now.
>>>
>>> I'll update it.
>>>
>>> Thanks,
>>> Yasuaki Ishimatsu
>>>
>>>>
>>>> Thanks
>>>> Wen Congyang
>>>>
>>>>>    static int __remove_section(struct zone *zone, struct mem_section *ms)
>>>>>    {
>>>>> +	unsigned long flags;
>>>>> +	struct pglist_data *pgdat = zone->zone_pgdat;
>>>>>    	int ret;
>>>>>
>>>>>    	if (!valid_section(ms))
>>>>> @@ -310,6 +312,9 @@ static int __remove_section(struct zone
>>>>>
>>>>>    	ret = unregister_memory_section(ms);
>>>>>
>>>>> +	pgdat_resize_lock(pgdat, &flags);
>>>>> +	sparse_remove_one_section(zone, ms);
>>>>> +	pgdat_resize_unlock(pgdat, &flags);
>>>>>    	return ret;
>>>>>    }
>>>>>    #else
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>>
>>
> 
> 
> 
> --
> 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
> 

^ permalink raw reply

* [PATCH v2 0/4] Raid: enable talitos xor offload for improving performance
From: Qiang Liu @ 2012-07-11  8:57 UTC (permalink / raw)
  To: linux-crypto, linuxppc-dev
  Cc: vinod.koul, qiang.liu, herbert, dan.j.williams, davem

The following 4 patches enabling fsl-dma and talitos offload raid
operations for improving raid performance and balancing CPU load.

Write performance will be improved by 40% tested by iozone. CPU load
will be reduced by 8%.

Changes in v2:
	- rebase onto cryptodev tree
	- split the patch 3/4 up to 3 independent patches
	- remove the patch 4/4, the fix is not for cryptodev tree

Qiang Liu (4):
      Talitos: Support for async_tx XOR offload
      fsl-dma: remove attribute DMA_INTERRUPT of dmaengine
      fsl-dma: change the release process of dma descriptor
      fsl-dma: use spin_lock_bh to instead of spin_lock_irqsave

 drivers/crypto/Kconfig   |    9 +
 drivers/crypto/talitos.c |  410 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/crypto/talitos.h |   53 ++++++
 drivers/dma/fsldma.c     |   76 +++------
 4 files changed, 496 insertions(+), 52 deletions(-)

^ permalink raw reply

* [PATCH v2 1/4] Talitos: Support for async_tx XOR offload
From: Qiang Liu @ 2012-07-11  8:59 UTC (permalink / raw)
  To: linux-crypto, herbert, linuxppc-dev
  Cc: Qiang Liu, dan.j.williams, David S. Miller

Expose Talitos's XOR functionality to be used for RAID parity
calculation via the Async_tx layer.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Dipen Dudhat <Dipen.Dudhat@freescale.com>
Signed-off-by: Maneesh Gupta <Maneesh.Gupta@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Vishnu Suresh <Vishnu@freescale.com>
Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
---
 drivers/crypto/Kconfig   |    9 +
 drivers/crypto/talitos.c |  410 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/crypto/talitos.h |   53 ++++++
 3 files changed, 472 insertions(+), 0 deletions(-)

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index be6b2ba..f0a7c29 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -222,6 +222,15 @@ config CRYPTO_DEV_TALITOS
 	  To compile this driver as a module, choose M here: the module
 	  will be called talitos.

+config CRYPTO_DEV_TALITOS_RAIDXOR
+	bool "Talitos RAID5 XOR Calculation Offload"
+	default y
+	select DMA_ENGINE
+	depends on CRYPTO_DEV_TALITOS
+	help
+	  Say 'Y' here to use the Freescale Security Engine (SEC) to
+	  offload RAID XOR parity Calculation
+
 config CRYPTO_DEV_IXP4XX
 	tristate "Driver for IXP4xx crypto hardware acceleration"
 	depends on ARCH_IXP4XX
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index efff788..1e0c9e6 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -619,6 +619,396 @@ static void talitos_unregister_rng(struct device *dev)
 	hwrng_unregister(&priv->rng);
 }

+#ifdef CONFIG_CRYPTO_DEV_TALITOS_RAIDXOR
+static void talitos_release_xor(struct device *dev, struct talitos_desc *hwdesc,
+				void *context, int error);
+
+static enum dma_status talitos_is_tx_complete(struct dma_chan *chan,
+					      dma_cookie_t cookie,
+					      struct dma_tx_state *state)
+{
+	struct talitos_xor_chan *xor_chan;
+	dma_cookie_t last_used;
+	dma_cookie_t last_complete;
+
+	xor_chan = container_of(chan, struct talitos_xor_chan, common);
+
+	last_used = chan->cookie;
+	last_complete = xor_chan->completed_cookie;
+
+	if (state->last)
+		state->last = last_complete;
+
+	if (state->used)
+		state->used = last_used;
+
+	return dma_async_is_complete(cookie, last_complete, last_used);
+}
+
+static void talitos_process_pending(struct talitos_xor_chan *xor_chan)
+{
+	struct talitos_xor_desc *desc, *_desc;
+	unsigned long flags;
+	int status;
+	struct talitos_private *priv;
+	int ch;
+
+	priv = dev_get_drvdata(xor_chan->dev);
+	ch = atomic_inc_return(&priv->last_chan) &
+				  (priv->num_channels - 1);
+	spin_lock_irqsave(&xor_chan->desc_lock, flags);
+
+	list_for_each_entry_safe(desc, _desc, &xor_chan->pending_q, node) {
+		status = talitos_submit(xor_chan->dev, ch, &desc->hwdesc,
+					talitos_release_xor, desc);
+		if (status != -EINPROGRESS)
+			break;
+
+		list_del(&desc->node);
+		list_add_tail(&desc->node, &xor_chan->in_progress_q);
+	}
+
+	spin_unlock_irqrestore(&xor_chan->desc_lock, flags);
+}
+
+static void talitos_xor_run_tx_complete_actions(struct talitos_xor_desc *desc,
+		struct talitos_xor_chan *xor_chan)
+{
+	struct device *dev = xor_chan->dev;
+	dma_addr_t dest, addr;
+	unsigned int src_cnt = desc->unmap_src_cnt;
+	unsigned int len = desc->unmap_len;
+	enum dma_ctrl_flags flags = desc->async_tx.flags;
+	struct dma_async_tx_descriptor *tx = &desc->async_tx;
+
+	/* unmap dma addresses */
+	dest = desc->hwdesc.ptr[6].ptr;
+	if (likely(!(flags & DMA_COMPL_SKIP_DEST_UNMAP)))
+		dma_unmap_page(dev, dest, len, DMA_BIDIRECTIONAL);
+
+	desc->idx = 6 - src_cnt;
+	while(desc->idx < 6) {
+		addr = desc->hwdesc.ptr[desc->idx++].ptr;
+		if (likely(!(flags & DMA_COMPL_SKIP_SRC_UNMAP)))
+			dma_unmap_page(dev, addr, len, DMA_TO_DEVICE);
+	}
+
+	/* run dependent operations */
+	dma_run_dependencies(tx);
+}
+
+static void talitos_release_xor(struct device *dev, struct talitos_desc *hwdesc,
+				void *context, int error)
+{
+	struct talitos_xor_desc *desc = context;
+	struct talitos_xor_chan *xor_chan;
+	dma_async_tx_callback callback;
+	void *callback_param;
+
+	if (unlikely(error))
+		dev_err(dev, "xor operation: talitos error %d\n", error);
+
+	xor_chan = container_of(desc->async_tx.chan, struct talitos_xor_chan,
+				common);
+	spin_lock_bh(&xor_chan->desc_lock);
+	if (xor_chan->completed_cookie < desc->async_tx.cookie)
+		xor_chan->completed_cookie = desc->async_tx.cookie;
+
+	callback = desc->async_tx.callback;
+	callback_param = desc->async_tx.callback_param;
+
+	if (callback) {
+		spin_unlock_bh(&xor_chan->desc_lock);
+		callback(callback_param);
+		spin_lock_bh(&xor_chan->desc_lock);
+	}
+
+	talitos_xor_run_tx_complete_actions(desc, xor_chan);
+
+	list_del(&desc->node);
+	list_add_tail(&desc->node, &xor_chan->free_desc);
+	spin_unlock_bh(&xor_chan->desc_lock);
+	if (!list_empty(&xor_chan->pending_q))
+		talitos_process_pending(xor_chan);
+}
+
+/**
+ * talitos_issue_pending - move the descriptors in submit
+ * queue to pending queue and submit them for processing
+ * @chan: DMA channel
+ */
+static void talitos_issue_pending(struct dma_chan *chan)
+{
+	struct talitos_xor_chan *xor_chan;
+
+	xor_chan = container_of(chan, struct talitos_xor_chan, common);
+	spin_lock_bh(&xor_chan->desc_lock);
+	list_splice_tail_init(&xor_chan->submit_q,
+				 &xor_chan->pending_q);
+	spin_unlock_bh(&xor_chan->desc_lock);
+	talitos_process_pending(xor_chan);
+}
+
+static dma_cookie_t talitos_async_tx_submit(struct dma_async_tx_descriptor *tx)
+{
+	struct talitos_xor_desc *desc;
+	struct talitos_xor_chan *xor_chan;
+	dma_cookie_t cookie;
+
+	desc = container_of(tx, struct talitos_xor_desc, async_tx);
+	xor_chan = container_of(tx->chan, struct talitos_xor_chan, common);
+
+	spin_lock_bh(&xor_chan->desc_lock);
+
+	cookie = xor_chan->common.cookie + 1;
+	if (cookie < 0)
+		cookie = 1;
+
+	desc->async_tx.cookie = cookie;
+	xor_chan->common.cookie = desc->async_tx.cookie;
+
+	list_splice_tail_init(&desc->tx_list,
+				 &xor_chan->submit_q);
+
+	spin_unlock_bh(&xor_chan->desc_lock);
+
+	return cookie;
+}
+
+static struct talitos_xor_desc *talitos_xor_alloc_descriptor(
+				struct talitos_xor_chan *xor_chan, gfp_t flags)
+{
+	struct talitos_xor_desc *desc;
+
+	desc = kmalloc(sizeof(*desc), flags);
+	if (desc) {
+		xor_chan->total_desc++;
+		desc->async_tx.tx_submit = talitos_async_tx_submit;
+	}
+
+	return desc;
+}
+
+static void talitos_free_chan_resources(struct dma_chan *chan)
+{
+	struct talitos_xor_chan *xor_chan;
+	struct talitos_xor_desc *desc, *_desc;
+
+	xor_chan = container_of(chan, struct talitos_xor_chan, common);
+
+	spin_lock_bh(&xor_chan->desc_lock);
+
+	list_for_each_entry_safe(desc, _desc, &xor_chan->submit_q, node) {
+		list_del(&desc->node);
+		xor_chan->total_desc--;
+		kfree(desc);
+	}
+	list_for_each_entry_safe(desc, _desc, &xor_chan->pending_q, node) {
+		list_del(&desc->node);
+		xor_chan->total_desc--;
+		kfree(desc);
+	}
+	list_for_each_entry_safe(desc, _desc, &xor_chan->in_progress_q, node) {
+		list_del(&desc->node);
+		xor_chan->total_desc--;
+		kfree(desc);
+	}
+	list_for_each_entry_safe(desc, _desc, &xor_chan->free_desc, node) {
+		list_del(&desc->node);
+		xor_chan->total_desc--;
+		kfree(desc);
+	}
+
+	/* Some descriptor not freed? */
+	if (unlikely(xor_chan->total_desc))
+		dev_warn(chan->device->dev, "Failed to free xor channel resource\n");
+
+	spin_unlock_bh(&xor_chan->desc_lock);
+}
+
+static int talitos_alloc_chan_resources(struct dma_chan *chan)
+{
+	struct talitos_xor_chan *xor_chan;
+	struct talitos_xor_desc *desc;
+	LIST_HEAD(tmp_list);
+	int i;
+
+	xor_chan = container_of(chan, struct talitos_xor_chan, common);
+
+	if (!list_empty(&xor_chan->free_desc))
+		return xor_chan->total_desc;
+
+	for (i = 0; i < TALITOS_MAX_DESCRIPTOR_NR; i++) {
+		desc = talitos_xor_alloc_descriptor(xor_chan,
+				GFP_KERNEL | GFP_DMA);
+		if (!desc) {
+			dev_err(xor_chan->common.device->dev,
+				"Only %d initial descriptors\n", i);
+			break;
+		}
+		list_add_tail(&desc->node, &tmp_list);
+	}
+
+	if (!i)
+		return -ENOMEM;
+
+	/* At least one desc is allocated */
+	spin_lock_bh(&xor_chan->desc_lock);
+	list_splice_init(&tmp_list, &xor_chan->free_desc);
+	spin_unlock_bh(&xor_chan->desc_lock);
+
+	return xor_chan->total_desc;
+}
+
+static struct dma_async_tx_descriptor *talitos_prep_dma_xor(
+			struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
+			unsigned int src_cnt, size_t len, unsigned long flags)
+{
+	struct talitos_xor_chan *xor_chan;
+	struct talitos_xor_desc *new;
+	struct talitos_desc *desc;
+	int i, j;
+
+	BUG_ON(len > TALITOS_MAX_DATA_LEN);
+
+	xor_chan = container_of(chan, struct talitos_xor_chan, common);
+
+	spin_lock_bh(&xor_chan->desc_lock);
+	if (!list_empty(&xor_chan->free_desc)) {
+		new = container_of(xor_chan->free_desc.next,
+				   struct talitos_xor_desc, node);
+		list_del(&new->node);
+	} else {
+		 new = talitos_xor_alloc_descriptor(xor_chan, GFP_KERNEL | GFP_DMA);
+	}
+	spin_unlock_bh(&xor_chan->desc_lock);
+
+	if (!new) {
+		dev_err(xor_chan->common.device->dev,
+			"No free memory for XOR DMA descriptor\n");
+		return NULL;
+	}
+	dma_async_tx_descriptor_init(&new->async_tx, &xor_chan->common);
+
+	INIT_LIST_HEAD(&new->node);
+	INIT_LIST_HEAD(&new->tx_list);
+
+	desc = &new->hwdesc;
+	/* Set destination: Last pointer pair */
+	to_talitos_ptr(&desc->ptr[6], dest);
+	desc->ptr[6].len = cpu_to_be16(len);
+	desc->ptr[6].j_extent = 0;
+	new->unmap_src_cnt = src_cnt;
+	new->unmap_len = len;
+
+	/* Set Sources: End loading from second-last pointer pair */
+	for (i = 5, j = 0; j < src_cnt && i >= 0; i--, j++) {
+		to_talitos_ptr(&desc->ptr[i], src[j]);
+		desc->ptr[i].len = cpu_to_be16(len);
+		desc->ptr[i].j_extent = 0;
+	}
+
+	/*
+	 * documentation states first 0 ptr/len combo marks end of sources
+	 * yet device produces scatter boundary error unless all subsequent
+	 * sources are zeroed out
+	 */
+	for (; i >= 0; i--) {
+		to_talitos_ptr(&desc->ptr[i], 0);
+		desc->ptr[i].len = 0;
+		desc->ptr[i].j_extent = 0;
+	}
+
+	desc->hdr = DESC_HDR_SEL0_AESU | DESC_HDR_MODE0_AESU_XOR |
+		DESC_HDR_TYPE_RAID_XOR;
+
+	new->async_tx.parent = NULL;
+	new->async_tx.next = NULL;
+	new->async_tx.cookie = 0;
+	async_tx_ack(&new->async_tx);
+
+	list_add_tail(&new->node, &new->tx_list);
+
+	new->async_tx.flags = flags;
+	new->async_tx.cookie = -EBUSY;
+
+	return &new->async_tx;
+}
+
+static void talitos_unregister_async_xor(struct device *dev)
+{
+	struct talitos_private *priv = dev_get_drvdata(dev);
+	struct talitos_xor_chan *xor_chan;
+	struct dma_chan *chan, *_chan;
+
+	if (priv->dma_dev_common.chancnt)
+		dma_async_device_unregister(&priv->dma_dev_common);
+
+	list_for_each_entry_safe(chan, _chan, &priv->dma_dev_common.channels,
+				device_node) {
+		xor_chan = container_of(chan, struct talitos_xor_chan,
+					common);
+		list_del(&chan->device_node);
+		priv->dma_dev_common.chancnt--;
+		kfree(xor_chan);
+	}
+}
+
+/**
+ * talitos_register_dma_async - Initialize the Freescale XOR ADMA device
+ * It is registered as a DMA device with the capability to perform
+ * XOR operation with the Async_tx layer.
+ * The various queues and channel resources are also allocated.
+ */
+static int talitos_register_async_tx(struct device *dev, int max_xor_srcs)
+{
+	struct talitos_private *priv = dev_get_drvdata(dev);
+	struct dma_device *dma_dev = &priv->dma_dev_common;
+	struct talitos_xor_chan *xor_chan;
+	int err;
+
+	xor_chan = kzalloc(sizeof(struct talitos_xor_chan), GFP_KERNEL);
+	if (!xor_chan) {
+		dev_err(dev, "unable to allocate xor channel\n");
+		return -ENOMEM;
+	}
+
+	dma_dev->dev = dev;
+	dma_dev->device_alloc_chan_resources = talitos_alloc_chan_resources;
+	dma_dev->device_free_chan_resources = talitos_free_chan_resources;
+	dma_dev->device_prep_dma_xor = talitos_prep_dma_xor;
+	dma_dev->max_xor = max_xor_srcs;
+	dma_dev->device_tx_status = talitos_is_tx_complete;
+	dma_dev->device_issue_pending = talitos_issue_pending;
+	INIT_LIST_HEAD(&dma_dev->channels);
+	dma_cap_set(DMA_XOR, dma_dev->cap_mask);
+
+	xor_chan->dev = dev;
+	xor_chan->common.device = dma_dev;
+	xor_chan->total_desc = 0;
+	INIT_LIST_HEAD(&xor_chan->submit_q);
+	INIT_LIST_HEAD(&xor_chan->pending_q);
+	INIT_LIST_HEAD(&xor_chan->in_progress_q);
+	INIT_LIST_HEAD(&xor_chan->free_desc);
+	spin_lock_init(&xor_chan->desc_lock);
+
+	list_add_tail(&xor_chan->common.device_node, &dma_dev->channels);
+	dma_dev->chancnt++;
+
+	err = dma_async_device_register(dma_dev);
+	if (err) {
+		dev_err(dev, "Unable to register XOR with Async_tx\n");
+		goto err_out;
+	}
+
+	return err;
+
+err_out:
+	talitos_unregister_async_xor(dev);
+	return err;
+}
+#endif
+
 /*
  * crypto alg
  */
@@ -2891,6 +3281,26 @@ static int talitos_probe(struct platform_device *ofdev)
 			dev_info(dev, "hwrng\n");
 	}

+#ifdef CONFIG_CRYPTO_DEV_TALITOS_RAIDXOR
+	/*
+	 * register with async_tx xor, if capable
+	 * SEC 2.x support up to 3 RAID sources,
+	 * SEC 3.x support up to 6
+	 */
+	if (hw_supports(dev, DESC_HDR_SEL0_AESU | DESC_HDR_TYPE_RAID_XOR)) {
+		int max_xor_srcs = 3;
+		if (of_device_is_compatible(np, "fsl,sec3.0"))
+			max_xor_srcs = 6;
+		err = talitos_register_async_tx(dev, max_xor_srcs);
+		if (err) {
+			dev_err(dev, "failed to register async_tx xor: %d\n",
+					err);
+			goto err_out;
+		}
+		dev_info(dev, "max_xor_srcs %d\n", max_xor_srcs);
+	}
+#endif
+
 	/* register crypto algorithms the device supports */
 	for (i = 0; i < ARRAY_SIZE(driver_algs); i++) {
 		if (hw_supports(dev, driver_algs[i].desc_hdr_template)) {
diff --git a/drivers/crypto/talitos.h b/drivers/crypto/talitos.h
index 61a1405..fc9d125 100644
--- a/drivers/crypto/talitos.h
+++ b/drivers/crypto/talitos.h
@@ -30,6 +30,7 @@

 #define TALITOS_TIMEOUT 100000
 #define TALITOS_MAX_DATA_LEN 65535
+#define TALITOS_MAX_DESCRIPTOR_NR 256

 #define DESC_TYPE(desc_hdr) ((be32_to_cpu(desc_hdr) >> 3) & 0x1f)
 #define PRIMARY_EU(desc_hdr) ((be32_to_cpu(desc_hdr) >> 28) & 0xf)
@@ -131,7 +132,57 @@ struct talitos_private {

 	/* hwrng device */
 	struct hwrng rng;
+
+#ifdef CONFIG_CRYPTO_DEV_TALITOS_RAIDXOR
+	/* XOR Device */
+	struct dma_device dma_dev_common;
+#endif
+};
+
+#ifdef CONFIG_CRYPTO_DEV_TALITOS_RAIDXOR
+/**
+ * talitos_xor_chan - context management for the async_tx channel
+ * @completed_cookie: the last completed cookie
+ * @desc_lock: lock for tx queue
+ * @total_desc: number of descriptors allocated
+ * @submit_q: queue of submitted descriptors
+ * @pending_q: queue of pending descriptors
+ * @in_progress_q: queue of descriptors in progress
+ * @free_desc: queue of unused descriptors
+ * @dev: talitos device implementing this channel
+ * @common: the corresponding xor channel in async_tx
+ */
+struct talitos_xor_chan {
+	dma_cookie_t completed_cookie;
+	spinlock_t desc_lock;
+	unsigned int total_desc;
+	struct list_head submit_q;
+	struct list_head pending_q;
+	struct list_head in_progress_q;
+	struct list_head free_desc;
+	struct device *dev;
+	struct dma_chan common;
+};
+
+/**
+ * talitos_xor_desc - software xor descriptor
+ * @async_tx: the referring async_tx descriptor
+ * @node:
+ * @hwdesc: h/w descriptor
+ * @unmap_src_cnt: number of xor sources
+ * @unmap_len: transaction byte count
+ * @idx: index of xor sources
+ */
+struct talitos_xor_desc {
+	struct dma_async_tx_descriptor async_tx;
+	struct list_head tx_list;
+	struct list_head node;
+	struct talitos_desc hwdesc;
+	unsigned int unmap_src_cnt;
+	unsigned int unmap_len;
+	unsigned int idx;
 };
+#endif

 extern int talitos_submit(struct device *dev, int ch, struct talitos_desc *desc,
 			  void (*callback)(struct device *dev,
@@ -284,6 +335,7 @@ extern int talitos_submit(struct device *dev, int ch, struct talitos_desc *desc,
 /* primary execution unit mode (MODE0) and derivatives */
 #define	DESC_HDR_MODE0_ENCRYPT		cpu_to_be32(0x00100000)
 #define	DESC_HDR_MODE0_AESU_CBC		cpu_to_be32(0x00200000)
+#define	DESC_HDR_MODE0_AESU_XOR         cpu_to_be32(0x0c600000)
 #define	DESC_HDR_MODE0_DEU_CBC		cpu_to_be32(0x00400000)
 #define	DESC_HDR_MODE0_DEU_3DES		cpu_to_be32(0x00200000)
 #define	DESC_HDR_MODE0_MDEU_CONT	cpu_to_be32(0x08000000)
@@ -344,6 +396,7 @@ extern int talitos_submit(struct device *dev, int ch, struct talitos_desc *desc,
 #define DESC_HDR_TYPE_IPSEC_ESP			cpu_to_be32(1 << 3)
 #define DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU	cpu_to_be32(2 << 3)
 #define DESC_HDR_TYPE_HMAC_SNOOP_NO_AFEU	cpu_to_be32(4 << 3)
+#define DESC_HDR_TYPE_RAID_XOR                  cpu_to_be32(21 << 3)

 /* link table extent field bits */
 #define DESC_PTR_LNKTBL_JUMP			0x80
--
1.7.5.1

^ permalink raw reply related

* [PATCH v2 2/4] fsl-dma: remove attribute DMA_INTERRUPT of dmaengine
From: Qiang Liu @ 2012-07-11  9:00 UTC (permalink / raw)
  To: linux-crypto, linuxppc-dev
  Cc: Vinod Koul, Qiang Liu, herbert, Dan Williams, davem

Delete attribute DMA_INTERRUPT because fsl-dma doesn't support this function,
exception will be thrown if talitos is used to offload xor at the same time.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Li Yang <leoli@freescale.com>
Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
---
 drivers/dma/fsldma.c |   31 -------------------------------
 1 files changed, 0 insertions(+), 31 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 8f84761..4f2f212 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -543,35 +543,6 @@ static void fsl_dma_free_chan_resources(struct dma_chan *dchan)
 }

 static struct dma_async_tx_descriptor *
-fsl_dma_prep_interrupt(struct dma_chan *dchan, unsigned long flags)
-{
-	struct fsldma_chan *chan;
-	struct fsl_desc_sw *new;
-
-	if (!dchan)
-		return NULL;
-
-	chan = to_fsl_chan(dchan);
-
-	new = fsl_dma_alloc_descriptor(chan);
-	if (!new) {
-		chan_err(chan, "%s\n", msg_ld_oom);
-		return NULL;
-	}
-
-	new->async_tx.cookie = -EBUSY;
-	new->async_tx.flags = flags;
-
-	/* Insert the link descriptor to the LD ring */
-	list_add_tail(&new->node, &new->tx_list);
-
-	/* Set End-of-link to the last link descriptor of new list */
-	set_ld_eol(chan, new);
-
-	return &new->async_tx;
-}
-
-static struct dma_async_tx_descriptor *
 fsl_dma_prep_memcpy(struct dma_chan *dchan,
 	dma_addr_t dma_dst, dma_addr_t dma_src,
 	size_t len, unsigned long flags)
@@ -1352,12 +1323,10 @@ static int __devinit fsldma_of_probe(struct platform_device *op)
 	fdev->irq = irq_of_parse_and_map(op->dev.of_node, 0);

 	dma_cap_set(DMA_MEMCPY, fdev->common.cap_mask);
-	dma_cap_set(DMA_INTERRUPT, fdev->common.cap_mask);
 	dma_cap_set(DMA_SG, fdev->common.cap_mask);
 	dma_cap_set(DMA_SLAVE, fdev->common.cap_mask);
 	fdev->common.device_alloc_chan_resources = fsl_dma_alloc_chan_resources;
 	fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources;
-	fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt;
 	fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy;
 	fdev->common.device_prep_dma_sg = fsl_dma_prep_sg;
 	fdev->common.device_tx_status = fsl_tx_status;
--
1.7.5.1

^ permalink raw reply related

* [PATCH v2 3/4] fsl-dma: change the release process of dma descriptor
From: Qiang Liu @ 2012-07-11  9:01 UTC (permalink / raw)
  To: linux-crypto, linuxppc-dev
  Cc: Vinod Koul, Qiang Liu, herbert, Dan Williams, davem

Modify the release process of dma descriptor for avoiding exception when
enable config NET_DMA, release dma descriptor from 1st to last second, the
last descriptor which is reserved in current descriptor register may not be
completed, race condition will be raised if free current descriptor.

A race condition which is raised when use both of talitos and dmaengine to
offload xor is because napi scheduler (NET_DMA is enabled) will sync all
pending requests in dma channels, it affects the process of raid operations.
The descriptor is freed which is submitted just now, but async_tx must check
whether this depend tx descriptor is acked, there are poison contents in the
invalid address, then BUG_ON() is thrown, so this descriptor will be freed
in the next time.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Li Yang <leoli@freescale.com>
Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
---
 drivers/dma/fsldma.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 4f2f212..0ba3e40 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1035,14 +1035,22 @@ static irqreturn_t fsldma_chan_irq(int irq, void *data)
 static void dma_do_tasklet(unsigned long data)
 {
 	struct fsldma_chan *chan = (struct fsldma_chan *)data;
-	struct fsl_desc_sw *desc, *_desc;
+	struct fsl_desc_sw *desc, *_desc, *prev = NULL;
 	LIST_HEAD(ld_cleanup);
 	unsigned long flags;
+	dma_addr_t curr_phys = get_cdar(chan);

 	chan_dbg(chan, "tasklet entry\n");

 	spin_lock_irqsave(&chan->desc_lock, flags);

+	/* find the descriptor which is already completed */
+	list_for_each_entry_safe(desc, _desc, &chan->ld_running, node) {
+		if (prev && desc->async_tx.phys == curr_phys)
+			break;
+		prev = desc;
+	}
+
 	/* update the cookie if we have some descriptors to cleanup */
 	if (!list_empty(&chan->ld_running)) {
 		dma_cookie_t cookie;
@@ -1058,13 +1066,14 @@ static void dma_do_tasklet(unsigned long data)
 	 * move the descriptors to a temporary list so we can drop the lock
 	 * during the entire cleanup operation
 	 */
-	list_splice_tail_init(&chan->ld_running, &ld_cleanup);
+	list_cut_position(&ld_cleanup, &chan->ld_running, &prev->node);

 	/* the hardware is now idle and ready for more */
 	chan->idle = true;

 	/*
-	 * Start any pending transactions automatically
+	 * Start any pending transactions automatically if current descriptor
+	 * list is completed
 	 *
 	 * In the ideal case, we keep the DMA controller busy while we go
 	 * ahead and free the descriptors below.
--
1.7.5.1

^ permalink raw reply related

* [PATCH v2 4/4] fsl-dma: use spin_lock_bh to instead of spin_lock_irqsave
From: Qiang Liu @ 2012-07-11  9:02 UTC (permalink / raw)
  To: linux-crypto, linuxppc-dev
  Cc: Vinod Koul, Qiang Liu, herbert, Dan Williams, davem

Use spin_lock_bh to instead of spin_lock_irqsave for improving performance.

Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Li Yang <leoli@freescale.com>
Signed-off-by: Qiang Liu <qiang.liu@freescale.com>
---
 drivers/dma/fsldma.c |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 0ba3e40..f2822a8 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -405,10 +405,9 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
 	struct fsldma_chan *chan = to_fsl_chan(tx->chan);
 	struct fsl_desc_sw *desc = tx_to_fsl_desc(tx);
 	struct fsl_desc_sw *child;
-	unsigned long flags;
 	dma_cookie_t cookie;

-	spin_lock_irqsave(&chan->desc_lock, flags);
+	spin_lock_bh(&chan->desc_lock);

 	/*
 	 * assign cookies to all of the software descriptors
@@ -421,7 +420,7 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
 	/* put this transaction onto the tail of the pending queue */
 	append_ld_queue(chan, desc);

-	spin_unlock_irqrestore(&chan->desc_lock, flags);
+	spin_unlock_bh(&chan->desc_lock);

 	return cookie;
 }
@@ -530,13 +529,12 @@ static void fsldma_free_desc_list_reverse(struct fsldma_chan *chan,
 static void fsl_dma_free_chan_resources(struct dma_chan *dchan)
 {
 	struct fsldma_chan *chan = to_fsl_chan(dchan);
-	unsigned long flags;

 	chan_dbg(chan, "free all channel resources\n");
-	spin_lock_irqsave(&chan->desc_lock, flags);
+	spin_lock_bh(&chan->desc_lock);
 	fsldma_free_desc_list(chan, &chan->ld_pending);
 	fsldma_free_desc_list(chan, &chan->ld_running);
-	spin_unlock_irqrestore(&chan->desc_lock, flags);
+	spin_unlock_bh(&chan->desc_lock);

 	dma_pool_destroy(chan->desc_pool);
 	chan->desc_pool = NULL;
@@ -755,7 +753,6 @@ static int fsl_dma_device_control(struct dma_chan *dchan,
 {
 	struct dma_slave_config *config;
 	struct fsldma_chan *chan;
-	unsigned long flags;
 	int size;

 	if (!dchan)
@@ -765,7 +762,7 @@ static int fsl_dma_device_control(struct dma_chan *dchan,

 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
-		spin_lock_irqsave(&chan->desc_lock, flags);
+		spin_lock_bh(&chan->desc_lock);

 		/* Halt the DMA engine */
 		dma_halt(chan);
@@ -775,7 +772,7 @@ static int fsl_dma_device_control(struct dma_chan *dchan,
 		fsldma_free_desc_list(chan, &chan->ld_running);
 		chan->idle = true;

-		spin_unlock_irqrestore(&chan->desc_lock, flags);
+		spin_unlock_bh(&chan->desc_lock);
 		return 0;

 	case DMA_SLAVE_CONFIG:
@@ -935,11 +932,10 @@ static void fsl_chan_xfer_ld_queue(struct fsldma_chan *chan)
 static void fsl_dma_memcpy_issue_pending(struct dma_chan *dchan)
 {
 	struct fsldma_chan *chan = to_fsl_chan(dchan);
-	unsigned long flags;

-	spin_lock_irqsave(&chan->desc_lock, flags);
+	spin_lock_bh(&chan->desc_lock);
 	fsl_chan_xfer_ld_queue(chan);
-	spin_unlock_irqrestore(&chan->desc_lock, flags);
+	spin_unlock_bh(&chan->desc_lock);
 }

 /**
@@ -952,11 +948,10 @@ static enum dma_status fsl_tx_status(struct dma_chan *dchan,
 {
 	struct fsldma_chan *chan = to_fsl_chan(dchan);
 	enum dma_status ret;
-	unsigned long flags;

-	spin_lock_irqsave(&chan->desc_lock, flags);
+	spin_lock_bh(&chan->desc_lock);
 	ret = dma_cookie_status(dchan, cookie, txstate);
-	spin_unlock_irqrestore(&chan->desc_lock, flags);
+	spin_unlock_bh(&chan->desc_lock);

 	return ret;
 }
@@ -1037,12 +1032,11 @@ static void dma_do_tasklet(unsigned long data)
 	struct fsldma_chan *chan = (struct fsldma_chan *)data;
 	struct fsl_desc_sw *desc, *_desc, *prev = NULL;
 	LIST_HEAD(ld_cleanup);
-	unsigned long flags;
 	dma_addr_t curr_phys = get_cdar(chan);

 	chan_dbg(chan, "tasklet entry\n");

-	spin_lock_irqsave(&chan->desc_lock, flags);
+	spin_lock_bh(&chan->desc_lock);

 	/* find the descriptor which is already completed */
 	list_for_each_entry_safe(desc, _desc, &chan->ld_running, node) {
@@ -1079,7 +1073,7 @@ static void dma_do_tasklet(unsigned long data)
 	 * ahead and free the descriptors below.
 	 */
 	fsl_chan_xfer_ld_queue(chan);
-	spin_unlock_irqrestore(&chan->desc_lock, flags);
+	spin_unlock_bh(&chan->desc_lock);

 	/* Run the callback for each descriptor, in order */
 	list_for_each_entry_safe(desc, _desc, &ld_cleanup, node) {
--
1.7.5.1

^ permalink raw reply related

* Re: [PATCH] powerpc/85xx: Add dts files for P1021RDB-PC board
From: Jiucheng Xu @ 2012-07-11  9:58 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <EFC9D38C-4F08-4655-A0DA-9D92A3559C96@kernel.crashing.org>



On Tue, 2012-07-10 at 06:48 -0500, Kumar Gala wrote:
> On Jul 10, 2012, at 3:39 AM, Xu Jiucheng wrote:
> > ---
> > arch/powerpc/boot/dts/p1021rdb-pc.dtsi    |  236 +++++++++++++++++++++++++++++
> > arch/powerpc/boot/dts/p1021rdb-pc_32b.dts |   96 ++++++++++++
> > arch/powerpc/boot/dts/p1021rdb-pc_36b.dts |   96 ++++++++++++
> > arch/powerpc/boot/dts/p1021rdb.dts        |   96 ------------
> > arch/powerpc/boot/dts/p1021rdb.dtsi       |  236 -----------------------------
> > arch/powerpc/boot/dts/p1021rdb_36b.dts    |   96 ------------
> > 6 files changed, 428 insertions(+), 428 deletions(-)
> > create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc.dtsi
> > create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc_32b.dts
> > create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc_36b.dts
> > delete mode 100644 arch/powerpc/boot/dts/p1021rdb.dts
> > delete mode 100644 arch/powerpc/boot/dts/p1021rdb.dtsi
> > delete mode 100644 arch/powerpc/boot/dts/p1021rdb_36b.dts
> 
> Do we really need a 32 & 36 bit device tree for this board?  Isnt the memory fixed so why not just have 32b?
> 
I have no idea, 36 bit is already there in the history release of SDK,
If it is not necessary for upstream, I can resend a new patch without 36
bit.
> Also, why are you removing the dts for the older P1021RDB??
> 
> - k
This dts for the older P1021RDB was committed by me. I just rename these
files in order to keep uniformity with other platforms, e.g
"P1020rdb-pc.dtsi  p1020mbg-pc.dtsi". If you think it doesn't matter,
please ignore this patch.

If AMP is a specific application as Timur says, please ignore the AMP
patch.

Thanks,
Jiucheng

^ permalink raw reply

* RE: [PATCH 1/2] powerpc/mpc85xx: p1022ds support the MTD for NOR and NAND flash
From: Huang Changming-R66093 @ 2012-07-11 10:07 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <13C02C19-F509-45F9-B8D7-6081E3748642@kernel.crashing.org>

Yes, I think it is still needed for p1022ds,
I will resent it according to Timur's change.

Best Regards
Jerry Huang


> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Tuesday, July 03, 2012 1:54 AM
> To: Huang Changming-R66093
> Cc: linuxppc-dev@lists.ozlabs.org
> Subject: Re: [PATCH 1/2] powerpc/mpc85xx: p1022ds support the MTD for NOR
> and NAND flash
>=20
>=20
> On Apr 16, 2012, at 8:42 PM, <Chang-Ming.Huang@freescale.com> <Chang-
> Ming.Huang@freescale.com> wrote:
>=20
> > From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> >
> > The compatilbe 'simple-bus' is removed from the latest DTS for NAND
> > and NOR flash partition, so we must add the new compatilbe support for
> > p1022ds, otherwise, the kernel can't parse the partition of NOR and
> NAND flash.
> >
> > Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> > ---
> > arch/powerpc/platforms/85xx/p1022_ds.c |    1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
>=20
> If this is still relevant, please resubmit against my powerpc.git 'next'
> branch.
>=20
> - k

^ permalink raw reply

* [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
From: Shaohui Xie @ 2012-07-11  9:56 UTC (permalink / raw)
  To: linux-watchdog, linuxppc-dev; +Cc: Shaohui Xie

Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is
in setup_32.c, it cannot be used in 64-bit, so move it to a common place
setup-common.c, which will be shared by 32-bit and 64-bit.

Also, replace the simple_strtoul with kstrtol.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
changes for v2:
use setup-common.c instead of prom.c

 arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
 arch/powerpc/kernel/setup_32.c     |   24 ------------------------
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index afd4f05..bdc499c 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -720,6 +720,33 @@ static int powerpc_debugfs_init(void)
 arch_initcall(powerpc_debugfs_init);
 #endif
 
+#ifdef CONFIG_BOOKE_WDT
+extern u32 booke_wdt_enabled;
+extern u32 booke_wdt_period;
+
+/* Checks wdt=x and wdt_period=xx command-line option */
+notrace int __init early_parse_wdt(char *p)
+{
+	if (p && strncmp(p, "0", 1) != 0)
+		booke_wdt_enabled = 1;
+
+	return 0;
+}
+early_param("wdt", early_parse_wdt);
+
+int __init early_parse_wdt_period(char *p)
+{
+	unsigned long ret;
+	if (p) {
+		if (!kstrtol(p, 0, &ret))
+			booke_wdt_period = ret;
+	}
+
+	return 0;
+}
+early_param("wdt_period", early_parse_wdt_period);
+#endif	/* CONFIG_BOOKE_WDT */
+
 void ppc_printk_progress(char *s, unsigned short hex)
 {
 	pr_info("%s\n", s);
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index ec8a53f..a8f54ec 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -149,30 +149,6 @@ notrace void __init machine_init(u64 dt_ptr)
 		ppc_md.progress("id mach(): done", 0x200);
 }
 
-#ifdef CONFIG_BOOKE_WDT
-extern u32 booke_wdt_enabled;
-extern u32 booke_wdt_period;
-
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-	if (p && strncmp(p, "0", 1) != 0)
-	       booke_wdt_enabled = 1;
-
-	return 0;
-}
-early_param("wdt", early_parse_wdt);
-
-int __init early_parse_wdt_period (char *p)
-{
-	if (p)
-		booke_wdt_period = simple_strtoul(p, NULL, 0);
-
-	return 0;
-}
-early_param("wdt_period", early_parse_wdt_period);
-#endif	/* CONFIG_BOOKE_WDT */
-
 /* Checks "l2cr=xxxx" command-line option */
 int __init ppc_setup_l2cr(char *str)
 {
-- 
1.6.4

^ permalink raw reply related

* [PATCH 1/2] powerpc/fsl: Update corenet32_smp_defconfig
From: Shengzhou Liu @ 2012-07-11 10:40 UTC (permalink / raw)
  To: galak, linuxppc-dev; +Cc: Shengzhou Liu

 - Enable NAND support
 - Enable CONFIG_PCI_MSI and CONFIG_MMC_SDHCI_OF

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 arch/powerpc/configs/corenet32_smp_defconfig |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index 91db656..e54d5f0 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -36,6 +36,7 @@ CONFIG_FORCE_MAX_ZONEORDER=13
 CONFIG_FSL_LBC=y
 CONFIG_PCI=y
 CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_MSI=y
 # CONFIG_PCIEASPM is not set
 CONFIG_RAPIDIO=y
 CONFIG_FSL_RIO=y
@@ -76,6 +77,11 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_FSL_IFC=y
+CONFIG_MTD_NAND_FSL_ELBC=y
 CONFIG_MTD_M25P80=y
 CONFIG_PROC_DEVICETREE=y
 CONFIG_BLK_DEV_LOOP=y
@@ -136,6 +142,8 @@ CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
 CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_OF=y
+CONFIG_MMC_SDHCI_OF_ESDHC=y
 CONFIG_EDAC=y
 CONFIG_EDAC_MM_EDAC=y
 CONFIG_EDAC_MPC85XX=y
-- 
1.6.4

^ permalink raw reply related

* [PATCH 2/2] powerpc/fsl: Update corenet64_smp_defconfig
From: Shengzhou Liu @ 2012-07-11 10:40 UTC (permalink / raw)
  To: galak, linuxppc-dev; +Cc: Shengzhou Liu
In-Reply-To: <1342003205-23378-1-git-send-email-Shengzhou.Liu@freescale.com>

Enable USB, MMC, SATA, LBC, MTD, NAND, SPI, PCIe, EDAC, VFAT, NFS, etc.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
 arch/powerpc/configs/corenet64_smp_defconfig |   59 ++++++++++++++++++++++++-
 1 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index 6798343..7340be3 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -25,6 +25,9 @@ CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BINFMT_MISC=m
 CONFIG_RAPIDIO=y
 CONFIG_FSL_RIO=y
+CONFIG_FSL_LBC=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_MSI=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -51,6 +54,19 @@ CONFIG_INET_ESP=y
 CONFIG_IPV6=y
 CONFIG_IP_SCTP=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_FSL_IFC=y
+CONFIG_MTD_NAND_FSL_ELBC=y
+CONFIG_MTD_M25P80=y
 CONFIG_PROC_DEVICETREE=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
@@ -58,6 +74,9 @@ CONFIG_BLK_DEV_RAM_SIZE=131072
 CONFIG_MISC_DEVICES=y
 CONFIG_EEPROM_LEGACY=y
 CONFIG_NETDEVICES=y
+CONFIG_ATA=y
+CONFIG_SATA_FSL=y
+CONFIG_SATA_SIL24=y
 CONFIG_DUMMY=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
@@ -73,32 +92,66 @@ CONFIG_SERIAL_8250_RSA=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MPC=y
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=y
+CONFIG_SPI_FSL_SPI=y
+CONFIG_SPI_FSL_ESPI=y
 # CONFIG_HWMON is not set
 CONFIG_VIDEO_OUTPUT_CONTROL=y
-# CONFIG_HID_SUPPORT is not set
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB_HID=m
+CONFIG_USB=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_MON=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_STORAGE=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_OF=y
+CONFIG_MMC_SDHCI_OF_ESDHC=y
+CONFIG_EDAC=y
+CONFIG_EDAC_MM_EDAC=y
 CONFIG_DMADEVICES=y
 CONFIG_FSL_DMA=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=y
+CONFIG_NTFS_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_HUGETLBFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_CRAMFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=m
 # CONFIG_MISC_FILESYSTEMS is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_MAC_PARTITION=y
 CONFIG_NLS=y
+CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=m
 CONFIG_CRC_T10DIF=y
 CONFIG_CRC_ITU_T=m
 CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_SHIRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_DETECT_HUNG_TASK=y
 CONFIG_DEBUG_INFO=y
 CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=y
 CONFIG_IRQ_DOMAIN_DEBUG=y
 CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_MD4=y
 CONFIG_CRYPTO_SHA256=y
 CONFIG_CRYPTO_SHA512=y
 CONFIG_CRYPTO_AES=y
-- 
1.6.4

^ permalink raw reply related

* RE: [PATCH 2/2] powerpc/fsl: Update corenet64_smp_defconfig
From: Liu Shengzhou-B36685 @ 2012-07-11 11:04 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Tudor Laurentiu-B10716, Wang Haiying-R54964,
	linuxppc-dev@lists.ozlabs.org, Rai Harninder-B01044,
	Lian Minghuan-B31939
In-Reply-To: <F985F265-DA57-47F9-AB53-4A889929BF7A@kernel.crashing.org>



> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Tuesday, July 10, 2012 7:44 PM
> To: Liu Shengzhou-B36685
> Cc: linuxppc-dev@lists.ozlabs.org; Wang Haiying-R54964; Tudor Laurentiu-B=
10716;
> Rai Harninder-B01044; Lian Minghuan-B31939
> Subject: Re: [PATCH 2/2] powerpc/fsl: Update corenet64_smp_defconfig
>=20
>=20
> On Jul 10, 2012, at 5:40 AM, Shengzhou Liu wrote:
>=20
> > * Enable USB, MMC, SATA, MTD, NAND, PAMU, RTC
> > * Enable FSL RAID on P5020
> > * Enable general RAID features (MD + async-tx)
> > * Enable RTC on P2041RDB
> > * Enable UIO SRIO & UIO DMA
> > * Enable USDPAA SHMEM driver
> > * Enable ePAPR HV support
> > * Enable PCI-E support
> >
> > Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
> > Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
> > Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
> > Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
> > Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> > Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> > ---
> > arch/powerpc/configs/corenet64_smp_defconfig |   94
> ++++++++++++++++++++++++--
> > 1 files changed, 89 insertions(+), 5 deletions(-)
>=20
> Is this patch really against upstream?  We dont have PAMU, UIO SRIO/DMA,e=
tc
> upstream.
>=20
> - k

Yes, it was against upstream, I posted the v2 revision w/ removing PAMU, UI=
O SRIO/DMA, etc.

Thanks,
Shengzhou

^ permalink raw reply

* RE: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
From: Bhushan Bharat-R65777 @ 2012-07-11 11:24 UTC (permalink / raw)
  To: Xie Shaohui-B21989, linux-watchdog@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
  Cc: Xie Shaohui-B21989
In-Reply-To: <1342000568-5605-1-git-send-email-Shaohui.Xie@freescale.com>

ACK:

> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+bharat.bhushan=3Dfreescale.com@lists.ozlabs.org] On Behalf Of Sha=
ohui Xie
> Sent: Wednesday, July 11, 2012 3:26 PM
> To: linux-watchdog@vger.kernel.org; linuxppc-dev@lists.ozlabs.org
> Cc: Xie Shaohui-B21989
> Subject: [PATCH][v2] powerpc/watchdog: move booke watchdog param related =
code to
> setup-common.c
>=20
> Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is in
> setup_32.c, it cannot be used in 64-bit, so move it to a common place set=
up-
> common.c, which will be shared by 32-bit and 64-bit.
>=20
> Also, replace the simple_strtoul with kstrtol.
>=20
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> changes for v2:
> use setup-common.c instead of prom.c
>=20
>  arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
>  arch/powerpc/kernel/setup_32.c     |   24 ------------------------
>  2 files changed, 27 insertions(+), 24 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/set=
up-
> common.c
> index afd4f05..bdc499c 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -720,6 +720,33 @@ static int powerpc_debugfs_init(void)
> arch_initcall(powerpc_debugfs_init);
>  #endif
>=20
> +#ifdef CONFIG_BOOKE_WDT
> +extern u32 booke_wdt_enabled;
> +extern u32 booke_wdt_period;
> +
> +/* Checks wdt=3Dx and wdt_period=3Dxx command-line option */ notrace int
> +__init early_parse_wdt(char *p) {
> +	if (p && strncmp(p, "0", 1) !=3D 0)
> +		booke_wdt_enabled =3D 1;
> +
> +	return 0;
> +}
> +early_param("wdt", early_parse_wdt);
> +
> +int __init early_parse_wdt_period(char *p) {
> +	unsigned long ret;
> +	if (p) {
> +		if (!kstrtol(p, 0, &ret))
> +			booke_wdt_period =3D ret;
> +	}
> +
> +	return 0;
> +}
> +early_param("wdt_period", early_parse_wdt_period);
> +#endif	/* CONFIG_BOOKE_WDT */
> +
>  void ppc_printk_progress(char *s, unsigned short hex)  {
>  	pr_info("%s\n", s);
> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_3=
2.c
> index ec8a53f..a8f54ec 100644
> --- a/arch/powerpc/kernel/setup_32.c
> +++ b/arch/powerpc/kernel/setup_32.c
> @@ -149,30 +149,6 @@ notrace void __init machine_init(u64 dt_ptr)
>  		ppc_md.progress("id mach(): done", 0x200);  }
>=20
> -#ifdef CONFIG_BOOKE_WDT
> -extern u32 booke_wdt_enabled;
> -extern u32 booke_wdt_period;
> -
> -/* Checks wdt=3Dx and wdt_period=3Dxx command-line option */ -notrace in=
t __init
> early_parse_wdt(char *p) -{
> -	if (p && strncmp(p, "0", 1) !=3D 0)
> -	       booke_wdt_enabled =3D 1;
> -
> -	return 0;
> -}
> -early_param("wdt", early_parse_wdt);
> -
> -int __init early_parse_wdt_period (char *p) -{
> -	if (p)
> -		booke_wdt_period =3D simple_strtoul(p, NULL, 0);
> -
> -	return 0;
> -}
> -early_param("wdt_period", early_parse_wdt_period);
> -#endif	/* CONFIG_BOOKE_WDT */
> -
>  /* Checks "l2cr=3Dxxxx" command-line option */  int __init ppc_setup_l2c=
r(char
> *str)  {
> --
> 1.6.4
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* RE: [PATCH] PCI: Add pcie_irq=other to enable non MSI/INTx interrupt for port service driver
From: Liu Shengzhou-B36685 @ 2012-07-11 11:29 UTC (permalink / raw)
  To: Kumar Gala, Wood Scott-B07421
  Cc: bhelgaas@google.com, Wood Scott-B07421,
	linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org
In-Reply-To: <009D8F85-2036-47C1-A19E-3E8D3EB8462F@kernel.crashing.org>



> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Tuesday, July 10, 2012 11:50 PM
> To: Wood Scott-B07421
> Cc: Liu Shengzhou-B36685; bhelgaas@google.com; Wood Scott-B07421; linuxpp=
c-
> dev@lists.ozlabs.org; linux-pci@vger.kernel.org
> Subject: Re: [PATCH] PCI: Add pcie_irq=3Dother to enable non MSI/INTx int=
errupt
> for port service driver
>=20
>=20
> On Jul 10, 2012, at 10:31 AM, Scott Wood wrote:
>=20
> > On 07/10/2012 01:13 AM, Liu Shengzhou-B36685 wrote:
> >>
> >>
> >>> -----Original Message-----
> >>> From: Wood Scott-B07421
> >>> Sent: Tuesday, July 10, 2012 12:39 AM
> >>> To: Liu Shengzhou-B36685
> >>> Cc: bhelgaas@google.com; linux-pci@vger.kernel.org; linuxppc-
> >>> dev@lists.ozlabs.org
> >>> Subject: Re: [PATCH] PCI: Add pcie_irq=3Dother to enable non MSI/INTx
> >>> interrupt for port service driver
> >>>
> >>> On 07/09/2012 05:49 AM, Shengzhou Liu wrote:
> >>>> On some platforms, in RC mode, root port has neither MSI/MSI-X nor
> >>>> INTx interrupt generated, which are available only in EP mode on
> >>>> those
> >>> platform.
> >>>> In this case, we try to use other interrupt if supported (i.e.
> >>>> there is the shared error interrupt on platform P1010, P3041,
> >>>> P4080, etc) to have AER, Hot-plug, etc, services to work.
> >>>>
> >>>> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> >>>> ---
> >>>> Documentation/kernel-parameters.txt |    4 ++++
> >>>> drivers/pci/pcie/portdrv_core.c     |   19 +++++++++++++++++++
> >>>> 2 files changed, 23 insertions(+), 0 deletions(-)
> >>>>
> >>>> diff --git a/Documentation/kernel-parameters.txt
> >>>> b/Documentation/kernel-parameters.txt
> >>>> index a92c5eb..af97c81 100644
> >>>> --- a/Documentation/kernel-parameters.txt
> >>>> +++ b/Documentation/kernel-parameters.txt
> >>>> @@ -2218,6 +2218,10 @@ bytes respectively. Such letter suffixes can
> >>>> also be
> >>> entirely omitted.
> >>>> 		nomsi	Do not use MSI for native PCIe PME signaling (this makes
> >>>> 			all PCIe root ports use INTx for all services).
> >>>>
> >>>> +	pcie_irq=3D	[PCIE] Native PCIe root port interrupt options:
> >>>> +		other	Try to use other interrupt when root port has
> >>>> +			neither MSI/MSI-X nor INTx support.
> >>>
> >>> Why does the user need to specify this?  Shouldn't this be a matter
> >>> of communication between kernel internals?
> >>>
> >>
> >> The "other interrupt" appears a non-standard interrupt way compared to
> MSI/MSI-X and INTx in point of PCIe spec.
> >
> > It still shouldn't be the user's responsibility to pass this in.
>=20
> I agree with Scott, this should be done in board code or as a PCI fixup, =
not
> as a command line arg.
>=20
> >> The intent of specifying this is to have an intervention and
> >> confirmation manually to avoid causing unexpected issue on some
> >> unknown platforms.
> >>
> >> I'm glad to remove the specified kernel parameter if it would be accep=
ted
> upstream.
> >
> > Hopefully someone will comment if there is harm in doing this
> > unconditionally.  If there is, then we should handle this via a quirk
> > or similar mechanism.
> >
> > -Scott
>=20
> If we need to do it via quirk, wondering if we can use the pci_dev_flags =
and
> set the flag in a quirk.
>=20
> - k
=20
Yes, it's better to do that with quirt way, I'm going to submit a new patch=
 with that way.

Thanks,
Shengzhou

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Add dts files for P1021RDB-PC board
From: Kumar Gala @ 2012-07-11 12:31 UTC (permalink / raw)
  To: Jiucheng Xu; +Cc: linuxppc-dev
In-Reply-To: <1342000689.7459.179.camel@glenn-desktop>


On Jul 11, 2012, at 4:58 AM, Jiucheng Xu wrote:

>=20
>=20
> On Tue, 2012-07-10 at 06:48 -0500, Kumar Gala wrote:
>> On Jul 10, 2012, at 3:39 AM, Xu Jiucheng wrote:
>>> ---
>>> arch/powerpc/boot/dts/p1021rdb-pc.dtsi    |  236 =
+++++++++++++++++++++++++++++
>>> arch/powerpc/boot/dts/p1021rdb-pc_32b.dts |   96 ++++++++++++
>>> arch/powerpc/boot/dts/p1021rdb-pc_36b.dts |   96 ++++++++++++
>>> arch/powerpc/boot/dts/p1021rdb.dts        |   96 ------------
>>> arch/powerpc/boot/dts/p1021rdb.dtsi       |  236 =
-----------------------------
>>> arch/powerpc/boot/dts/p1021rdb_36b.dts    |   96 ------------
>>> 6 files changed, 428 insertions(+), 428 deletions(-)
>>> create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc.dtsi
>>> create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc_32b.dts
>>> create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc_36b.dts
>>> delete mode 100644 arch/powerpc/boot/dts/p1021rdb.dts
>>> delete mode 100644 arch/powerpc/boot/dts/p1021rdb.dtsi
>>> delete mode 100644 arch/powerpc/boot/dts/p1021rdb_36b.dts
>>=20
>> Do we really need a 32 & 36 bit device tree for this board?  Isnt the =
memory fixed so why not just have 32b?
>>=20
> I have no idea, 36 bit is already there in the history release of SDK,
> If it is not necessary for upstream, I can resend a new patch without =
36
> bit.
>> Also, why are you removing the dts for the older P1021RDB??
>>=20
>> - k
> This dts for the older P1021RDB was committed by me. I just rename =
these
> files in order to keep uniformity with other platforms, e.g
> "P1020rdb-pc.dtsi  p1020mbg-pc.dtsi". If you think it doesn't matter,
> please ignore this patch.

Sorry, I was thinking there was a different board for P1021RDB (older =
than P1021RDB-PC), like we have for P1020RDB.

> If AMP is a specific application as Timur says, please ignore the AMP
> patch.

- k=

^ permalink raw reply

* Re: [PATCH] powerpc/85xx: Add dts files for P1021RDB-PC board
From: Kumar Gala @ 2012-07-11 12:43 UTC (permalink / raw)
  To: Xu Jiucheng; +Cc: Matthew McClintock, linuxppc-dev
In-Reply-To: <1341909561-6591-1-git-send-email-Jiucheng.Xu@freescale.com>


On Jul 10, 2012, at 3:39 AM, Xu Jiucheng wrote:

> P1021RDB-PC Overview
> -----------------
> 1Gbyte DDR3 (on board DDR)
> 16Mbyte NOR flash
> 32Mbyte eSLC NAND Flash
> 256 Kbit M24256 I2C EEPROM
> 128 Mbit SPI Flash memory
> Real-time clock on I2C bus
> SD/MMC connector to interface with the SD memory card
> PCIex
> 	- x1 PCIe slot or x1 PCIe to dual SATA controller
> 	- x1 mini-PCIe slot
> USB 2.0
> 	- ULPI PHY interface: SMSC USB3300 USB PHY and Genesys Logic=92s =
GL850A
> 	- Two USB2.0 Type A receptacles
> 	- One USB2.0 signal to Mini PCIe slot
> eTSEC1: Connected to RGMII PHY VSC7385
> eTSEC2: Connected to SGMII PHY VSC8221
> eTSEC3: Connected to SGMII PHY AR8021
> DUART interface: supports two UARTs up to 115200 bps for console =
display
>=20
> Signed-off-by: Xu Jiucheng <Jiucheng.Xu@freescale.com>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> arch/powerpc/boot/dts/p1021rdb-pc.dtsi    |  236 =
+++++++++++++++++++++++++++++
> arch/powerpc/boot/dts/p1021rdb-pc_32b.dts |   96 ++++++++++++
> arch/powerpc/boot/dts/p1021rdb-pc_36b.dts |   96 ++++++++++++
> arch/powerpc/boot/dts/p1021rdb.dts        |   96 ------------
> arch/powerpc/boot/dts/p1021rdb.dtsi       |  236 =
-----------------------------
> arch/powerpc/boot/dts/p1021rdb_36b.dts    |   96 ------------
> 6 files changed, 428 insertions(+), 428 deletions(-)
> create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc.dtsi
> create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc_32b.dts
> create mode 100644 arch/powerpc/boot/dts/p1021rdb-pc_36b.dts
> delete mode 100644 arch/powerpc/boot/dts/p1021rdb.dts
> delete mode 100644 arch/powerpc/boot/dts/p1021rdb.dtsi
> delete mode 100644 arch/powerpc/boot/dts/p1021rdb_36b.dts

applied to next.  Rewrote commit message to just say we are renaming the =
device trees.

- k=

^ permalink raw reply

* Re: [PATCH 1/2] powerpc/fsl: Update corenet32_smp_defconfig
From: Kumar Gala @ 2012-07-11 12:57 UTC (permalink / raw)
  To: Shengzhou Liu; +Cc: linuxppc-dev
In-Reply-To: <1342003205-23378-1-git-send-email-Shengzhou.Liu@freescale.com>


On Jul 11, 2012, at 5:40 AM, Shengzhou Liu wrote:

> - Enable NAND support
> - Enable CONFIG_PCI_MSI and CONFIG_MMC_SDHCI_OF
> 
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
> arch/powerpc/configs/corenet32_smp_defconfig |    8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)

applied to next

- k

^ permalink raw reply

* Re: [PATCH 2/2] powerpc/fsl: Update corenet64_smp_defconfig
From: Kumar Gala @ 2012-07-11 12:57 UTC (permalink / raw)
  To: Shengzhou Liu; +Cc: linuxppc-dev
In-Reply-To: <1342003205-23378-2-git-send-email-Shengzhou.Liu@freescale.com>


On Jul 11, 2012, at 5:40 AM, Shengzhou Liu wrote:

> Enable USB, MMC, SATA, LBC, MTD, NAND, SPI, PCIe, EDAC, VFAT, NFS, =
etc.
>=20
> Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
> ---
> arch/powerpc/configs/corenet64_smp_defconfig |   59 =
++++++++++++++++++++++++-
> 1 files changed, 56 insertions(+), 3 deletions(-)

applied to next

- k=

^ permalink raw reply

* Re: [PATCH][v2] powerpc/watchdog: move booke watchdog param related code to setup-common.c
From: Kumar Gala @ 2012-07-11 12:57 UTC (permalink / raw)
  To: Shaohui Xie; +Cc: linuxppc-dev, linux-watchdog
In-Reply-To: <1342000568-5605-1-git-send-email-Shaohui.Xie@freescale.com>


On Jul 11, 2012, at 4:56 AM, Shaohui Xie wrote:

> Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is
> in setup_32.c, it cannot be used in 64-bit, so move it to a common place
> setup-common.c, which will be shared by 32-bit and 64-bit.
> 
> Also, replace the simple_strtoul with kstrtol.
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> changes for v2:
> use setup-common.c instead of prom.c
> 
> arch/powerpc/kernel/setup-common.c |   27 +++++++++++++++++++++++++++
> arch/powerpc/kernel/setup_32.c     |   24 ------------------------
> 2 files changed, 27 insertions(+), 24 deletions(-)

applied to next

- k

^ permalink raw reply

* Re: [PATCH v2 3/3] powerpc/mpc85xx_ds: convert to unified PCI init
From: Kumar Gala @ 2012-07-11 12:57 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Alexander Graf
In-Reply-To: <1341966409-22660-4-git-send-email-scottwood@freescale.com>


On Jul 10, 2012, at 7:26 PM, Scott Wood wrote:

> Similar to how the primary PCI bridge is identified by looking
> for an isa subnode, we determine whether to apply uli exclusions
> by looking for a uli subnode.
>=20
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> v2: Rebased on Kumar's next
>=20
> arch/powerpc/platforms/85xx/mpc85xx_ds.c |   97 =
+++++++++---------------------
> 1 files changed, 29 insertions(+), 68 deletions(-)

applied to next

- k=

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox