LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc/pci: Fix IO space breakage after of_pci_range_to_resource() change
From: arnd @ 2014-10-16 14:05 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman
  Cc: bhelgaas, linus.walleij, Liviu.Dudau, linux-kernel
In-Reply-To: <1413429775-716-1-git-send-email-mpe@ellerman.id.au>

(hope my email makes it everywhere, using a webmail client at the moment as=
 I'm
at plumbersconf

Michael Ellerman <mpe@ellerman.id.au> hat am 16. Oktober 2014 um 05:22
geschrieben:
>
>
> Commit 0b0b0893d49b "of/pci: Fix the conversion of IO ranges into IO
> resources" changed the behaviour of of_pci_range_to_resource().

I just looked at this after benh mentioned the problem on IRC, here's a log=
 dump

:26 AM   <benh> argh =20
9:27 AM   <benh> the whole ARM OF PCI rework seems to completely break PIO =
on
powerpc =20
9:30 AM   =E2=86=92 willy <willy> joined (^willy@62.156.150.204) =20
9:35 AM   <benh> and reverting it would mean reverting all of ARM new PCI s=
tuff
=20
9:35 AM   <benh> crap =20
9:35 AM   <benh> that business with IO space allocation taking over our cod=
e
without understanding what it does =20
9:35 AM   <benh> yuck =20
9:41 AM     =E2=86=92 markf <markf> , olaf <olaf> , sarnold <sarnold> , gos=
po <gospo> ,
cmarinas <cmarinas> , Mahesh1 <Mahesh1> , joern <joern> , clark_ <clark_> a=
nd
benhjoined  =E2=87=90 gcl <gcl> and clark <clark> quit  =E2=86=94 willy <wi=
lly> , jbarnes
<jbarnes> , jbrandeb_ <jbrandeb_> and Mahesh <Mahesh> popped in  =E2=86=94 =
sameo <sameo>
, jbrandeb <jbrandeb> , steved <steved> and jj <jj> nipped out  =E2=80=A2  =
srikar =E2=86=92
srikar_away <srikar_away> , raghu =E2=86=92 raghu_away <raghu_away> =20
Thursday, October 16th, 2014 =20
12:06 AM     =E2=86=92 fweisbec <fweisbec> , Mahesh <Mahesh> , kamalesh <ka=
malesh> ,
heiko <heiko> , olaf <olaf> , riel <riel> and willy <willy> joined  =E2=87=
=90 shaggy
<shaggy> , sammj <sammj> , sameo <sameo> , clark_ <clark_> , lenb <lenb> an=
d jj
<jj> quit  =E2=86=94 jbrandeb <jbrandeb> , cdub <cdub> , Mahesh1 <Mahesh1> =
and gcl <gcl>
popped in  =E2=86=94 jbrandeb_ <jbrandeb_> , benh, joern <joern> and BenC <=
BenC> nipped
out  =E2=80=A2  mpe|away =E2=86=92 mpe|away <mpe%7Caway> , raghu_away =E2=
=86=92 raghu <raghu> ,
srikar_away =E2=86=92 srikar <srikar> =20
10:16 AM   <arnd_> benh: is it the of_pci_range_to_resource change? =20
10:17 AM   <arnd_> the new pci_ioremap_iospace logic should not get used on
powerpc at all, so I didn't expect any breakage =20
10:18 AM   <arnd_> I wasn't too happy with all the details of Liviu's serie=
s,
bit in the end it seemed reasonable enough =20
10:20 AM   <arnd_> he really wanted to use the pci_address_to_pio code from
powerpc and in the end I stopped complaining =20
10:21 AM   <arnd_> the new code can do a few things that simpler versions c=
ould
not, e.g. handling multiple host bridges getting registered when they have =
the
same I/O space window =20
10:23 AM   =E2=86=92 jj <jj> joined (^jj@static-50-53-60-87.bvtn.or.frontie=
rnet.net) =20
10:33 AM   <arnd_> benh: I can see how it breaks your
pci_process_bridge_OF_ranges, we had the same problem in some of the ARM
platforms and Liviu fixed those but apparently didn't realize he had to cha=
nge
the ppc implementation (and get your ack) too =20
10:35 AM   <arnd_> the good news is that it should in fact simplify your co=
de to
fix it, but the fact that this bug got into the kernel in the first place i=
s
extremely annoying =20
10:39 AM   <arnd_> benh: the fixup that is done in your
pcibios_reserve_legacy_regions is now already performed in
of_pci_range_to_resource =20
10:39 AM   <arnd_> we had duplicated the same thing in each pci host driver=
 (and
they all got it wrong), so the intent was to move it into a common place =
=20
10:40 AM   <arnd_> but of course it's a bug to do it twice =20
10:43 AM   <arnd_> pci_register_io_range is trying to do a more generalized
version of how you assign hose->io_base_virt, you should probably override =
that
to keep the current behavior =20
10:45 AM   <arnd_> pcibios_map_phb_io_space I mean, for ppc64 =20
10:52 AM   =E2=86=92 cmarinas <cmarinas> joined (~cmarinas@fw-tnat.cambridg=
e.arm.com) =20
10:53 AM   <arnd_> benh: for 3.18, the best approach is likely to #ifdef
<%23ifdef> PCI_IOBASE the changes in of_pci_range_to_resource =20
10:54 AM   <arnd_> I suspect you are fine with effectively reverting Liviu'=
s
changes that way, and you can decide whether or not you want to later make =
the
powerpc code use the common logic =20
11:01 AM     =E2=86=92 cdub <cdub> and sarnold <sarnold> joined  =E2=87=90 =
cmarinas <cmarinas>
quit =20
11:28 AM   <benh> arnd_: can you shoot the above in an email CCed to mpe ? =
=20
11:28 AM   <benh> arnd_: he did a band aid that works =20
11:28 AM   <benh> arnd_: and see the comment I made today about using his s=
tuff
if I can specify where I want the IO ranges =20
11:28 AM   <benh> arnd_: I want to keep the way I do the layout on ppc64 =
=20

> Previously it simply populated the resource based on the arguments. Now
> it calls pci_register_io_range() and pci_address_to_pio(). These both
> have two implementations depending on whether PCI_IOBASE is defined,
> which it is not for powerpc.
>
> Further complicating matters, both routines are weak, and powerpc
> implements it's own version of one - pci_address_to_pio(). However
> powerpc's implementation depends on other initialisations which are done
> later in boot.

Right, sorry for missing this during the last review of the broken patches.

> The end result is incorrectly initialised IO space. Often we can get
> away with that, because we don't make much use of IO space. However
> virtio requires it, so we see eg:
>
> pci_bus 0000:00: root bus resource [io 0xffff] (bus address
> [0xffffffffffffffff-0xffffffffffffffff])
> PCI: Cannot allocate resource region 0 of device 0000:00:01.0, will remap
> virtio-pci 0000:00:01.0: can't enable device: BAR 0 [io size 0x0020] not
> assigned
>
> The simplest fix for now is to just stop using of_pci_range_to_resource()=
,
> and open-code the original imp`lementation, that's all we want it to do.

The same bug is likely to be present on microblaze and mips, which may or m=
ay
not
care about it. I'll ask Michal about whether microblaze actually has any
I/O space, otherwise we have to fix it too for 3.18.

I believe for 3.19, we should probably migrate microblaze over to use the s=
ame
code
as ARM.

> Fixes: 0b0b0893d49b ("of/pci: Fix the conversion of IO ranges into IO
> resources")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/kernel/pci-common.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/pci-common.c
> b/arch/powerpc/kernel/pci-common.c
> index bd70a51d5747..e5dad9a9edc0 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -747,7 +747,11 @@ void pci_process_bridge_OF_ranges(struct pci_control=
ler
> *hose,
> break;
> }
> if (res !=3D NULL) {
> - of_pci_range_to_resource(&range, dev, res);
> + res->name =3D dev->full_name;
> + res->flags =3D range.flags;
> + res->start =3D range.cpu_addr;
> + res->end =3D range.cpu_addr + range.size - 1;
> + res->parent =3D res->child =3D res->sibling =3D NULL;
> }
> }

This looks reasonable to me as a hack to work around the breakage. It would=
 be
good
to work together on this for 3.19 to move on to the a common implementation=
 that
works on both ARM and PowerPC. This might be possibly by removing a lot of =
code
for PowerPC (at least 64-bit) that is now present in common code, but it wi=
ll
change the structure of the powerpc implementation significantly, since the
returned numbers are now in different memory spaces (logical I/O space rath=
er
than physical). The PowerPC _IO_BASE is the equivalent of the now generic
PCI_IOBASE,
but it's used slightly differently. If you want to use the generic code,=20
you should probably change host->io_base_virt to host->io_base in logical
space (i.e. removing the _IO_BASE offset), or using hose->io_resource.start
instead.

       Arnd

^ permalink raw reply

* Re: [PATCH 1/2] mm: Update generic gup implementation to handle hugepage directory
From: Aneesh Kumar K.V @ 2014-10-16 15:18 UTC (permalink / raw)
  To: Steve Capper
  Cc: Andrea Arcangeli, linux-arch, catalin.marinas, will.deacon,
	linux-kernel, linux-mm, linux, akpm, linuxppc-dev
In-Reply-To: <20141016092529.GA1524@linaro.org>

Steve Capper <steve.capper@linaro.org> writes:

> On Wed, Oct 15, 2014 at 10:04:47PM +0530, Aneesh Kumar K.V wrote:
>> Update generic gup implementation with powerpc specific details.
>> On powerpc at pmd level we can have hugepte, normal pmd pointer
>> or a pointer to the hugepage directory.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>
> Hi,
> This patch causes compiler errors on arm and arm64 due to pgd_huge
> being undefined. I've attached a fixup below, this fixup will require
> that #define pgd_huge(pgd) 0 be added back into:
> arch/powerpc/include/asm/page.h
> For the second patch in this series.
>
> Another avenue would be to do something like:
> #ifndef pgd_huge
> #define pgd_huge(pgd)	(0)
> #endif
>
> Then no changes would be required to arm and arm64 (or other
> architectures).
>
> To help with bisectability, could we please have a suitable fix applied
> to the two patches in the -mm tree:
> http://ozlabs.org/~akpm/mmots/broken-out/mm-update-generic-gup-implementation-to-handle-hugepage-directory.patch
> http://ozlabs.org/~akpm/mmots/broken-out/arch-powerpc-switch-to-generic-rcu-get_user_pages_fast.patch
>
> rather than applied afterwards?
>
> With pgd_huge(x) defined, this patch passes my futex test on arm
> (Arndale platform) and arm64(Juno).
>
> Cheers,
> -- 
> Steve
>
>
>
> From 2fb7b0308f0aca94c50611257ba82d656abb0768 Mon Sep 17 00:00:00 2001
> From: Steve Capper <steve.capper@linaro.org>
> Date: Thu, 16 Oct 2014 09:09:48 +0100
> Subject: [PATCH] Fixup for Update generic gup implementation
>
> The patch:
> mm: Update generic gup implementation to handle hugepage directory
>
> will not compile for arm or arm64 due to pgd_huge being undefined.
>
> Signed-off-by: Steve Capper <steve.capper@linaro.org>
> ---
>  arch/arm/include/asm/pgtable.h   | 2 ++
>  arch/arm64/include/asm/pgtable.h | 2 ++
>  include/linux/hugetlb.h          | 1 -
>  3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
> index 90aa4583..46f81fb 100644
> --- a/arch/arm/include/asm/pgtable.h
> +++ b/arch/arm/include/asm/pgtable.h
> @@ -181,6 +181,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
>  /* to find an entry in a kernel page-table-directory */
>  #define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
>
> +#define pgd_huge(pgd)		(0)
> +
>  #define pmd_none(pmd)		(!pmd_val(pmd))
>  #define pmd_present(pmd)	(pmd_val(pmd))
>
> diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> index 464c5ce..d4462ca 100644
> --- a/arch/arm64/include/asm/pgtable.h
> +++ b/arch/arm64/include/asm/pgtable.h
> @@ -462,6 +462,8 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
>  extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
>  extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
>
> +#define pgd_huge(pgd)		(0)
> +
>  /*
>   * Encode and decode a swap entry:
>   *	bits 0-1:	present (must be zero)
> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> index 65e12a2..6e6d338 100644
> --- a/include/linux/hugetlb.h
> +++ b/include/linux/hugetlb.h
> @@ -138,7 +138,6 @@ static inline void hugetlb_show_meminfo(void)
>  #define prepare_hugepage_range(file, addr, len)	(-EINVAL)
>  #define pmd_huge(x)	0
>  #define pud_huge(x)	0
> -#define pgd_huge(x)	0
>  #define is_hugepage_only_range(mm, addr, len)	0
>  #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
>  #define hugetlb_fault(mm, vma, addr, flags)	({ BUG(); 0; })

don't do the last hunk, that will result in build failures on sub
platforms on ppc64. can you do the arm patch without making the change
to hugetlb.h ?

-aneesh

^ permalink raw reply

* Re: [PATCH 1/2] mm: Update generic gup implementation to handle hugepage directory
From: Steve Capper @ 2014-10-16 15:42 UTC (permalink / raw)
  To: Aneesh Kumar K.V
  Cc: Andrea Arcangeli, linux-arch, catalin.marinas, will.deacon,
	linux-kernel, linux-mm, linux, akpm, linuxppc-dev
In-Reply-To: <871tq8kpqb.fsf@linux.vnet.ibm.com>

On Thu, Oct 16, 2014 at 08:48:20PM +0530, Aneesh Kumar K.V wrote:
> Steve Capper <steve.capper@linaro.org> writes:
> 
> > On Wed, Oct 15, 2014 at 10:04:47PM +0530, Aneesh Kumar K.V wrote:
> >> Update generic gup implementation with powerpc specific details.
> >> On powerpc at pmd level we can have hugepte, normal pmd pointer
> >> or a pointer to the hugepage directory.
> >> 
> >> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> >
> > Hi,
> > This patch causes compiler errors on arm and arm64 due to pgd_huge
> > being undefined. I've attached a fixup below, this fixup will require
> > that #define pgd_huge(pgd) 0 be added back into:
> > arch/powerpc/include/asm/page.h
> > For the second patch in this series.
> >
> > Another avenue would be to do something like:
> > #ifndef pgd_huge
> > #define pgd_huge(pgd)	(0)
> > #endif
> >
> > Then no changes would be required to arm and arm64 (or other
> > architectures).
> >
> > To help with bisectability, could we please have a suitable fix applied
> > to the two patches in the -mm tree:
> > http://ozlabs.org/~akpm/mmots/broken-out/mm-update-generic-gup-implementation-to-handle-hugepage-directory.patch
> > http://ozlabs.org/~akpm/mmots/broken-out/arch-powerpc-switch-to-generic-rcu-get_user_pages_fast.patch
> >
> > rather than applied afterwards?
> >
> > With pgd_huge(x) defined, this patch passes my futex test on arm
> > (Arndale platform) and arm64(Juno).
> >
> > Cheers,
> > -- 
> > Steve
> >
> >
> >
> > From 2fb7b0308f0aca94c50611257ba82d656abb0768 Mon Sep 17 00:00:00 2001
> > From: Steve Capper <steve.capper@linaro.org>
> > Date: Thu, 16 Oct 2014 09:09:48 +0100
> > Subject: [PATCH] Fixup for Update generic gup implementation
> >
> > The patch:
> > mm: Update generic gup implementation to handle hugepage directory
> >
> > will not compile for arm or arm64 due to pgd_huge being undefined.
> >
> > Signed-off-by: Steve Capper <steve.capper@linaro.org>
> > ---
> >  arch/arm/include/asm/pgtable.h   | 2 ++
> >  arch/arm64/include/asm/pgtable.h | 2 ++
> >  include/linux/hugetlb.h          | 1 -
> >  3 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
> > index 90aa4583..46f81fb 100644
> > --- a/arch/arm/include/asm/pgtable.h
> > +++ b/arch/arm/include/asm/pgtable.h
> > @@ -181,6 +181,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
> >  /* to find an entry in a kernel page-table-directory */
> >  #define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
> >
> > +#define pgd_huge(pgd)		(0)
> > +
> >  #define pmd_none(pmd)		(!pmd_val(pmd))
> >  #define pmd_present(pmd)	(pmd_val(pmd))
> >
> > diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
> > index 464c5ce..d4462ca 100644
> > --- a/arch/arm64/include/asm/pgtable.h
> > +++ b/arch/arm64/include/asm/pgtable.h
> > @@ -462,6 +462,8 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
> >  extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
> >  extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
> >
> > +#define pgd_huge(pgd)		(0)
> > +
> >  /*
> >   * Encode and decode a swap entry:
> >   *	bits 0-1:	present (must be zero)
> > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> > index 65e12a2..6e6d338 100644
> > --- a/include/linux/hugetlb.h
> > +++ b/include/linux/hugetlb.h
> > @@ -138,7 +138,6 @@ static inline void hugetlb_show_meminfo(void)
> >  #define prepare_hugepage_range(file, addr, len)	(-EINVAL)
> >  #define pmd_huge(x)	0
> >  #define pud_huge(x)	0
> > -#define pgd_huge(x)	0
> >  #define is_hugepage_only_range(mm, addr, len)	0
> >  #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
> >  #define hugetlb_fault(mm, vma, addr, flags)	({ BUG(); 0; })
> 
> don't do the last hunk, that will result in build failures on sub
> platforms on ppc64. can you do the arm patch without making the change
> to hugetlb.h ?
> 

Hi Aneesh,

The problem with leaving the empty pgd_huge in hugetlb.h is that we
would then have to resort to patterns like this for both arm and arm64:

#ifdef CONFIG_HUGETLB_PAGE
#define pgd_huge(pgd)		(0)
#endif

If possible, I'd much rather just have:
#define pgd_huge(pgd)		(0)

After the second patch in this series we already have the following
code pattern in arch/powerpc/include/asm/page.h:

 #define is_hugepd(hpd)               (hugepd_ok(hpd))
 int pgd_huge(pgd_t pgd);
 #else /* CONFIG_HUGETLB_PAGE */
 #define is_hugepd(pdep)                        0
 #endif /* CONFIG_HUGETLB_PAGE */
 #define __hugepd(x) ((hugepd_t) { (x) })

Can we not just add a:
#define pgd_huge(pgd)		(0)
above the "#endif /* CONFIG_HUGETLB_PAGE */" line in the second patch?
(or, more precisely, prevent the second patch from removing this line).

That way we get a clearer code overall?

Cheers,
-- 
Steve

^ permalink raw reply

* Re: [PATCH 1/2] mm: Update generic gup implementation to handle hugepage directory
From: Aneesh Kumar K.V @ 2014-10-16 18:05 UTC (permalink / raw)
  To: Steve Capper
  Cc: Andrea Arcangeli, linux-arch, catalin.marinas, will.deacon,
	linux-kernel, linux-mm, linux, akpm, linuxppc-dev
In-Reply-To: <20141016154228.GA12995@linaro.org>

Steve Capper <steve.capper@linaro.org> writes:

> Can we not just add a:
> #define pgd_huge(pgd)		(0)
> above the "#endif /* CONFIG_HUGETLB_PAGE */" line in the second patch?
> (or, more precisely, prevent the second patch from removing this line).
>
> That way we get a clearer code overall?

it is strange to have both pmd_huge and pud_huge in hugetlb.h and
pgd_huge in page.h. But if that is what we want then we may need.


diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index aa430ec14895..aeca81947dc6 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -383,6 +383,7 @@ static inline int hugepd_ok(hugepd_t hpd)
 int pgd_huge(pgd_t pgd);
 #else /* CONFIG_HUGETLB_PAGE */
 #define is_hugepd(pdep)			0
+#define pgd_huge(pgd)			0
 #endif /* CONFIG_HUGETLB_PAGE */
 #define __hugepd(x) ((hugepd_t) { (x) })
 

^ permalink raw reply related

* [PATCH] drivers/crypto/nx: prevent oops on module exit
From: Dan Streetman @ 2014-10-16 19:30 UTC (permalink / raw)
  To: benh, Seth Jennings, Robert Jennings; +Cc: linuxppc-dev, Dan Streetman

Check old_devdata->dev in nx-842 driver before accessing it, as
on systems without any nx-842 hardware, the ->dev will never be
set.  Currently, the module will cause an oops during unload
since old_devdata->dev is null.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
---

Also Seth and Rob, you guys should change your emails in this
driver, your IBM emails are still listed.

 drivers/crypto/nx/nx-842.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c
index 061407d..809a220 100644
--- a/drivers/crypto/nx/nx-842.c
+++ b/drivers/crypto/nx/nx-842.c
@@ -1269,7 +1269,7 @@ static void __exit nx842_exit(void)
 	RCU_INIT_POINTER(devdata, NULL);
 	spin_unlock_irqrestore(&devdata_mutex, flags);
 	synchronize_rcu();
-	if (old_devdata)
+	if (old_devdata && old_devdata->dev)
 		dev_set_drvdata(old_devdata->dev, NULL);
 	kfree(old_devdata);
 	vio_unregister_driver(&nx842_driver);
-- 
1.8.3.1

^ permalink raw reply related

* Re: [PATCH v2] powerpc: Only do dynamic DMA zone limits on platforms that need it
From: Scott Wood @ 2014-10-16 21:39 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Anton Blanchard
In-Reply-To: <1413442068-5957-1-git-send-email-mpe@ellerman.id.au>

On Thu, 2014-10-16 at 17:47 +1100, Michael Ellerman wrote:
> Scott's patch 1c98025c6c95 "Dynamic DMA zone limits" changed
> dma_direct_alloc_coherent() to start using dev->coherent_dma_mask.
> 
> That seems fair enough, but it exposes the fact that some of the drivers
> we care about on IBM platforms aren't setting the coherent mask.
> 
> The proper fix is to have drivers set the coherent mask and also have
> the platform code honor it.
> 
> For now, just restrict the dynamic DMA zone limits to the platforms that
> need it.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  arch/powerpc/kernel/dma.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> v2: Use FSL_SOC.

Acked-by: Scott Wood <scottwood@freescale.com>

-Scott

^ permalink raw reply

* Re: [PATCH 0/2] fix a kernel panic on fsl corenet board when CONFIG_CLK_PPC_CORENET is enabled
From: Scott Wood @ 2014-10-16 21:49 UTC (permalink / raw)
  To: Kevin Hao; +Cc: Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <1413458321-23880-1-git-send-email-haokexin@gmail.com>

On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> Hi,
> 
> This tries to fix a kernel panic introduced by commit da788acb2838
> ("clk: ppc-corenet: Fix Section mismatch warning").

That patch is just wrong and should be reverted, separately from any new
attempt to fix the section mismatch warning.

-Scott

^ permalink raw reply

* Re: [PATCH 1/2] powerpc: move ppc_init() to common place
From: Scott Wood @ 2014-10-16 21:54 UTC (permalink / raw)
  To: Kevin Hao; +Cc: Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <1413458321-23880-2-git-send-email-haokexin@gmail.com>

On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> So they can be used by ppc64 board. Also remove the unneeded {} to
> make checkpatch happy.
> 
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
>  arch/powerpc/include/asm/machdep.h |  2 +-
>  arch/powerpc/kernel/setup-common.c | 15 +++++++++++++++
>  arch/powerpc/kernel/setup_32.c     | 15 ---------------
>  3 files changed, 16 insertions(+), 16 deletions(-)

This is unnecessary -- why not just use machine_arch_initcall?

-Scott

^ permalink raw reply

* Re: [PATCH 2/2] clk: ppc-corenet: don't use platform_driver to init the clock device
From: Scott Wood @ 2014-10-16 21:55 UTC (permalink / raw)
  To: Kevin Hao; +Cc: Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <1413458321-23880-3-git-send-email-haokexin@gmail.com>

On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> In commit da788acb2838 ("clk: ppc-corenet: Fix Section mismatch
> warning"), we put the ppc_corenet_clk_driver struct to init section
> in order to fix section mismatch warning. This is definitely wrong
> because the kernel would free the memories occupied by
> ppc_corenet_clk_driver after boot while this driver is still registered
> in the driver core. The kernel would panic when accessing this driver
> struct. So choose to use CLK_OF_DECLARE to scan and init the clock devices.
> 
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
>  arch/powerpc/platforms/85xx/corenet_generic.c |  7 +++++
>  drivers/clk/clk-ppc-corenet.c                 | 43 ++++-----------------------
>  2 files changed, 13 insertions(+), 37 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
> index e56b89a792ed..7677cfecb787 100644
> --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> @@ -16,6 +16,7 @@
>  #include <linux/kdev_t.h>
>  #include <linux/delay.h>
>  #include <linux/interrupt.h>
> +#include <linux/clk-provider.h>
>  
>  #include <asm/time.h>
>  #include <asm/machdep.h>
> @@ -188,11 +189,17 @@ static int __init corenet_generic_probe(void)
>  	return 0;
>  }
>  
> +static void __init corenet_gen_init(void)
> +{
> +	of_clk_init(NULL);
> +}

Why is this board-specific?

-Scott

^ permalink raw reply

* Re: [PATCH 0/2] fix a kernel panic on fsl corenet board when CONFIG_CLK_PPC_CORENET is enabled
From: Kevin Hao @ 2014-10-16 22:31 UTC (permalink / raw)
  To: Scott Wood; +Cc: Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <1413496162.7417.9.camel@aoeu.buserror.net>

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

On Thu, Oct 16, 2014 at 11:49:22PM +0200, Scott Wood wrote:
> On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> > Hi,
> > 
> > This tries to fix a kernel panic introduced by commit da788acb2838
> > ("clk: ppc-corenet: Fix Section mismatch warning").
> 
> That patch is just wrong and should be reverted, separately from any new
> attempt to fix the section mismatch warning.

OK, I will make a patch to revert that first.

Thanks,
Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply

* Re: [PATCH 1/2] powerpc: move ppc_init() to common place
From: Kevin Hao @ 2014-10-16 22:34 UTC (permalink / raw)
  To: Scott Wood; +Cc: Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <1413496486.7417.11.camel@aoeu.buserror.net>

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

On Thu, Oct 16, 2014 at 11:54:46PM +0200, Scott Wood wrote:
> On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> > So they can be used by ppc64 board. Also remove the unneeded {} to
> > make checkpatch happy.
> > 
> > Signed-off-by: Kevin Hao <haokexin@gmail.com>
> > ---
> >  arch/powerpc/include/asm/machdep.h |  2 +-
> >  arch/powerpc/kernel/setup-common.c | 15 +++++++++++++++
> >  arch/powerpc/kernel/setup_32.c     | 15 ---------------
> >  3 files changed, 16 insertions(+), 16 deletions(-)
> 
> This is unnecessary -- why not just use machine_arch_initcall?

OK, I will drop this patch.

Thanks,
Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply

* Re: [PATCH] drivers/crypto/nx: prevent oops on module exit
From: Michael Ellerman @ 2014-10-16 22:43 UTC (permalink / raw)
  To: Dan Streetman; +Cc: linuxppc-dev, Seth Jennings, Robert Jennings
In-Reply-To: <1413487819-6119-1-git-send-email-ddstreet@ieee.org>

On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
> Check old_devdata->dev in nx-842 driver before accessing it, as
> on systems without any nx-842 hardware, the ->dev will never be
> set.  Currently, the module will cause an oops during unload
> since old_devdata->dev is null.

Hi Dan,

Patch looks reasonable. But I can't merge it, at least not without an ACK:

$ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
Nathan Fontenot <nfont@linux.vnet.ibm.com> (supporter:IBM Power 842 com...)
Marcelo Henrique Cerri <mhcerri@linux.vnet.ibm.com> (supporter:IBM Power in-Nest...)
Fionnuala Gunter <fin@linux.vnet.ibm.com> (supporter:IBM Power in-Nest...)
Herbert Xu <herbert@gondor.apana.org.au> (maintainer:CRYPTO API)
"David S. Miller" <davem@davemloft.net> (maintainer:CRYPTO API)
linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
linux-kernel@vger.kernel.org (open list)


If any of the above is out of date please send me a patch for MAINTAINERS.

cheers

^ permalink raw reply

* Re: [PATCH] drivers/crypto/nx: prevent oops on module exit
From: Benjamin Herrenschmidt @ 2014-10-16 22:52 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linuxppc-dev, Seth Jennings, Dan Streetman, Robert Jennings
In-Reply-To: <1413499435.28062.2.camel@concordia>

On Fri, 2014-10-17 at 09:43 +1100, Michael Ellerman wrote:
> On Thu, 2014-10-16 at 15:30 -0400, Dan Streetman wrote:
> > Check old_devdata->dev in nx-842 driver before accessing it, as
> > on systems without any nx-842 hardware, the ->dev will never be
> > set.  Currently, the module will cause an oops during unload
> > since old_devdata->dev is null.
> 
> Hi Dan,
> 
> Patch looks reasonable. But I can't merge it, at least not without an ACK:
> 
> $ ./scripts/get_maintainer.pl -f drivers/crypto/nx/
> Nathan Fontenot <nfont@linux.vnet.ibm.com> (supporter:IBM Power 842 com...)
> Marcelo Henrique Cerri <mhcerri@linux.vnet.ibm.com> (supporter:IBM Power in-Nest...)
> Fionnuala Gunter <fin@linux.vnet.ibm.com> (supporter:IBM Power in-Nest...)
> Herbert Xu <herbert@gondor.apana.org.au> (maintainer:CRYPTO API)
> "David S. Miller" <davem@davemloft.net> (maintainer:CRYPTO API)
> linux-crypto@vger.kernel.org (open list:IBM Power in-Nest...)
> linux-kernel@vger.kernel.org (open list)
> 
> 
> If any of the above is out of date please send me a patch for MAINTAINERS.

I think Dan now owns that driver, Dan, please confirm.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 2/2] clk: ppc-corenet: don't use platform_driver to init the clock device
From: Kevin Hao @ 2014-10-16 22:55 UTC (permalink / raw)
  To: Scott Wood; +Cc: Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <1413496523.7417.12.camel@aoeu.buserror.net>

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

On Thu, Oct 16, 2014 at 11:55:23PM +0200, Scott Wood wrote:
> On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> > diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
> > index e56b89a792ed..7677cfecb787 100644
> > --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> > +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> > @@ -16,6 +16,7 @@
> >  #include <linux/kdev_t.h>
> >  #include <linux/delay.h>
> >  #include <linux/interrupt.h>
> > +#include <linux/clk-provider.h>
> >  
> >  #include <asm/time.h>
> >  #include <asm/machdep.h>
> > @@ -188,11 +189,17 @@ static int __init corenet_generic_probe(void)
> >  	return 0;
> >  }
> >  
> > +static void __init corenet_gen_init(void)
> > +{
> > +	of_clk_init(NULL);
> > +}
> 
> Why is this board-specific?

I have thought about to put it in a more common place such as time_init(),
but this will be in conflict with mpc512x board. How about add an
arch_initcall(mpc85xx_clk_init) in arch/powerpc/platforms/85xx/common.c?

Thanks,
Kevin

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply

* Re: [PATCH v3 22/27] s390/MSI: Use MSI chip framework to configure MSI/MSI-X irq
From: Yijing Wang @ 2014-10-17  1:04 UTC (permalink / raw)
  To: Sebastian Ott
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, Thierry Reding,
	sparclinux, linux-arch, linux-s390, Russell King, Joerg Roedel,
	x86, xen-devel, arnab.basu, Liviu Dudau, Arnd Bergmann,
	Konrad Rzeszutek Wilk, Chris Metcalf, Bjorn Helgaas,
	Thomas Gleixner, linux-arm-kernel, Thomas Petazzoni, Xinwei Hu,
	Tony Luck, Sergei Shtylyov, linux-kernel, Ralf Baechle, iommu,
	David Vrabel, Wuyun, linuxppc-dev, David S. Miller, Lucas Stach
In-Reply-To: <alpine.LFD.2.11.1410161411340.1575@denkbrett>

On 2014/10/16 20:13, Sebastian Ott wrote:
> On Wed, 15 Oct 2014, Yijing Wang wrote:
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>> Hi Sebastian,
>>    I dropped the Acked-by , because this version has a
>> lot changes compared to last. So, I guess you may want to check it again.
> 
> I did and I agree with that one too.

Thanks very much!

Thanks!
Yijing.

> 
> Regards,
> Sebastian
> 
>> ---
>>  arch/s390/include/asm/pci.h |    9 +++++++++
>>  arch/s390/pci/pci.c         |   12 ++++++++++--
>>  2 files changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
>> index c030900..4d41f08 100644
>> --- a/arch/s390/include/asm/pci.h
>> +++ b/arch/s390/include/asm/pci.h
>> @@ -88,6 +88,8 @@ struct zpci_dev {
>>  	u32 uid;			/* user defined id */
>>  	u8 util_str[CLP_UTIL_STR_LEN];	/* utility string */
>>
>> +	struct msi_chip *msi_chip;
>> +
>>  	/* IRQ stuff */
>>  	u64		msi_addr;	/* MSI address */
>>  	struct airq_iv *aibv;		/* adapter interrupt bit vector */
>> @@ -121,6 +123,13 @@ struct zpci_dev {
>>  	struct dentry	*debugfs_perf;
>>  };
>>
>> +static inline struct msi_chip *pci_msi_chip(struct pci_bus *bus)
>> +{
>> +	struct zpci_dev *zpci = bus->sysdata;
>> +
>> +	return zpci->msi_chip;
>> +}
>> +
>>  static inline bool zdev_enabled(struct zpci_dev *zdev)
>>  {
>>  	return (zdev->fh & (1UL << 31)) ? true : false;
>> diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
>> index 552b990..bf6732f 100644
>> --- a/arch/s390/pci/pci.c
>> +++ b/arch/s390/pci/pci.c
>> @@ -358,7 +358,8 @@ static void zpci_irq_handler(struct airq_struct *airq)
>>  	}
>>  }
>>
>> -int arch_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
>> +static int zpci_setup_msi_irqs(struct msi_chip *chip,
>> +		struct pci_dev *pdev, int nvec, int type)
>>  {
>>  	struct zpci_dev *zdev = get_zdev(pdev);
>>  	unsigned int hwirq, msi_vecs;
>> @@ -434,7 +435,8 @@ out:
>>  	return rc;
>>  }
>>
>> -void arch_teardown_msi_irqs(struct pci_dev *pdev)
>> +static void zpci_teardown_msi_irqs(struct msi_chip *chip,
>> +		struct pci_dev *pdev)
>>  {
>>  	struct zpci_dev *zdev = get_zdev(pdev);
>>  	struct msi_desc *msi;
>> @@ -464,6 +466,11 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
>>  	airq_iv_free_bit(zpci_aisb_iv, zdev->aisb);
>>  }
>>
>> +static struct msi_chip zpci_msi_chip = {
>> +	.setup_irqs = zpci_setup_msi_irqs,
>> +	.teardown_irqs = zpci_teardown_msi_irqs,
>> +};
>> +
>>  static void zpci_map_resources(struct zpci_dev *zdev)
>>  {
>>  	struct pci_dev *pdev = zdev->pdev;
>> @@ -749,6 +756,7 @@ static int zpci_scan_bus(struct zpci_dev *zdev)
>>  	if (ret)
>>  		return ret;
>>
>> +	zdev->msi_chip = &zpci_msi_chip;
>>  	zdev->bus = pci_scan_root_bus(NULL, ZPCI_BUS_NR, &pci_root_ops,
>>  				      zdev, &resources);
>>  	if (!zdev->bus) {
>> -- 
>> 1.7.1
>>
>>
> 
> 
> .
> 


-- 
Thanks!
Yijing

^ permalink raw reply

* RE: [PATCH v3] dmaengine: driver support for FSL RaidEngine device.
From: Xuelin Shi @ 2014-10-17  2:13 UTC (permalink / raw)
  To: Dan Williams, Koul, Vinod
  Cc: dmaengine@vger.kernel.org, Harninder Rai, linuxppc-dev,
	andriy.shevchenko@intel.com, Naveen Burmi
In-Reply-To: <CAPcyv4go1ghjD7fiEzwPJmcjRMBv7p0t7Sm9Ki=1Hu-0GKqoCQ@mail.gmail.com>

SGkgRGFuICYgVmlub2QsDQoNCkkgaGF2ZSBzZW50IG91dCB0aGUgdjQgb2YgdGhpcyBwYXRjaCBh
bmQgbm90IHJlY2VpdmVkIGFueSBmdXJ0aGVyIGZlZWRiYWNrIHlldC4NCg0KVGhpcyBwYXRjaCBs
b29rcyBydWxlZCBvdXQgZnJvbSB0aGUgcGF0Y2h3b3JrLiBodHRwczovL3BhdGNod29yay5rZXJu
ZWwub3JnL3Byb2plY3QvbGludXgtZG1hZW5naW5lL2xpc3QvP3BhZ2U9Mg0KDQpTbyBkbyB5b3Ug
a25vdyB3aGF0IGhhcHBlbmVkIHRvIHRoaXMgcGF0Y2g/DQoNClRoYW5rcywNClh1ZWxpbiBTaGkN
Cg0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogU2hpIFh1ZWxpbi1CMjkyMzcg
DQpTZW50OiAyMDE0xOo01MIxNcjVIDExOjA4DQpUbzogJ0RhbiBXaWxsaWFtcycNCkNjOiBLb3Vs
LCBWaW5vZDsgYW5kcml5LnNoZXZjaGVua29AaW50ZWwuY29tOyBkbWFlbmdpbmVAdmdlci5rZXJu
ZWwub3JnOyBsaW51eHBwYy1kZXY7IFJhaSBIYXJuaW5kZXItQjAxMDQ0OyBCdXJtaSBOYXZlZW4t
QjE2NTAyDQpTdWJqZWN0OiBSRTogW1BBVENIIHYzXSBkbWFlbmdpbmU6IGRyaXZlciBzdXBwb3J0
IGZvciBGU0wgUmFpZEVuZ2luZSBkZXZpY2UuDQoNClllcywgImRlcGVuZCBvbiAhQVNZTkNfVFhf
Q0hBTk5FTF9TV0lUQ0giIGlzIGJldHRlciBzaW5jZSBmc2xkbWEgc2VsZWN0cyB0aGlzIGNvbmRp
dGlvbi4NCg0KVGhhbmtzLA0KWHVlbGluIFNoaQ0KDQotLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0t
LQ0KRnJvbTogRGFuIFdpbGxpYW1zIFttYWlsdG86ZGFuLmoud2lsbGlhbXNAaW50ZWwuY29tXQ0K
U2VudDogMjAxNMTqNNTCMTXI1SA4OjMwDQpUbzogU2hpIFh1ZWxpbi1CMjkyMzcNCkNjOiBLb3Vs
LCBWaW5vZDsgYW5kcml5LnNoZXZjaGVua29AaW50ZWwuY29tOyBkbWFlbmdpbmVAdmdlci5rZXJu
ZWwub3JnOyBsaW51eHBwYy1kZXY7IFJhaSBIYXJuaW5kZXItQjAxMDQ0OyBCdXJtaSBOYXZlZW4t
QjE2NTAyDQpTdWJqZWN0OiBSZTogW1BBVENIIHYzXSBkbWFlbmdpbmU6IGRyaXZlciBzdXBwb3J0
IGZvciBGU0wgUmFpZEVuZ2luZSBkZXZpY2UuDQoNCk9uIFN1biwgQXByIDEzLCAyMDE0IGF0IDc6
NDggUE0sIFh1ZWxpbiBTaGkgPHh1ZWxpbi5zaGlAZnJlZXNjYWxlLmNvbT4gd3JvdGU6DQo+IEhp
IERhbiwNCj4NCj4gZnNsIGRtYSBkZXZpY2UgYW5kIGZzbCByYWlkIGRldmljZSBhcmUgdHdvIGRp
ZmZlcmVuY3QgZGV2aWNlcyB0aGF0IA0KPiBib3RoIHByb3ZpZGUgYXN5bmNfbWVtY3B5IGNhcGFi
aWxpdHksIHNvIEkgdXNlICFGU0xfRE1BIHRvIGRpc2FibGUgdGhlIGZzbCBkbWEgZGV2aWNlLg0K
Pg0KPiBUaGF0J3MgdG8gc2F5LCBlaXRoZXIgc2VsZWN0IGZzbGRtYSBkZXZpY2UsIGVpdGhlciBm
c2wgcmFpZCBkZXZpY2UuDQo+DQoNClJpZ2h0LCBidXQgdGhhdCdzIG5vdCB3aGF0IHlvdXIgcHJv
cG9zZWQgS2NvbmZpZyBkZXBlbmRlbmN5IGxpbmUgZG9lcy4NCg0KWW91IHdhbnQgc29tZXRoaW5n
IGxpa2UgImRlcGVuZHMgb24gRlNMX1NPQyAmJiAhKEZTTF9ETUEgfHwgRlNMX0RNQT1tKSINCg0K
SG93ZXZlciwgdGhlIG1vcmUgcHJvYmxlbWF0aWMgb3B0aW9uIGlzIEFTWU5DX1RYX0NIQU5ORUxf
U1dJVENILiAgVGhhdCBvcHRpb24gaXMgcHJvYmxlbWF0aWMgZm9yIFJBSUQsIHNvIEkgcHJvcG9z
ZSAiZGVwZW5kIG9uICFBU1lOQ19UWF9DSEFOTkVMX1NXSVRDSCIgc2luY2UgdGhhdCBhZGRyZXNz
ZXMgYm90aCBwcm9ibGVtcy4NCg0KDQo=

^ permalink raw reply

* [PATCH] cpufreq: qoriq: Make the driver usable on all QorIQ platforms
From: B29983 @ 2014-10-17  3:13 UTC (permalink / raw)
  To: rjw, viresh.kumar; +Cc: Tang Yuantian, linuxppc-dev, linux-kernel, linux-pm

From: Tang Yuantian <Yuantian.Tang@freescale.com>

Freescale introduced new ARM core-based SoCs which support dynamic
frequency switch feature. DFS on new SoCs are compatible with current
PowerPC CoreNet platforms. In order to support those new platforms,
this driver needs to be slightly adjusted. The main changes include:

1. Changed the names of driver and functions in driver.
2. Added two new functions get_cpu_physical_id() and get_bus_freq().
3. Used a new way to get all the CPUs which sharing clock wire.

Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
---
 drivers/cpufreq/Kconfig.arm                        |   8 ++
 drivers/cpufreq/Kconfig.powerpc                    |  11 +-
 drivers/cpufreq/Makefile                           |   2 +-
 .../{ppc-corenet-cpufreq.c => qoriq-cpufreq.c}     | 150 ++++++++++++++-------
 4 files changed, 114 insertions(+), 57 deletions(-)
 rename drivers/cpufreq/{ppc-corenet-cpufreq.c => qoriq-cpufreq.c} (72%)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 83a75dc..1925ae94 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -247,3 +247,11 @@ config ARM_TEGRA_CPUFREQ
 	default y
 	help
 	  This adds the CPUFreq driver support for TEGRA SOCs.
+
+config QORIQ_CPUFREQ
+	tristate "CPU frequency scaling driver for Freescale QorIQ SoCs"
+	depends on OF && COMMON_CLK
+	select CLK_PPC_CORENET
+	help
+	  This adds the CPUFreq driver support for Freescale QorIQ SoCs
+	  which are capable of changing the CPU's frequency dynamically.
diff --git a/drivers/cpufreq/Kconfig.powerpc b/drivers/cpufreq/Kconfig.powerpc
index 72564b7..3a34248 100644
--- a/drivers/cpufreq/Kconfig.powerpc
+++ b/drivers/cpufreq/Kconfig.powerpc
@@ -23,14 +23,13 @@ config CPU_FREQ_MAPLE
 	  This adds support for frequency switching on Maple 970FX
 	  Evaluation Board and compatible boards (IBM JS2x blades).
 
-config PPC_CORENET_CPUFREQ
-	tristate "CPU frequency scaling driver for Freescale E500MC SoCs"
-	depends on PPC_E500MC && OF && COMMON_CLK
+config QORIQ_CPUFREQ
+	tristate "CPU frequency scaling driver for Freescale QorIQ SoCs"
+	depends on OF && COMMON_CLK
 	select CLK_PPC_CORENET
 	help
-	  This adds the CPUFreq driver support for Freescale e500mc,
-	  e5500 and e6500 series SoCs which are capable of changing
-	  the CPU's frequency dynamically.
+	  This adds the CPUFreq driver support for Freescale QorIQ SoCs
+	  which are capable of changing the CPU's frequency dynamically.
 
 config CPU_FREQ_PMAC
 	bool "Support for Apple PowerBooks"
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index 40c53dc..0020049 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -84,7 +84,7 @@ obj-$(CONFIG_CPU_FREQ_CBE)		+= ppc-cbe-cpufreq.o
 ppc-cbe-cpufreq-y			+= ppc_cbe_cpufreq_pervasive.o ppc_cbe_cpufreq.o
 obj-$(CONFIG_CPU_FREQ_CBE_PMI)		+= ppc_cbe_cpufreq_pmi.o
 obj-$(CONFIG_CPU_FREQ_MAPLE)		+= maple-cpufreq.o
-obj-$(CONFIG_PPC_CORENET_CPUFREQ)   += ppc-corenet-cpufreq.o
+obj-$(CONFIG_QORIQ_CPUFREQ)   		+= qoriq-cpufreq.o
 obj-$(CONFIG_CPU_FREQ_PMAC)		+= pmac32-cpufreq.o
 obj-$(CONFIG_CPU_FREQ_PMAC64)		+= pmac64-cpufreq.o
 obj-$(CONFIG_PPC_PASEMI_CPUFREQ)	+= pasemi-cpufreq.o
diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c
similarity index 72%
rename from drivers/cpufreq/ppc-corenet-cpufreq.c
rename to drivers/cpufreq/qoriq-cpufreq.c
index bee5df7..80def0c 100644
--- a/drivers/cpufreq/ppc-corenet-cpufreq.c
+++ b/drivers/cpufreq/qoriq-cpufreq.c
@@ -1,7 +1,7 @@
 /*
  * Copyright 2013 Freescale Semiconductor, Inc.
  *
- * CPU Frequency Scaling driver for Freescale PowerPC corenet SoCs.
+ * CPU Frequency Scaling driver for Freescale QorIQ SoCs.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -20,7 +20,6 @@
 #include <linux/of.h>
 #include <linux/slab.h>
 #include <linux/smp.h>
-#include <sysdev/fsl_soc.h>
 
 /**
  * struct cpu_data - per CPU data struct
@@ -69,9 +68,6 @@ static const u32 *fmask;
 
 static DEFINE_PER_CPU(struct cpu_data *, cpu_data);
 
-/* cpumask in a cluster */
-static DEFINE_PER_CPU(cpumask_var_t, cpu_mask);
-
 #ifndef CONFIG_SMP
 static inline const struct cpumask *cpu_core_mask(int cpu)
 {
@@ -79,6 +75,79 @@ static inline const struct cpumask *cpu_core_mask(int cpu)
 }
 #endif
 
+#if defined(CONFIG_PPC_E500MC)
+static int get_cpu_physical_id(int cpu)
+{
+	return get_hard_smp_processor_id(cpu);
+}
+#elif defined(CONFIG_ARM)
+static int get_cpu_physical_id(int cpu)
+{
+	return topology_core_id(cpu);
+}
+#endif
+
+static u32 get_bus_freq(void)
+{
+	struct device_node *soc;
+	u32 sysfreq;
+
+	soc = of_find_node_by_type(NULL, "soc");
+	if (!soc)
+		return 0;
+
+	if (of_property_read_u32(soc, "bus-frequency", &sysfreq))
+		sysfreq = 0;
+
+	of_node_put(soc);
+
+	return sysfreq;
+}
+
+static struct device_node *cpu_to_clk_node(int cpu)
+{
+	struct device_node *np, *clk_np;
+
+	if (!cpu_present(cpu))
+		return NULL;
+
+	np = of_get_cpu_node(cpu, NULL);
+	if (!np)
+		return NULL;
+
+	clk_np = of_parse_phandle(np, "clocks", 0);
+	if (!clk_np)
+		return NULL;
+
+	of_node_put(np);
+
+	return clk_np;
+}
+
+/* traverse cpu nodes to get cpu mask of sharing clock wire */
+static void set_affected_cpus(struct cpufreq_policy *policy)
+{
+	struct device_node *np, *clk_np;
+	struct cpumask *dstp = policy->cpus;
+	int i;
+
+	np = cpu_to_clk_node(policy->cpu);
+	if (!np)
+		return;
+
+	for_each_present_cpu(i) {
+		clk_np = cpu_to_clk_node(i);
+		if (!clk_np)
+			continue;
+
+		if (clk_np == np)
+			cpumask_set_cpu(i, dstp);
+
+		of_node_put(clk_np);
+	}
+	of_node_put(np);
+}
+
 /* reduce the duplicated frequencies in frequency table */
 static void freq_table_redup(struct cpufreq_frequency_table *freq_table,
 		int count)
@@ -105,6 +174,7 @@ static void freq_table_sort(struct cpufreq_frequency_table *freq_table,
 	int i, j, ind;
 	unsigned int freq, max_freq;
 	struct cpufreq_frequency_table table;
+
 	for (i = 0; i < count - 1; i++) {
 		max_freq = freq_table[i].frequency;
 		ind = i;
@@ -129,7 +199,7 @@ static void freq_table_sort(struct cpufreq_frequency_table *freq_table,
 	}
 }
 
-static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
+static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	struct device_node *np;
 	int i, count, ret;
@@ -145,10 +215,8 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		return -ENODEV;
 
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
-	if (!data) {
-		pr_err("%s: no memory\n", __func__);
+	if (!data)
 		goto err_np;
-	}
 
 	policy->clk = of_clk_get(np, 0);
 	if (IS_ERR(policy->clk)) {
@@ -170,7 +238,7 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	}
 
 	if (fmask)
-		mask = fmask[get_hard_smp_processor_id(cpu)];
+		mask = fmask[get_cpu_physical_id(cpu)];
 	else
 		mask = 0x0;
 
@@ -201,13 +269,13 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
 	data->table = table;
 
 	/* update ->cpus if we have cluster, no harm if not */
-	cpumask_copy(policy->cpus, per_cpu(cpu_mask, cpu));
-	for_each_cpu(i, per_cpu(cpu_mask, cpu))
+	set_affected_cpus(policy);
+	for_each_cpu(i, policy->cpus)
 		per_cpu(cpu_data, i) = data;
 
 	/* Minimum transition latency is 12 platform clocks */
 	u64temp = 12ULL * NSEC_PER_SEC;
-	do_div(u64temp, fsl_get_sys_freq());
+	do_div(u64temp, get_bus_freq());
 	policy->cpuinfo.transition_latency = u64temp + 1;
 
 	of_node_put(np);
@@ -227,7 +295,7 @@ err_np:
 	return -ENODEV;
 }
 
-static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy)
+static int __exit qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
 	struct cpu_data *data = per_cpu(cpu_data, policy->cpu);
 	unsigned int cpu;
@@ -236,13 +304,13 @@ static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 	kfree(data->table);
 	kfree(data);
 
-	for_each_cpu(cpu, per_cpu(cpu_mask, policy->cpu))
+	for_each_cpu(cpu, policy->cpus)
 		per_cpu(cpu_data, cpu) = NULL;
 
 	return 0;
 }
 
-static int corenet_cpufreq_target(struct cpufreq_policy *policy,
+static int qoriq_cpufreq_target(struct cpufreq_policy *policy,
 		unsigned int index)
 {
 	struct clk *parent;
@@ -252,18 +320,18 @@ static int corenet_cpufreq_target(struct cpufreq_policy *policy,
 	return clk_set_parent(policy->clk, parent);
 }
 
-static struct cpufreq_driver ppc_corenet_cpufreq_driver = {
-	.name		= "ppc_cpufreq",
+static struct cpufreq_driver qoriq_cpufreq_driver = {
+	.name		= "qoriq_cpufreq",
 	.flags		= CPUFREQ_CONST_LOOPS,
-	.init		= corenet_cpufreq_cpu_init,
-	.exit		= __exit_p(corenet_cpufreq_cpu_exit),
+	.init		= qoriq_cpufreq_cpu_init,
+	.exit		= __exit_p(qoriq_cpufreq_cpu_exit),
 	.verify		= cpufreq_generic_frequency_table_verify,
-	.target_index	= corenet_cpufreq_target,
+	.target_index	= qoriq_cpufreq_target,
 	.get		= cpufreq_generic_get,
 	.attr		= cpufreq_generic_attr,
 };
 
-static const struct of_device_id node_matches[] __initdata = {
+static const struct of_device_id node_matches[] __initconst = {
 	{ .compatible = "fsl,p2041-clockgen", .data = &sdata[0], },
 	{ .compatible = "fsl,p3041-clockgen", .data = &sdata[0], },
 	{ .compatible = "fsl,p5020-clockgen", .data = &sdata[1], },
@@ -273,61 +341,43 @@ static const struct of_device_id node_matches[] __initdata = {
 	{}
 };
 
-static int __init ppc_corenet_cpufreq_init(void)
+static int __init qoriq_cpufreq_init(void)
 {
 	int ret;
 	struct device_node  *np;
 	const struct of_device_id *match;
 	const struct soc_data *data;
-	unsigned int cpu;
 
 	np = of_find_matching_node(NULL, node_matches);
 	if (!np)
 		return -ENODEV;
 
-	for_each_possible_cpu(cpu) {
-		if (!alloc_cpumask_var(&per_cpu(cpu_mask, cpu), GFP_KERNEL))
-			goto err_mask;
-		cpumask_copy(per_cpu(cpu_mask, cpu), cpu_core_mask(cpu));
-	}
-
 	match = of_match_node(node_matches, np);
 	data = match->data;
 	if (data) {
 		if (data->flag)
 			fmask = data->freq_mask;
-		min_cpufreq = fsl_get_sys_freq();
+		min_cpufreq = get_bus_freq();
 	} else {
-		min_cpufreq = fsl_get_sys_freq() / 2;
+		min_cpufreq = get_bus_freq() / 2;
 	}
 
 	of_node_put(np);
 
-	ret = cpufreq_register_driver(&ppc_corenet_cpufreq_driver);
+	ret = cpufreq_register_driver(&qoriq_cpufreq_driver);
 	if (!ret)
-		pr_info("Freescale PowerPC corenet CPU frequency scaling driver\n");
+		pr_info("Freescale QorIQ CPU frequency scaling driver\n");
 
 	return ret;
-
-err_mask:
-	for_each_possible_cpu(cpu)
-		free_cpumask_var(per_cpu(cpu_mask, cpu));
-
-	return -ENOMEM;
 }
-module_init(ppc_corenet_cpufreq_init);
+module_init(qoriq_cpufreq_init);
 
-static void __exit ppc_corenet_cpufreq_exit(void)
+static void __exit qoriq_cpufreq_exit(void)
 {
-	unsigned int cpu;
-
-	for_each_possible_cpu(cpu)
-		free_cpumask_var(per_cpu(cpu_mask, cpu));
-
-	cpufreq_unregister_driver(&ppc_corenet_cpufreq_driver);
+	cpufreq_unregister_driver(&qoriq_cpufreq_driver);
 }
-module_exit(ppc_corenet_cpufreq_exit);
+module_exit(qoriq_cpufreq_exit);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Tang Yuantian <Yuantian.Tang@freescale.com>");
-MODULE_DESCRIPTION("cpufreq driver for Freescale e500mc series SoCs");
+MODULE_DESCRIPTION("cpufreq driver for Freescale QorIQ series SoCs");
-- 
2.1.0.27.g96db324

^ permalink raw reply related

* Re: [PATCH 1/3] qe-uart: modify qe-uart to adapt both powerpc and arm
From: Scott Wood @ 2014-10-17  4:01 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Scott Wood, Zhao Qiang, linux-serial, R63061,
	linuxppc-dev@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <CAOZdJXUvqzex6oFTEoFRAXUCMfYHZ4GzSESQOvhx_9-vCC_C3Q@mail.gmail.com>

On Mon, 2014-10-13 at 11:30 -0500, Timur Tabi wrote:
> On Fri, Oct 10, 2014 at 1:05 PM, Scott Wood <scottwood@freescale.com> wrote:
> > There are many changes in here that ought to be separate patches with
> > separate justification.
> >
> > Also, some of the QE changes seem to be reasonable cleanup, but not
> > related to making the code work on ARM.
> 
> I agree with Scott.  This patch already makes significant code
> changes, so you should have one patch that just makes the
> out_be32->iowrite32be changes.  Changes to the QE library should NOT
> be in the same patch as changes to ucc_uart.c.
> 
> In addition, changes like this:
> 
> -       iprop = of_get_property(np, "port-number", NULL);
> -       if (!iprop) {
> +       ret = of_property_read_u32_index(np, "port-number", 0, &val);
> +       if (ret) {
> 
> should be changed to remove the OF dependency.  If you're going to
> replace of_get_property, replace it with device_property_read_u32(),
> to remove the OF dependency.
> 
> >> diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
> >> index dff714d..a932f99 100644
> >> --- a/arch/arm/include/asm/delay.h
> >> +++ b/arch/arm/include/asm/delay.h
> >> @@ -57,6 +57,22 @@ extern void __bad_udelay(void);
> >>                       __const_udelay((n) * UDELAY_MULT)) :            \
> >>         __udelay(n))
> >>
> >> +#define spin_event_timeout(condition, timeout, delay)                          \
> >> +({                                                                             \
> >> +     typeof(condition) __ret;                                               \
> >> +     int i = 0;                                                             \
> >> +     while (!(__ret = (condition)) && (i++ < timeout)) {                    \
> >> +             if (delay)                                                     \
> >> +                     udelay(delay);                                         \
> >> +             else                                                           \
> >> +                     cpu_relax();                                           \
> >> +             udelay(1);                                                     \
> >> +     }                                                                      \
> >
> > This will delay too long if "delay" is used.
> 
> Shouldn't ARM have a version of tb_ticks_since() by now?

There's get_cycles(), but it's not clear to me whether loops_per_jiffy
is OK to use with get_cycles() on 32-bit ARM.  Is avoiding the udelay
worth making this non-generic?

> 
> >> +     if (!__ret)                                                            \
> >> +             __ret = (condition);                                           \
> >> +     __ret;                                                                 \
> >
> > Timur, do you remember why that final "if (!__ret) __ret = (condition);"
> > is needed?
> 
>     powerpc: Fix spin_event_timeout() to be robust over context switches
> 
>     Current implementation of spin_event_timeout can be interrupted by an
>     IRQ or context switch after testing the condition, but before checking
>     the timeout.  This can cause the loop to report a timeout when the
>     condition actually became true in the middle.
> 
>     This patch adds one final check of the condition upon exit of the loop
>     if the last test of the condition was still false.

OK, so this shouldn't be needed in the udelay version, since an
interrupt shouldn't cause a significant difference in the timeout count.

-Scott

^ permalink raw reply

* [PATCH V2 1/2] mm: Update generic gup implementation to handle hugepage directory
From: Aneesh Kumar K.V @ 2014-10-17  4:38 UTC (permalink / raw)
  To: akpm, Steve Capper, Andrea Arcangeli, benh, mpe
  Cc: linux-arch, linux-mm, linuxppc-dev, linux-kernel,
	Aneesh Kumar K.V

Update generic gup implementation with powerpc specific details.
On powerpc at pmd level we can have hugepte, normal pmd pointer
or a pointer to the hugepage directory.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
Changes from V1: 
* Folded arm/arm64 related changes into the patch
* Dropped pgd_huge from generic header

 arch/arm/include/asm/pgtable.h   |   2 +
 arch/arm64/include/asm/pgtable.h |   2 +
 include/linux/mm.h               |  26 +++++++++
 mm/gup.c                         | 113 +++++++++++++++++++--------------------
 4 files changed, 84 insertions(+), 59 deletions(-)

diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 90aa4583b308..46f81fbaa4a5 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -181,6 +181,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(addr)	pgd_offset(&init_mm, addr)
 
+#define pgd_huge(pgd)		(0)
+
 #define pmd_none(pmd)		(!pmd_val(pmd))
 #define pmd_present(pmd)	(pmd_val(pmd))
 
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index cefd3e825612..ed8f42497ac4 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -464,6 +464,8 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
 extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
 extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
 
+#define pgd_huge(pgd)		(0)
+
 /*
  * Encode and decode a swap entry:
  *	bits 0-1:	present (must be zero)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 02d11ee7f19d..f97732412cb4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1219,6 +1219,32 @@ long get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
 		    struct vm_area_struct **vmas);
 int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 			struct page **pages);
+
+#ifdef CONFIG_HAVE_GENERIC_RCU_GUP
+#ifndef is_hugepd
+/*
+ * Some architectures support hugepage directory format that is
+ * required to support different hugetlbfs sizes.
+ */
+typedef struct { unsigned long pd; } hugepd_t;
+#define is_hugepd(hugepd) (0)
+#define __hugepd(x) ((hugepd_t) { (x) })
+static inline int gup_hugepd(hugepd_t hugepd, unsigned long addr,
+			     unsigned pdshift, unsigned long end,
+			     int write, struct page **pages, int *nr)
+{
+	return 0;
+}
+#else
+extern int gup_hugepd(hugepd_t hugepd, unsigned long addr,
+		      unsigned pdshift, unsigned long end,
+		      int write, struct page **pages, int *nr);
+#endif
+extern int gup_huge_pte(pte_t orig, pte_t *ptep, unsigned long addr,
+			unsigned long sz, unsigned long end, int write,
+			struct page **pages, int *nr);
+#endif
+
 struct kvec;
 int get_kernel_pages(const struct kvec *iov, int nr_pages, int write,
 			struct page **pages);
diff --git a/mm/gup.c b/mm/gup.c
index cd62c8c90d4a..13c560ef9ddf 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -786,65 +786,31 @@ static int gup_pte_range(pmd_t pmd, unsigned long addr, unsigned long end,
 }
 #endif /* __HAVE_ARCH_PTE_SPECIAL */
 
-static int gup_huge_pmd(pmd_t orig, pmd_t *pmdp, unsigned long addr,
-		unsigned long end, int write, struct page **pages, int *nr)
+int gup_huge_pte(pte_t orig, pte_t *ptep, unsigned long addr,
+		 unsigned long sz, unsigned long end, int write,
+		 struct page **pages, int *nr)
 {
-	struct page *head, *page, *tail;
 	int refs;
+	unsigned long pte_end;
+	struct page *head, *page, *tail;
 
-	if (write && !pmd_write(orig))
-		return 0;
-
-	refs = 0;
-	head = pmd_page(orig);
-	page = head + ((addr & ~PMD_MASK) >> PAGE_SHIFT);
-	tail = page;
-	do {
-		VM_BUG_ON_PAGE(compound_head(page) != head, page);
-		pages[*nr] = page;
-		(*nr)++;
-		page++;
-		refs++;
-	} while (addr += PAGE_SIZE, addr != end);
 
-	if (!page_cache_add_speculative(head, refs)) {
-		*nr -= refs;
+	if (write && !pte_write(orig))
 		return 0;
-	}
 
-	if (unlikely(pmd_val(orig) != pmd_val(*pmdp))) {
-		*nr -= refs;
-		while (refs--)
-			put_page(head);
+	if (!pte_present(orig))
 		return 0;
-	}
 
-	/*
-	 * Any tail pages need their mapcount reference taken before we
-	 * return. (This allows the THP code to bump their ref count when
-	 * they are split into base pages).
-	 */
-	while (refs--) {
-		if (PageTail(tail))
-			get_huge_page_tail(tail);
-		tail++;
-	}
-
-	return 1;
-}
-
-static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr,
-		unsigned long end, int write, struct page **pages, int *nr)
-{
-	struct page *head, *page, *tail;
-	int refs;
+	pte_end = (addr + sz) & ~(sz-1);
+	if (pte_end < end)
+		end = pte_end;
 
-	if (write && !pud_write(orig))
-		return 0;
+	/* hugepages are never "special" */
+	VM_BUG_ON(!pfn_valid(pte_pfn(orig)));
 
 	refs = 0;
-	head = pud_page(orig);
-	page = head + ((addr & ~PUD_MASK) >> PAGE_SHIFT);
+	head = pte_page(orig);
+	page = head + ((addr & (sz-1)) >> PAGE_SHIFT);
 	tail = page;
 	do {
 		VM_BUG_ON_PAGE(compound_head(page) != head, page);
@@ -859,13 +825,18 @@ static int gup_huge_pud(pud_t orig, pud_t *pudp, unsigned long addr,
 		return 0;
 	}
 
-	if (unlikely(pud_val(orig) != pud_val(*pudp))) {
+	if (unlikely(pte_val(orig) != pte_val(*ptep))) {
 		*nr -= refs;
 		while (refs--)
 			put_page(head);
 		return 0;
 	}
 
+	/*
+	 * Any tail pages need their mapcount reference taken before we
+	 * return. (This allows the THP code to bump their ref count when
+	 * they are split into base pages).
+	 */
 	while (refs--) {
 		if (PageTail(tail))
 			get_huge_page_tail(tail);
@@ -898,10 +869,19 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
 			if (pmd_numa(pmd))
 				return 0;
 
-			if (!gup_huge_pmd(pmd, pmdp, addr, next, write,
-				pages, nr))
+			if (!gup_huge_pte(__pte(pmd_val(pmd)), (pte_t *)pmdp,
+					  addr, PMD_SIZE, next,
+					  write, pages, nr))
 				return 0;
 
+		} else if (unlikely(is_hugepd(__hugepd(pmd_val(pmd))))) {
+			/*
+			 * architecture have different format for hugetlbfs
+			 * pmd format and THP pmd format
+			 */
+			if (!gup_hugepd(__hugepd(pmd_val(pmd)), addr, PMD_SHIFT,
+					next, write, pages, nr))
+				return 0;
 		} else if (!gup_pte_range(pmd, addr, next, write, pages, nr))
 				return 0;
 	} while (pmdp++, addr = next, addr != end);
@@ -909,22 +889,27 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
 	return 1;
 }
 
-static int gup_pud_range(pgd_t *pgdp, unsigned long addr, unsigned long end,
+static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
 		int write, struct page **pages, int *nr)
 {
 	unsigned long next;
 	pud_t *pudp;
 
-	pudp = pud_offset(pgdp, addr);
+	pudp = pud_offset(&pgd, addr);
 	do {
 		pud_t pud = ACCESS_ONCE(*pudp);
 
 		next = pud_addr_end(addr, end);
 		if (pud_none(pud))
 			return 0;
-		if (pud_huge(pud)) {
-			if (!gup_huge_pud(pud, pudp, addr, next, write,
-					pages, nr))
+		if (unlikely(pud_huge(pud))) {
+			if (!gup_huge_pte(__pte(pud_val(pud)), (pte_t *)pudp,
+					  addr, PUD_SIZE, next,
+					  write, pages, nr))
+				return 0;
+		} else if (unlikely(is_hugepd(__hugepd(pud_val(pud))))) {
+			if (!gup_hugepd(__hugepd(pud_val(pud)), addr, PUD_SHIFT,
+					next, write, pages, nr))
 				return 0;
 		} else if (!gup_pmd_range(pud, addr, next, write, pages, nr))
 			return 0;
@@ -970,10 +955,21 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
 	local_irq_save(flags);
 	pgdp = pgd_offset(mm, addr);
 	do {
+		pgd_t pgd = ACCESS_ONCE(*pgdp);
+
 		next = pgd_addr_end(addr, end);
-		if (pgd_none(*pgdp))
+		if (pgd_none(pgd))
 			break;
-		else if (!gup_pud_range(pgdp, addr, next, write, pages, &nr))
+		if (unlikely(pgd_huge(pgd))) {
+			if (!gup_huge_pte(__pte(pgd_val(pgd)), (pte_t *)pgdp,
+					  addr, PGDIR_SIZE, next,
+					  write, pages, &nr))
+				break;
+		} else if (unlikely(is_hugepd(__hugepd(pgd_val(pgd))))) {
+			if (!gup_hugepd(__hugepd(pgd_val(pgd)), addr, PGDIR_SHIFT,
+					next, write, pages, &nr))
+				break;
+		} else if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
 			break;
 	} while (pgdp++, addr = next, addr != end);
 	local_irq_restore(flags);
@@ -1028,5 +1024,4 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
 
 	return ret;
 }
-
 #endif /* CONFIG_HAVE_GENERIC_RCU_GUP */
-- 
1.9.1

^ permalink raw reply related

* [PATCH V2 2/2] arch/powerpc: Switch to generic RCU get_user_pages_fast
From: Aneesh Kumar K.V @ 2014-10-17  4:38 UTC (permalink / raw)
  To: akpm, Steve Capper, Andrea Arcangeli, benh, mpe
  Cc: linux-arch, linux-mm, linuxppc-dev, linux-kernel,
	Aneesh Kumar K.V
In-Reply-To: <1413520687-31729-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

This patch switch the ppc arch to use the generic RCU based
gup implementation.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
Changes from V1:
* added pgd_huge definition back

 arch/powerpc/Kconfig                     |   1 +
 arch/powerpc/include/asm/hugetlb.h       |   8 +-
 arch/powerpc/include/asm/page.h          |   3 +-
 arch/powerpc/include/asm/pgtable-ppc64.h |   1 -
 arch/powerpc/include/asm/pgtable.h       |   5 -
 arch/powerpc/mm/Makefile                 |   2 +-
 arch/powerpc/mm/gup.c                    | 235 -------------------------------
 arch/powerpc/mm/hugetlbpage.c            |  27 ++--
 8 files changed, 21 insertions(+), 261 deletions(-)
 delete mode 100644 arch/powerpc/mm/gup.c

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 88eace4e28c3..7af887dc6aed 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -148,6 +148,7 @@ config PPC
 	select HAVE_ARCH_AUDITSYSCALL
 	select ARCH_SUPPORTS_ATOMIC_RMW
 	select DCACHE_WORD_ACCESS if PPC64 && CPU_LITTLE_ENDIAN
+	select HAVE_GENERIC_RCU_GUP
 
 config GENERIC_CSUM
 	def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 623f2971ce0e..7855cce9c969 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -48,7 +48,7 @@ static inline unsigned int hugepd_shift(hugepd_t hpd)
 #endif /* CONFIG_PPC_BOOK3S_64 */
 
 
-static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr,
+static inline pte_t *hugepte_offset(hugepd_t hpd, unsigned long addr,
 				    unsigned pdshift)
 {
 	/*
@@ -58,9 +58,9 @@ static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr,
 	 */
 	unsigned long idx = 0;
 
-	pte_t *dir = hugepd_page(*hpdp);
+	pte_t *dir = hugepd_page(hpd);
 #ifndef CONFIG_PPC_FSL_BOOK3E
-	idx = (addr & ((1UL << pdshift) - 1)) >> hugepd_shift(*hpdp);
+	idx = (addr & ((1UL << pdshift) - 1)) >> hugepd_shift(hpd);
 #endif
 
 	return dir + idx;
@@ -193,7 +193,7 @@ static inline void flush_hugetlb_page(struct vm_area_struct *vma,
 }
 
 #define hugepd_shift(x) 0
-static inline pte_t *hugepte_offset(hugepd_t *hpdp, unsigned long addr,
+static inline pte_t *hugepte_offset(hugepd_t hpd, unsigned long addr,
 				    unsigned pdshift)
 {
 	return 0;
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 26fe1ae15212..aeca81947dc6 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -379,12 +379,13 @@ static inline int hugepd_ok(hugepd_t hpd)
 }
 #endif
 
-#define is_hugepd(pdep)               (hugepd_ok(*((hugepd_t *)(pdep))))
+#define is_hugepd(hpd)               (hugepd_ok(hpd))
 int pgd_huge(pgd_t pgd);
 #else /* CONFIG_HUGETLB_PAGE */
 #define is_hugepd(pdep)			0
 #define pgd_huge(pgd)			0
 #endif /* CONFIG_HUGETLB_PAGE */
+#define __hugepd(x) ((hugepd_t) { (x) })
 
 struct page;
 extern void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index ae153c40ab7c..29c36242cc6a 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -575,6 +575,5 @@ static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
 	 */
 	return true;
 }
-
 #endif /* __ASSEMBLY__ */
 #endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 316f9a5da173..4a67c1ddb91b 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -274,11 +274,6 @@ extern void paging_init(void);
  */
 extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
 
-extern int gup_hugepd(hugepd_t *hugepd, unsigned pdshift, unsigned long addr,
-		      unsigned long end, int write, struct page **pages, int *nr);
-
-extern int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr,
-		       unsigned long end, int write, struct page **pages, int *nr);
 #ifndef CONFIG_TRANSPARENT_HUGEPAGE
 #define pmd_large(pmd)		0
 #define has_transparent_hugepage() 0
diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
index 325e861616a1..438dcd3fd0d1 100644
--- a/arch/powerpc/mm/Makefile
+++ b/arch/powerpc/mm/Makefile
@@ -6,7 +6,7 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 
 ccflags-$(CONFIG_PPC64)	:= $(NO_MINIMAL_TOC)
 
-obj-y				:= fault.o mem.o pgtable.o gup.o mmap.o \
+obj-y				:= fault.o mem.o pgtable.o mmap.o \
 				   init_$(CONFIG_WORD_SIZE).o \
 				   pgtable_$(CONFIG_WORD_SIZE).o
 obj-$(CONFIG_PPC_MMU_NOHASH)	+= mmu_context_nohash.o tlb_nohash.o \
diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c
deleted file mode 100644
index d8746684f606..000000000000
--- a/arch/powerpc/mm/gup.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Lockless get_user_pages_fast for powerpc
- *
- * Copyright (C) 2008 Nick Piggin
- * Copyright (C) 2008 Novell Inc.
- */
-#undef DEBUG
-
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/hugetlb.h>
-#include <linux/vmstat.h>
-#include <linux/pagemap.h>
-#include <linux/rwsem.h>
-#include <asm/pgtable.h>
-
-#ifdef __HAVE_ARCH_PTE_SPECIAL
-
-/*
- * The performance critical leaf functions are made noinline otherwise gcc
- * inlines everything into a single function which results in too much
- * register pressure.
- */
-static noinline int gup_pte_range(pmd_t pmd, unsigned long addr,
-		unsigned long end, int write, struct page **pages, int *nr)
-{
-	unsigned long mask, result;
-	pte_t *ptep;
-
-	result = _PAGE_PRESENT|_PAGE_USER;
-	if (write)
-		result |= _PAGE_RW;
-	mask = result | _PAGE_SPECIAL;
-
-	ptep = pte_offset_kernel(&pmd, addr);
-	do {
-		pte_t pte = ACCESS_ONCE(*ptep);
-		struct page *page;
-		/*
-		 * Similar to the PMD case, NUMA hinting must take slow path
-		 */
-		if (pte_numa(pte))
-			return 0;
-
-		if ((pte_val(pte) & mask) != result)
-			return 0;
-		VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
-		page = pte_page(pte);
-		if (!page_cache_get_speculative(page))
-			return 0;
-		if (unlikely(pte_val(pte) != pte_val(*ptep))) {
-			put_page(page);
-			return 0;
-		}
-		pages[*nr] = page;
-		(*nr)++;
-
-	} while (ptep++, addr += PAGE_SIZE, addr != end);
-
-	return 1;
-}
-
-static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
-		int write, struct page **pages, int *nr)
-{
-	unsigned long next;
-	pmd_t *pmdp;
-
-	pmdp = pmd_offset(&pud, addr);
-	do {
-		pmd_t pmd = ACCESS_ONCE(*pmdp);
-
-		next = pmd_addr_end(addr, end);
-		/*
-		 * If we find a splitting transparent hugepage we
-		 * return zero. That will result in taking the slow
-		 * path which will call wait_split_huge_page()
-		 * if the pmd is still in splitting state
-		 */
-		if (pmd_none(pmd) || pmd_trans_splitting(pmd))
-			return 0;
-		if (pmd_huge(pmd) || pmd_large(pmd)) {
-			/*
-			 * NUMA hinting faults need to be handled in the GUP
-			 * slowpath for accounting purposes and so that they
-			 * can be serialised against THP migration.
-			 */
-			if (pmd_numa(pmd))
-				return 0;
-
-			if (!gup_hugepte((pte_t *)pmdp, PMD_SIZE, addr, next,
-					 write, pages, nr))
-				return 0;
-		} else if (is_hugepd(pmdp)) {
-			if (!gup_hugepd((hugepd_t *)pmdp, PMD_SHIFT,
-					addr, next, write, pages, nr))
-				return 0;
-		} else if (!gup_pte_range(pmd, addr, next, write, pages, nr))
-			return 0;
-	} while (pmdp++, addr = next, addr != end);
-
-	return 1;
-}
-
-static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
-		int write, struct page **pages, int *nr)
-{
-	unsigned long next;
-	pud_t *pudp;
-
-	pudp = pud_offset(&pgd, addr);
-	do {
-		pud_t pud = ACCESS_ONCE(*pudp);
-
-		next = pud_addr_end(addr, end);
-		if (pud_none(pud))
-			return 0;
-		if (pud_huge(pud)) {
-			if (!gup_hugepte((pte_t *)pudp, PUD_SIZE, addr, next,
-					 write, pages, nr))
-				return 0;
-		} else if (is_hugepd(pudp)) {
-			if (!gup_hugepd((hugepd_t *)pudp, PUD_SHIFT,
-					addr, next, write, pages, nr))
-				return 0;
-		} else if (!gup_pmd_range(pud, addr, next, write, pages, nr))
-			return 0;
-	} while (pudp++, addr = next, addr != end);
-
-	return 1;
-}
-
-int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
-			  struct page **pages)
-{
-	struct mm_struct *mm = current->mm;
-	unsigned long addr, len, end;
-	unsigned long next;
-	unsigned long flags;
-	pgd_t *pgdp;
-	int nr = 0;
-
-	pr_devel("%s(%lx,%x,%s)\n", __func__, start, nr_pages, write ? "write" : "read");
-
-	start &= PAGE_MASK;
-	addr = start;
-	len = (unsigned long) nr_pages << PAGE_SHIFT;
-	end = start + len;
-
-	if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ,
-					start, len)))
-		return 0;
-
-	pr_devel("  aligned: %lx .. %lx\n", start, end);
-
-	/*
-	 * XXX: batch / limit 'nr', to avoid large irq off latency
-	 * needs some instrumenting to determine the common sizes used by
-	 * important workloads (eg. DB2), and whether limiting the batch size
-	 * will decrease performance.
-	 *
-	 * It seems like we're in the clear for the moment. Direct-IO is
-	 * the main guy that batches up lots of get_user_pages, and even
-	 * they are limited to 64-at-a-time which is not so many.
-	 */
-	/*
-	 * This doesn't prevent pagetable teardown, but does prevent
-	 * the pagetables from being freed on powerpc.
-	 *
-	 * So long as we atomically load page table pointers versus teardown,
-	 * we can follow the address down to the the page and take a ref on it.
-	 */
-	local_irq_save(flags);
-
-	pgdp = pgd_offset(mm, addr);
-	do {
-		pgd_t pgd = ACCESS_ONCE(*pgdp);
-
-		pr_devel("  %016lx: normal pgd %p\n", addr,
-			 (void *)pgd_val(pgd));
-		next = pgd_addr_end(addr, end);
-		if (pgd_none(pgd))
-			break;
-		if (pgd_huge(pgd)) {
-			if (!gup_hugepte((pte_t *)pgdp, PGDIR_SIZE, addr, next,
-					 write, pages, &nr))
-				break;
-		} else if (is_hugepd(pgdp)) {
-			if (!gup_hugepd((hugepd_t *)pgdp, PGDIR_SHIFT,
-					addr, next, write, pages, &nr))
-				break;
-		} else if (!gup_pud_range(pgd, addr, next, write, pages, &nr))
-			break;
-	} while (pgdp++, addr = next, addr != end);
-
-	local_irq_restore(flags);
-
-	return nr;
-}
-
-int get_user_pages_fast(unsigned long start, int nr_pages, int write,
-			struct page **pages)
-{
-	struct mm_struct *mm = current->mm;
-	int nr, ret;
-
-	start &= PAGE_MASK;
-	nr = __get_user_pages_fast(start, nr_pages, write, pages);
-	ret = nr;
-
-	if (nr < nr_pages) {
-		pr_devel("  slow path ! nr = %d\n", nr);
-
-		/* Try to get the remaining pages with get_user_pages */
-		start += nr << PAGE_SHIFT;
-		pages += nr;
-
-		down_read(&mm->mmap_sem);
-		ret = get_user_pages(current, mm, start,
-				     nr_pages - nr, write, 0, pages, NULL);
-		up_read(&mm->mmap_sem);
-
-		/* Have to be a bit careful with return values */
-		if (nr > 0) {
-			if (ret < 0)
-				ret = nr;
-			else
-				ret += nr;
-		}
-	}
-
-	return ret;
-}
-
-#endif /* __HAVE_ARCH_PTE_SPECIAL */
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 7e70ae968e5f..b8d228ca50fd 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -230,7 +230,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
 	if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr, pdshift, pshift))
 		return NULL;
 
-	return hugepte_offset(hpdp, addr, pdshift);
+	return hugepte_offset(*hpdp, addr, pdshift);
 }
 
 #else
@@ -270,7 +270,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz
 	if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr, pdshift, pshift))
 		return NULL;
 
-	return hugepte_offset(hpdp, addr, pdshift);
+	return hugepte_offset(*hpdp, addr, pdshift);
 }
 #endif
 
@@ -538,7 +538,7 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
 	do {
 		pmd = pmd_offset(pud, addr);
 		next = pmd_addr_end(addr, end);
-		if (!is_hugepd(pmd)) {
+		if (!is_hugepd(__hugepd(pmd_val(*pmd)))) {
 			/*
 			 * if it is not hugepd pointer, we should already find
 			 * it cleared.
@@ -587,7 +587,7 @@ static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
 	do {
 		pud = pud_offset(pgd, addr);
 		next = pud_addr_end(addr, end);
-		if (!is_hugepd(pud)) {
+		if (!is_hugepd(__hugepd(pud_val(*pud)))) {
 			if (pud_none_or_clear_bad(pud))
 				continue;
 			hugetlb_free_pmd_range(tlb, pud, addr, next, floor,
@@ -653,7 +653,7 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb,
 	do {
 		next = pgd_addr_end(addr, end);
 		pgd = pgd_offset(tlb->mm, addr);
-		if (!is_hugepd(pgd)) {
+		if (!is_hugepd(__hugepd(pgd_val(*pgd)))) {
 			if (pgd_none_or_clear_bad(pgd))
 				continue;
 			hugetlb_free_pud_range(tlb, pgd, addr, next, floor, ceiling);
@@ -713,18 +713,17 @@ static unsigned long hugepte_addr_end(unsigned long addr, unsigned long end,
 	return (__boundary - 1 < end - 1) ? __boundary : end;
 }
 
-int gup_hugepd(hugepd_t *hugepd, unsigned pdshift,
-	       unsigned long addr, unsigned long end,
-	       int write, struct page **pages, int *nr)
+int gup_hugepd(hugepd_t hugepd, unsigned long addr, unsigned pdshift,
+	       unsigned long end, int write, struct page **pages, int *nr)
 {
 	pte_t *ptep;
-	unsigned long sz = 1UL << hugepd_shift(*hugepd);
+	unsigned long sz = 1UL << hugepd_shift(hugepd);
 	unsigned long next;
 
 	ptep = hugepte_offset(hugepd, addr, pdshift);
 	do {
 		next = hugepte_addr_end(addr, end, sz);
-		if (!gup_hugepte(ptep, sz, addr, end, write, pages, nr))
+		if (!gup_huge_pte(*ptep, ptep, addr, sz, end, write, pages, nr))
 			return 0;
 	} while (ptep++, addr = next, addr != end);
 
@@ -961,7 +960,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
 	else if (pgd_huge(pgd)) {
 		ret_pte = (pte_t *) pgdp;
 		goto out;
-	} else if (is_hugepd(&pgd))
+	} else if (is_hugepd(__hugepd(pgd_val(pgd))))
 		hpdp = (hugepd_t *)&pgd;
 	else {
 		/*
@@ -978,7 +977,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
 		else if (pud_huge(pud)) {
 			ret_pte = (pte_t *) pudp;
 			goto out;
-		} else if (is_hugepd(&pud))
+		} else if (is_hugepd(__hugepd(pud_val(pud))))
 			hpdp = (hugepd_t *)&pud;
 		else {
 			pdshift = PMD_SHIFT;
@@ -999,7 +998,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
 			if (pmd_huge(pmd) || pmd_large(pmd)) {
 				ret_pte = (pte_t *) pmdp;
 				goto out;
-			} else if (is_hugepd(&pmd))
+			} else if (is_hugepd(__hugepd(pmd_val(pmd))))
 				hpdp = (hugepd_t *)&pmd;
 			else
 				return pte_offset_kernel(&pmd, ea);
@@ -1008,7 +1007,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
 	if (!hpdp)
 		return NULL;
 
-	ret_pte = hugepte_offset(hpdp, ea, pdshift);
+	ret_pte = hugepte_offset(*hpdp, ea, pdshift);
 	pdshift = hugepd_shift(*hpdp);
 out:
 	if (shift)
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH 2/2] clk: ppc-corenet: don't use platform_driver to init the clock device
From: Scott Wood @ 2014-10-17  5:58 UTC (permalink / raw)
  To: Kevin Hao; +Cc: Gerhard Sittig, Jingchang Lu, linuxppc-dev, Mike Turquette
In-Reply-To: <20141016225552.GC9593@pek-khao-d1.corp.ad.wrs.com>

On Fri, 2014-10-17 at 06:55 +0800, Kevin Hao wrote:
> On Thu, Oct 16, 2014 at 11:55:23PM +0200, Scott Wood wrote:
> > On Thu, 2014-10-16 at 19:18 +0800, Kevin Hao wrote:
> > > diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
> > > index e56b89a792ed..7677cfecb787 100644
> > > --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> > > +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> > > @@ -16,6 +16,7 @@
> > >  #include <linux/kdev_t.h>
> > >  #include <linux/delay.h>
> > >  #include <linux/interrupt.h>
> > > +#include <linux/clk-provider.h>
> > >  
> > >  #include <asm/time.h>
> > >  #include <asm/machdep.h>
> > > @@ -188,11 +189,17 @@ static int __init corenet_generic_probe(void)
> > >  	return 0;
> > >  }
> > >  
> > > +static void __init corenet_gen_init(void)
> > > +{
> > > +	of_clk_init(NULL);
> > > +}
> > 
> > Why is this board-specific?
> 
> I have thought about to put it in a more common place such as time_init(),
> but this will be in conflict with mpc512x board. How about add an
> arch_initcall(mpc85xx_clk_init) in arch/powerpc/platforms/85xx/common.c?

Gerhard, does 512x really require of_clk_init() to be called at that
specific time, or can it be replaced by a common of_clk_init()?

-Scott

^ permalink raw reply

* Re: [PATCH v3 21/27] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
From: Michael Ellerman @ 2014-10-17  7:23 UTC (permalink / raw)
  To: Yijing Wang
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, Thierry Reding,
	sparclinux, linux-arch, linux-s390, Russell King, Joerg Roedel,
	x86, Sebastian Ott, xen-devel, arnab.basu, Liviu Dudau,
	Arnd Bergmann, Konrad Rzeszutek Wilk, Chris Metcalf,
	Bjorn Helgaas, Thomas Gleixner, linux-arm-kernel,
	Thomas Petazzoni, Xinwei Hu, Tony Luck, Sergei Shtylyov,
	linux-kernel, Ralf Baechle, iommu, David Vrabel, Wuyun,
	linuxppc-dev, David S. Miller, Lucas Stach
In-Reply-To: <1413342435-7876-22-git-send-email-wangyijing@huawei.com>

On Wed, 2014-10-15 at 11:07 +0800, Yijing Wang wrote:
> Use MSI chip framework instead of arch MSI functions to configure
> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
> Hi Michael,
>    I dropped the Acked-by , because this version has a
> lot changes compared to last. So, I guess you may want to check it again.

OK thanks.

Still looks OK and boots on one of my test systems that uses MSI.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (for powerpc)


cheers

^ permalink raw reply

* Re: [PATCH v3 21/27] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
From: Yijing Wang @ 2014-10-17  7:42 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-mips, linux-ia64, linux-pci, Bharat.Bhushan, Thierry Reding,
	sparclinux, linux-arch, linux-s390, Russell King, Joerg Roedel,
	x86, Sebastian Ott, xen-devel, arnab.basu, Liviu Dudau,
	Arnd Bergmann, Konrad Rzeszutek Wilk, Chris Metcalf,
	Bjorn Helgaas, Thomas Gleixner, linux-arm-kernel,
	Thomas Petazzoni, Xinwei Hu, Tony Luck, Sergei Shtylyov,
	linux-kernel, Ralf Baechle, iommu, David Vrabel, Wuyun,
	linuxppc-dev, David S. Miller, Lucas Stach
In-Reply-To: <1413530600.21650.5.camel@concordia>

On 2014/10/17 15:23, Michael Ellerman wrote:
> On Wed, 2014-10-15 at 11:07 +0800, Yijing Wang wrote:
>> Use MSI chip framework instead of arch MSI functions to configure
>> MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> ---
>> Hi Michael,
>>    I dropped the Acked-by , because this version has a
>> lot changes compared to last. So, I guess you may want to check it again.
> 
> OK thanks.
> 
> Still looks OK and boots on one of my test systems that uses MSI.

Good!

> 
> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (for powerpc)

Thanks very much!

Thanks!
Yijing.

> 
> 
> cheers
> 
> 
> 
> .
> 


-- 
Thanks!
Yijing

^ permalink raw reply

* Re: [PATCH 3/3] rheap: move rheap.c from arch/powerpc/lib/ to lib/
From: Kumar Gala @ 2014-10-17  7:53 UTC (permalink / raw)
  To: Zhao Qiang; +Cc: B07421, R63061, linuxppc-dev, linux-kernel
In-Reply-To: <1411613237-2271-2-git-send-email-B45475@freescale.com>


On Sep 25, 2014, at 4:47 AM, Zhao Qiang <B45475@freescale.com> wrote:

> qe need to use the rheap, so move it to public directory.
>=20
> Signed-off-by: Zhao Qiang <B45475@freescale.com>
> ---
> arch/powerpc/Kconfig                                    | 3 ---
> arch/powerpc/include/asm/fsl_85xx_cache_sram.h          | 2 +-
> arch/powerpc/lib/Makefile                               | 2 --
> arch/powerpc/platforms/44x/Kconfig                      | 2 +-
> arch/powerpc/platforms/85xx/Kconfig                     | 2 +-
> arch/powerpc/platforms/Kconfig                          | 2 +-
> arch/powerpc/platforms/Kconfig.cputype                  | 2 +-
> arch/powerpc/sysdev/cpm1.c                              | 2 +-
> arch/powerpc/sysdev/cpm2.c                              | 2 +-
> arch/powerpc/sysdev/cpm_common.c                        | 2 +-
> arch/powerpc/sysdev/ppc4xx_ocm.c                        | 2 +-
> drivers/dma/bestcomm/Kconfig                            | 2 +-
> drivers/soc/qe/Kconfig                                  | 2 +-
> drivers/soc/qe/qe.c                                     | 2 +-
> drivers/soc/qe/qe_common.c                              | 2 +-
> drivers/video/Kconfig                                   | 2 +-
> include/linux/fsl/bestcomm/sram.h                       | 2 +-
> {arch/powerpc/include/asm =3D> include/linux/fsl}/rheap.h | 0
> lib/Kconfig                                             | 3 +++
> lib/Makefile                                            | 2 ++
> {arch/powerpc/lib =3D> lib}/rheap.c                       | 2 +-
> 21 files changed, 21 insertions(+), 21 deletions(-)
> rename {arch/powerpc/include/asm =3D> include/linux/fsl}/rheap.h =
(100%)
> rename {arch/powerpc/lib =3D> lib}/rheap.c (99%)

Have you guys looked at moving to lib/genalloc.c.  If we are going to =
keep rheap around the include should be just in include/linux/rheap.h =
not include/linux/fsl/rheap.h

However, I think genalloc should be used and kill off rheap usage.

- k=

^ permalink raw reply

* Re: [PATCH] cpufreq: qoriq: Make the driver usable on all QorIQ platforms
From: Kumar Gala @ 2014-10-17  8:03 UTC (permalink / raw)
  To: b29983
  Cc: Tang Yuantian, viresh.kumar, linux-pm, rjw, linux-kernel,
	linuxppc-dev
In-Reply-To: <1413515616-15874-1-git-send-email-B29983@freescale.com>


On Oct 17, 2014, at 5:13 AM, b29983@freescale.com wrote:

> From: Tang Yuantian <Yuantian.Tang@freescale.com>
>=20
> Freescale introduced new ARM core-based SoCs which support dynamic
> frequency switch feature. DFS on new SoCs are compatible with current
> PowerPC CoreNet platforms. In order to support those new platforms,
> this driver needs to be slightly adjusted. The main changes include:
>=20
> 1. Changed the names of driver and functions in driver.

split the name changes/renaming into a separate patch from the other =
changes.

> 2. Added two new functions get_cpu_physical_id() and get_bus_freq().
> 3. Used a new way to get all the CPUs which sharing clock wire.
>=20
> Signed-off-by: Tang Yuantian <Yuantian.Tang@freescale.com>
> ---
> drivers/cpufreq/Kconfig.arm                        |   8 ++
> drivers/cpufreq/Kconfig.powerpc                    |  11 +-
> drivers/cpufreq/Makefile                           |   2 +-
> .../{ppc-corenet-cpufreq.c =3D> qoriq-cpufreq.c}     | 150 =
++++++++++++++-------
> 4 files changed, 114 insertions(+), 57 deletions(-)
> rename drivers/cpufreq/{ppc-corenet-cpufreq.c =3D> qoriq-cpufreq.c} =
(72%)
>=20
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index 83a75dc..1925ae94 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -247,3 +247,11 @@ config ARM_TEGRA_CPUFREQ
> 	default y
> 	help
> 	  This adds the CPUFreq driver support for TEGRA SOCs.
> +
> +config QORIQ_CPUFREQ
> +	tristate "CPU frequency scaling driver for Freescale QorIQ SoCs"
> +	depends on OF && COMMON_CLK
> +	select CLK_PPC_CORENET

Why are you not also renaming =91CLK_PPC_CORENET=92 to =91CLK_QORIQ=92 =
or something like that?  Seems rather odd to select a PPC CLK support on =
ARM ;)

> +	help
> +	  This adds the CPUFreq driver support for Freescale QorIQ SoCs
> +	  which are capable of changing the CPU's frequency dynamically.
> diff --git a/drivers/cpufreq/Kconfig.powerpc =
b/drivers/cpufreq/Kconfig.powerpc
> index 72564b7..3a34248 100644
> --- a/drivers/cpufreq/Kconfig.powerpc
> +++ b/drivers/cpufreq/Kconfig.powerpc
> @@ -23,14 +23,13 @@ config CPU_FREQ_MAPLE
> 	  This adds support for frequency switching on Maple 970FX
> 	  Evaluation Board and compatible boards (IBM JS2x blades).
>=20
> -config PPC_CORENET_CPUFREQ
> -	tristate "CPU frequency scaling driver for Freescale E500MC =
SoCs"
> -	depends on PPC_E500MC && OF && COMMON_CLK
> +config QORIQ_CPUFREQ
> +	tristate "CPU frequency scaling driver for Freescale QorIQ SoCs"
> +	depends on OF && COMMON_CLK
> 	select CLK_PPC_CORENET
> 	help
> -	  This adds the CPUFreq driver support for Freescale e500mc,
> -	  e5500 and e6500 series SoCs which are capable of changing
> -	  the CPU's frequency dynamically.
> +	  This adds the CPUFreq driver support for Freescale QorIQ SoCs
> +	  which are capable of changing the CPU's frequency dynamically.
>=20
> config CPU_FREQ_PMAC
> 	bool "Support for Apple PowerBooks"
> diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
> index 40c53dc..0020049 100644
> --- a/drivers/cpufreq/Makefile
> +++ b/drivers/cpufreq/Makefile
> @@ -84,7 +84,7 @@ obj-$(CONFIG_CPU_FREQ_CBE)		+=3D =
ppc-cbe-cpufreq.o
> ppc-cbe-cpufreq-y			+=3D ppc_cbe_cpufreq_pervasive.o =
ppc_cbe_cpufreq.o
> obj-$(CONFIG_CPU_FREQ_CBE_PMI)		+=3D =
ppc_cbe_cpufreq_pmi.o
> obj-$(CONFIG_CPU_FREQ_MAPLE)		+=3D maple-cpufreq.o
> -obj-$(CONFIG_PPC_CORENET_CPUFREQ)   +=3D ppc-corenet-cpufreq.o
> +obj-$(CONFIG_QORIQ_CPUFREQ)   		+=3D qoriq-cpufreq.o
> obj-$(CONFIG_CPU_FREQ_PMAC)		+=3D pmac32-cpufreq.o
> obj-$(CONFIG_CPU_FREQ_PMAC64)		+=3D pmac64-cpufreq.o
> obj-$(CONFIG_PPC_PASEMI_CPUFREQ)	+=3D pasemi-cpufreq.o
> diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c =
b/drivers/cpufreq/qoriq-cpufreq.c
> similarity index 72%
> rename from drivers/cpufreq/ppc-corenet-cpufreq.c
> rename to drivers/cpufreq/qoriq-cpufreq.c
> index bee5df7..80def0c 100644
> --- a/drivers/cpufreq/ppc-corenet-cpufreq.c
> +++ b/drivers/cpufreq/qoriq-cpufreq.c
> @@ -1,7 +1,7 @@
> /*
>  * Copyright 2013 Freescale Semiconductor, Inc.
>  *
> - * CPU Frequency Scaling driver for Freescale PowerPC corenet SoCs.
> + * CPU Frequency Scaling driver for Freescale QorIQ SoCs.
>  *
>  * This program is free software; you can redistribute it and/or =
modify
>  * it under the terms of the GNU General Public License version 2 as
> @@ -20,7 +20,6 @@
> #include <linux/of.h>
> #include <linux/slab.h>
> #include <linux/smp.h>
> -#include <sysdev/fsl_soc.h>
>=20
> /**
>  * struct cpu_data - per CPU data struct
> @@ -69,9 +68,6 @@ static const u32 *fmask;
>=20
> static DEFINE_PER_CPU(struct cpu_data *, cpu_data);
>=20
> -/* cpumask in a cluster */
> -static DEFINE_PER_CPU(cpumask_var_t, cpu_mask);
> -
> #ifndef CONFIG_SMP
> static inline const struct cpumask *cpu_core_mask(int cpu)
> {
> @@ -79,6 +75,79 @@ static inline const struct cpumask =
*cpu_core_mask(int cpu)
> }
> #endif
>=20
> +#if defined(CONFIG_PPC_E500MC)

Probably should just be CONFIG_PPC, but do we need this at all.  Can=92t =
we just use topology_core_id() on both ARM & PPC?

> +static int get_cpu_physical_id(int cpu)
> +{
> +	return get_hard_smp_processor_id(cpu);
> +}
> +#elif defined(CONFIG_ARM)
> +static int get_cpu_physical_id(int cpu)
> +{
> +	return topology_core_id(cpu);
> +}
> +#endif
> +
> +static u32 get_bus_freq(void)
> +{
> +	struct device_node *soc;
> +	u32 sysfreq;
> +
> +	soc =3D of_find_node_by_type(NULL, "soc");
> +	if (!soc)
> +		return 0;
> +
> +	if (of_property_read_u32(soc, "bus-frequency", &sysfreq))
> +		sysfreq =3D 0;
> +
> +	of_node_put(soc);
> +
> +	return sysfreq;
> +}
> +
> +static struct device_node *cpu_to_clk_node(int cpu)
> +{
> +	struct device_node *np, *clk_np;
> +
> +	if (!cpu_present(cpu))
> +		return NULL;
> +
> +	np =3D of_get_cpu_node(cpu, NULL);
> +	if (!np)
> +		return NULL;
> +
> +	clk_np =3D of_parse_phandle(np, "clocks", 0);
> +	if (!clk_np)
> +		return NULL;
> +
> +	of_node_put(np);
> +
> +	return clk_np;
> +}
> +
> +/* traverse cpu nodes to get cpu mask of sharing clock wire */
> +static void set_affected_cpus(struct cpufreq_policy *policy)
> +{
> +	struct device_node *np, *clk_np;
> +	struct cpumask *dstp =3D policy->cpus;
> +	int i;
> +
> +	np =3D cpu_to_clk_node(policy->cpu);
> +	if (!np)
> +		return;
> +
> +	for_each_present_cpu(i) {
> +		clk_np =3D cpu_to_clk_node(i);
> +		if (!clk_np)
> +			continue;
> +
> +		if (clk_np =3D=3D np)
> +			cpumask_set_cpu(i, dstp);
> +
> +		of_node_put(clk_np);
> +	}
> +	of_node_put(np);
> +}
> +
> /* reduce the duplicated frequencies in frequency table */
> static void freq_table_redup(struct cpufreq_frequency_table =
*freq_table,
> 		int count)
> @@ -105,6 +174,7 @@ static void freq_table_sort(struct =
cpufreq_frequency_table *freq_table,
> 	int i, j, ind;
> 	unsigned int freq, max_freq;
> 	struct cpufreq_frequency_table table;
> +
> 	for (i =3D 0; i < count - 1; i++) {
> 		max_freq =3D freq_table[i].frequency;
> 		ind =3D i;
> @@ -129,7 +199,7 @@ static void freq_table_sort(struct =
cpufreq_frequency_table *freq_table,
> 	}
> }
>=20
> -static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy)
> +static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy)
> {
> 	struct device_node *np;
> 	int i, count, ret;
> @@ -145,10 +215,8 @@ static int corenet_cpufreq_cpu_init(struct =
cpufreq_policy *policy)
> 		return -ENODEV;
>=20
> 	data =3D kzalloc(sizeof(*data), GFP_KERNEL);
> -	if (!data) {
> -		pr_err("%s: no memory\n", __func__);
> +	if (!data)
> 		goto err_np;
> -	}
>=20
> 	policy->clk =3D of_clk_get(np, 0);
> 	if (IS_ERR(policy->clk)) {
> @@ -170,7 +238,7 @@ static int corenet_cpufreq_cpu_init(struct =
cpufreq_policy *policy)
> 	}
>=20
> 	if (fmask)
> -		mask =3D fmask[get_hard_smp_processor_id(cpu)];
> +		mask =3D fmask[get_cpu_physical_id(cpu)];
> 	else
> 		mask =3D 0x0;
>=20
> @@ -201,13 +269,13 @@ static int corenet_cpufreq_cpu_init(struct =
cpufreq_policy *policy)
> 	data->table =3D table;
>=20
> 	/* update ->cpus if we have cluster, no harm if not */
> -	cpumask_copy(policy->cpus, per_cpu(cpu_mask, cpu));
> -	for_each_cpu(i, per_cpu(cpu_mask, cpu))
> +	set_affected_cpus(policy);
> +	for_each_cpu(i, policy->cpus)
> 		per_cpu(cpu_data, i) =3D data;
>=20
> 	/* Minimum transition latency is 12 platform clocks */
> 	u64temp =3D 12ULL * NSEC_PER_SEC;
> -	do_div(u64temp, fsl_get_sys_freq());
> +	do_div(u64temp, get_bus_freq());
> 	policy->cpuinfo.transition_latency =3D u64temp + 1;
>=20
> 	of_node_put(np);
> @@ -227,7 +295,7 @@ err_np:
> 	return -ENODEV;
> }
>=20
> -static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy =
*policy)
> +static int __exit qoriq_cpufreq_cpu_exit(struct cpufreq_policy =
*policy)
> {
> 	struct cpu_data *data =3D per_cpu(cpu_data, policy->cpu);
> 	unsigned int cpu;
> @@ -236,13 +304,13 @@ static int __exit =
corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy)
> 	kfree(data->table);
> 	kfree(data);
>=20
> -	for_each_cpu(cpu, per_cpu(cpu_mask, policy->cpu))
> +	for_each_cpu(cpu, policy->cpus)
> 		per_cpu(cpu_data, cpu) =3D NULL;
>=20
> 	return 0;
> }
>=20
> -static int corenet_cpufreq_target(struct cpufreq_policy *policy,
> +static int qoriq_cpufreq_target(struct cpufreq_policy *policy,
> 		unsigned int index)
> {
> 	struct clk *parent;
> @@ -252,18 +320,18 @@ static int corenet_cpufreq_target(struct =
cpufreq_policy *policy,
> 	return clk_set_parent(policy->clk, parent);
> }
>=20
> -static struct cpufreq_driver ppc_corenet_cpufreq_driver =3D {
> -	.name		=3D "ppc_cpufreq",
> +static struct cpufreq_driver qoriq_cpufreq_driver =3D {
> +	.name		=3D "qoriq_cpufreq",
> 	.flags		=3D CPUFREQ_CONST_LOOPS,
> -	.init		=3D corenet_cpufreq_cpu_init,
> -	.exit		=3D __exit_p(corenet_cpufreq_cpu_exit),
> +	.init		=3D qoriq_cpufreq_cpu_init,
> +	.exit		=3D __exit_p(qoriq_cpufreq_cpu_exit),
> 	.verify		=3D cpufreq_generic_frequency_table_verify,
> -	.target_index	=3D corenet_cpufreq_target,
> +	.target_index	=3D qoriq_cpufreq_target,
> 	.get		=3D cpufreq_generic_get,
> 	.attr		=3D cpufreq_generic_attr,
> };
>=20
> -static const struct of_device_id node_matches[] __initdata =3D {
> +static const struct of_device_id node_matches[] __initconst =3D {
> 	{ .compatible =3D "fsl,p2041-clockgen", .data =3D &sdata[0], },
> 	{ .compatible =3D "fsl,p3041-clockgen", .data =3D &sdata[0], },
> 	{ .compatible =3D "fsl,p5020-clockgen", .data =3D &sdata[1], },
> @@ -273,61 +341,43 @@ static const struct of_device_id node_matches[] =
__initdata =3D {
> 	{}
> };
>=20
> -static int __init ppc_corenet_cpufreq_init(void)
> +static int __init qoriq_cpufreq_init(void)
> {
> 	int ret;
> 	struct device_node  *np;
> 	const struct of_device_id *match;
> 	const struct soc_data *data;
> -	unsigned int cpu;
>=20
> 	np =3D of_find_matching_node(NULL, node_matches);
> 	if (!np)
> 		return -ENODEV;
>=20
> -	for_each_possible_cpu(cpu) {
> -		if (!alloc_cpumask_var(&per_cpu(cpu_mask, cpu), =
GFP_KERNEL))
> -			goto err_mask;
> -		cpumask_copy(per_cpu(cpu_mask, cpu), =
cpu_core_mask(cpu));
> -	}
> -
> 	match =3D of_match_node(node_matches, np);
> 	data =3D match->data;
> 	if (data) {
> 		if (data->flag)
> 			fmask =3D data->freq_mask;
> -		min_cpufreq =3D fsl_get_sys_freq();
> +		min_cpufreq =3D get_bus_freq();
> 	} else {
> -		min_cpufreq =3D fsl_get_sys_freq() / 2;
> +		min_cpufreq =3D get_bus_freq() / 2;
> 	}
>=20
> 	of_node_put(np);
>=20
> -	ret =3D cpufreq_register_driver(&ppc_corenet_cpufreq_driver);
> +	ret =3D cpufreq_register_driver(&qoriq_cpufreq_driver);
> 	if (!ret)
> -		pr_info("Freescale PowerPC corenet CPU frequency scaling =
driver\n");
> +		pr_info("Freescale QorIQ CPU frequency scaling =
driver\n");
>=20
> 	return ret;
> -
> -err_mask:
> -	for_each_possible_cpu(cpu)
> -		free_cpumask_var(per_cpu(cpu_mask, cpu));
> -
> -	return -ENOMEM;
> }
> -module_init(ppc_corenet_cpufreq_init);
> +module_init(qoriq_cpufreq_init);
>=20
> -static void __exit ppc_corenet_cpufreq_exit(void)
> +static void __exit qoriq_cpufreq_exit(void)
> {
> -	unsigned int cpu;
> -
> -	for_each_possible_cpu(cpu)
> -		free_cpumask_var(per_cpu(cpu_mask, cpu));
> -
> -	cpufreq_unregister_driver(&ppc_corenet_cpufreq_driver);
> +	cpufreq_unregister_driver(&qoriq_cpufreq_driver);
> }
> -module_exit(ppc_corenet_cpufreq_exit);
> +module_exit(qoriq_cpufreq_exit);
>=20
> MODULE_LICENSE("GPL");
> MODULE_AUTHOR("Tang Yuantian <Yuantian.Tang@freescale.com>");
> -MODULE_DESCRIPTION("cpufreq driver for Freescale e500mc series =
SoCs");
> +MODULE_DESCRIPTION("cpufreq driver for Freescale QorIQ series SoCs");
> --=20
> 2.1.0.27.g96db324
>=20
> --
> To unsubscribe from this list: send the line "unsubscribe =
linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ 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