* Re: [PATCH] ASoC: fsl: Set sdma peripheral type directly
From: Shawn Guo @ 2013-07-25 14:01 UTC (permalink / raw)
To: Nicolin Chen; +Cc: fabio.estevam, alsa-devel, broonie, linuxppc-dev, timur
In-Reply-To: <1374745301-29508-1-git-send-email-b42378@freescale.com>
On Thu, Jul 25, 2013 at 05:41:41PM +0800, Nicolin Chen wrote:
> Let CPU DAI drivers set SDMA periperal type directly to support more
> dma types(SPDIF, ESAI) other than only two for SSI.
> This will easily allow some non-SSI drivers to use the imx-pcm-dma
> as well.
>
> Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
^ permalink raw reply
* Re: [PATCH 0/7] rapidio: modularize rapidio subsystem
From: Jean Delvare @ 2013-07-25 16:03 UTC (permalink / raw)
To: Alexandre Bounine
Cc: Stef van Os, Micha Nelissen, linux-kernel, Andre van Herk,
Andrew Morton, linuxppc-dev
In-Reply-To: <1372447136-5751-1-git-send-email-alexandre.bounine@idt.com>
Hi Alexandre,
Le Friday 28 June 2013 à 15:18 -0400, Alexandre Bounine a écrit :
> The following set of patches modifies kernel RapidIO subsystem to enable build
> and use of its components as loadable kernel modules. Combinations of statically
> linked and modular components are also supported.
> (...)
Thanks to this patch set, I was finally able to make all RapidIO support
modular in openSUSE kernels. This is very appreciated, thanks a lot!
--
Jean Delvare
Suse L3
^ permalink raw reply
* Re: [PATCH 2/2] kvm: powerpc: set cache coherency only for kernel managed pages
From: Alexander Graf @ 2013-07-25 16:07 UTC (permalink / raw)
To: Gleb Natapov
Cc: Wood Scott-B07421, kvm@vger.kernel.org list, kvm-ppc,
"“tiejun.chen” Chen", Bhushan Bharat-R65777,
Scott Wood, Paolo Bonzini, linuxppc-dev
In-Reply-To: <20130725085042.GJ16400@redhat.com>
On 25.07.2013, at 10:50, Gleb Natapov wrote:
> On Wed, Jul 24, 2013 at 03:32:49PM -0500, Scott Wood wrote:
>> On 07/24/2013 04:39:59 AM, Alexander Graf wrote:
>>>=20
>>> On 24.07.2013, at 11:35, Gleb Natapov wrote:
>>>=20
>>>> On Wed, Jul 24, 2013 at 11:21:11AM +0200, Alexander Graf wrote:
>>>>>> Are not we going to use page_is_ram() from
>>> e500_shadow_mas2_attrib() as Scott commented?
>>>>>=20
>>>>> rWhy aren't we using page_is_ram() in kvm_is_mmio_pfn()?
>>>>>=20
>>>>>=20
>>>> Because it is much slower and, IIRC, actually used to build pfn
>>> map that allow
>>>> us to check quickly for valid pfn.
>>>=20
>>> Then why should we use page_is_ram()? :)
>>>=20
>>> I really don't want the e500 code to diverge too much from what
>>> the rest of the kvm code is doing.
>>=20
>> I don't understand "actually used to build pfn map...". What code
>> is this? I don't see any calls to page_is_ram() in the KVM code, or
>> in generic mm code. Is this a statement about what x86 does?
> It may be not page_is_ram() directly, but the same into page_is_ram() =
is
> using. On power both page_is_ram() and do_init_bootmem() walks some =
kind
> of memblock_region data structure. What important is that pfn_valid()
> does not mean that there is a memory behind page structure. See =
Andrea's
> reply.
>=20
>>=20
>> On PPC page_is_ram() is only called (AFAICT) for determining what
>> attributes to set on mmaps. We want to be sure that KVM always
>> makes the same decision. While pfn_valid() seems like it should be
>> equivalent, it's not obvious from the PPC code that it is.
>>=20
> Again pfn_valid() is not enough.
>=20
>> If pfn_valid() is better, why is that not used for mmap? Why are
>> there two different names for the same thing?
>>=20
> They are not the same thing. page_is_ram() tells you if phys address =
is
> ram backed. pfn_valid() tells you if there is struct page behind the
> pfn. PageReserved() tells if you a pfn is marked as reserved. All non
> ram pfns should be reserved, but ram pfns can be reserved too. Again,
> see Andrea's reply.
>=20
> Why ppc uses page_is_ram() for mmap? How should I know? But looking at
That one's easy. Let's just ask Ben. Ben, is there any particular reason =
PPC uses page_is_ram() rather than what KVM does here to figure out =
whether a pfn is RAM or not? It would be really useful to be able to run =
the exact same logic that figures out whether we're cacheable or not in =
both TLB writers (KVM and linux-mm).
Alex
> the function it does it only as a fallback if
> ppc_md.phys_mem_access_prot() is not provided. Making access to MMIO
> noncached as a safe fallback makes sense. It is also make sense to =
allow
> noncached access to reserved ram sometimes.
>=20
> --
> Gleb.
^ permalink raw reply
* Re: [PATCH 2/2] kvm: powerpc: set cache coherency only for kernel managed pages
From: Gleb Natapov @ 2013-07-25 16:14 UTC (permalink / raw)
To: Alexander Graf
Cc: Wood Scott-B07421, kvm@vger.kernel.org list, kvm-ppc,
"“tiejun.chen” Chen", Bhushan Bharat-R65777,
Scott Wood, Paolo Bonzini, linuxppc-dev
In-Reply-To: <4DADA80E-9513-45D5-AFC0-1CEE2290F691@suse.de>
On Thu, Jul 25, 2013 at 06:07:55PM +0200, Alexander Graf wrote:
>
> On 25.07.2013, at 10:50, Gleb Natapov wrote:
>
> > On Wed, Jul 24, 2013 at 03:32:49PM -0500, Scott Wood wrote:
> >> On 07/24/2013 04:39:59 AM, Alexander Graf wrote:
> >>>
> >>> On 24.07.2013, at 11:35, Gleb Natapov wrote:
> >>>
> >>>> On Wed, Jul 24, 2013 at 11:21:11AM +0200, Alexander Graf wrote:
> >>>>>> Are not we going to use page_is_ram() from
> >>> e500_shadow_mas2_attrib() as Scott commented?
> >>>>>
> >>>>> rWhy aren't we using page_is_ram() in kvm_is_mmio_pfn()?
> >>>>>
> >>>>>
> >>>> Because it is much slower and, IIRC, actually used to build pfn
> >>> map that allow
> >>>> us to check quickly for valid pfn.
> >>>
> >>> Then why should we use page_is_ram()? :)
> >>>
> >>> I really don't want the e500 code to diverge too much from what
> >>> the rest of the kvm code is doing.
> >>
> >> I don't understand "actually used to build pfn map...". What code
> >> is this? I don't see any calls to page_is_ram() in the KVM code, or
> >> in generic mm code. Is this a statement about what x86 does?
> > It may be not page_is_ram() directly, but the same into page_is_ram() is
> > using. On power both page_is_ram() and do_init_bootmem() walks some kind
> > of memblock_region data structure. What important is that pfn_valid()
> > does not mean that there is a memory behind page structure. See Andrea's
> > reply.
> >
> >>
> >> On PPC page_is_ram() is only called (AFAICT) for determining what
> >> attributes to set on mmaps. We want to be sure that KVM always
> >> makes the same decision. While pfn_valid() seems like it should be
> >> equivalent, it's not obvious from the PPC code that it is.
> >>
> > Again pfn_valid() is not enough.
> >
> >> If pfn_valid() is better, why is that not used for mmap? Why are
> >> there two different names for the same thing?
> >>
> > They are not the same thing. page_is_ram() tells you if phys address is
> > ram backed. pfn_valid() tells you if there is struct page behind the
> > pfn. PageReserved() tells if you a pfn is marked as reserved. All non
> > ram pfns should be reserved, but ram pfns can be reserved too. Again,
> > see Andrea's reply.
> >
> > Why ppc uses page_is_ram() for mmap? How should I know? But looking at
>
> That one's easy. Let's just ask Ben. Ben, is there any particular reason PPC uses page_is_ram() rather than what KVM does here to figure out whether a pfn is RAM or not? It would be really useful to be able to run the exact same logic that figures out whether we're cacheable or not in both TLB writers (KVM and linux-mm).
>
KVM does not only try to figure out what is RAM or not! Look at how KVM
uses the function. KVM tries to figure out if refcounting needed to be
used on this page among other things.
--
Gleb.
^ permalink raw reply
* [PATCH 0/2] PCI: Convert hotplug core and pciehp to be builtin only
From: Bjorn Helgaas @ 2013-07-25 17:57 UTC (permalink / raw)
To: linux-pci
Cc: Fenghua Yu, Tony Luck, linux-ia64, linux-sh, linuxppc-dev,
Rafael J. Wysocki, Paul Mundt, Paul Mackerras, Yinghai Lu
Yinghai is working on a regression fix ("PCI: Separate stop and remove
devices in pciehp") that needs to go into v3.11, and his fix will be
simpler if we remove the module option for pciehp in v3.11. That will mean
he won't have to export pci_stop_bus_device() and pci_remove_bus_device()
for use by modules.
So these two patches convert CONFIG_HOTPLUG_PCI and CONFIG_HOTPLUG_PCI_PCIE
to be bool (not tristate) and update defconfig files that had
CONFIG_HOTPLUG_PCI=m.
The motivation was for CONFIG_HOTPLUG_PCI_PCIE, but I also converted
CONFIG_HOTPLUG_PCI to bool because the CONFIG_HOTPLUG_PCI=m and
CONFIG_HOTPLUG_PCI_PCIE=y combination was accepted by Kconfig and builds a
kernel, but pciehp doesn't actually work in that case (pointed out by
Yinghai, thanks!)
These are intended for v3.11.
---
Bjorn Helgaas (2):
PCI: hotplug: Convert to be builtin only, not modular
PCI: pciehp: Convert pciehp to be builtin only, not modular
arch/ia64/configs/generic_defconfig | 2 +-
arch/ia64/configs/gensparse_defconfig | 2 +-
arch/ia64/configs/tiger_defconfig | 2 +-
arch/ia64/configs/xen_domu_defconfig | 2 +-
arch/powerpc/configs/ppc64_defconfig | 2 +-
arch/powerpc/configs/ppc64e_defconfig | 2 +-
arch/powerpc/configs/pseries_defconfig | 2 +-
arch/sh/configs/sh03_defconfig | 2 +-
drivers/pci/hotplug/Kconfig | 5 +----
drivers/pci/pcie/Kconfig | 5 +----
10 files changed, 10 insertions(+), 16 deletions(-)
^ permalink raw reply
* [PATCH 1/2] PCI: hotplug: Convert to be builtin only, not modular
From: Bjorn Helgaas @ 2013-07-25 17:57 UTC (permalink / raw)
To: linux-pci
Cc: Fenghua Yu, Tony Luck, linux-ia64, linux-sh, linuxppc-dev,
Rafael J. Wysocki, Paul Mundt, Paul Mackerras, Yinghai Lu
In-Reply-To: <20130725175242.6006.56007.stgit@bhelgaas-glaptop>
Convert CONFIG_HOTPLUG_PCI from tristate to bool. This only affects
the hotplug core; several of the hotplug drivers can still be modules.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/ia64/configs/generic_defconfig | 2 +-
arch/ia64/configs/gensparse_defconfig | 2 +-
arch/ia64/configs/tiger_defconfig | 2 +-
arch/ia64/configs/xen_domu_defconfig | 2 +-
arch/powerpc/configs/ppc64_defconfig | 2 +-
arch/powerpc/configs/ppc64e_defconfig | 2 +-
arch/powerpc/configs/pseries_defconfig | 2 +-
arch/sh/configs/sh03_defconfig | 2 +-
drivers/pci/hotplug/Kconfig | 5 +----
9 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig
index 7913695..efbd292 100644
--- a/arch/ia64/configs/generic_defconfig
+++ b/arch/ia64/configs/generic_defconfig
@@ -31,7 +31,7 @@ CONFIG_ACPI_FAN=m
CONFIG_ACPI_DOCK=y
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=m
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig
index f8e9133..f64980d 100644
--- a/arch/ia64/configs/gensparse_defconfig
+++ b/arch/ia64/configs/gensparse_defconfig
@@ -25,7 +25,7 @@ CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=m
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index a5a9e02..0f4e9e4 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -31,7 +31,7 @@ CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=m
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/arch/ia64/configs/xen_domu_defconfig b/arch/ia64/configs/xen_domu_defconfig
index 37b9b42..b025acf 100644
--- a/arch/ia64/configs/xen_domu_defconfig
+++ b/arch/ia64/configs/xen_domu_defconfig
@@ -32,7 +32,7 @@ CONFIG_ACPI_BUTTON=m
CONFIG_ACPI_FAN=m
CONFIG_ACPI_PROCESSOR=m
CONFIG_ACPI_CONTAINER=m
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_PACKET=y
CONFIG_UNIX=y
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index c86fcb9..0e8cfd0 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -58,7 +58,7 @@ CONFIG_SCHED_SMT=y
CONFIG_PPC_DENORMALISATION=y
CONFIG_PCCARD=y
CONFIG_ELECTRA_CF=y
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_RPA=m
CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
CONFIG_PACKET=y
diff --git a/arch/powerpc/configs/ppc64e_defconfig b/arch/powerpc/configs/ppc64e_defconfig
index 4b20f76..0085dc4 100644
--- a/arch/powerpc/configs/ppc64e_defconfig
+++ b/arch/powerpc/configs/ppc64e_defconfig
@@ -32,7 +32,7 @@ CONFIG_IRQ_ALL_CPUS=y
CONFIG_SPARSEMEM_MANUAL=y
CONFIG_PCI_MSI=y
CONFIG_PCCARD=y
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_XFRM_USER=m
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
index bea8587..1d4b976 100644
--- a/arch/powerpc/configs/pseries_defconfig
+++ b/arch/powerpc/configs/pseries_defconfig
@@ -53,7 +53,7 @@ CONFIG_PPC_64K_PAGES=y
CONFIG_PPC_SUBPAGE_PROT=y
CONFIG_SCHED_SMT=y
CONFIG_PPC_DENORMALISATION=y
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_RPA=m
CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
CONFIG_PACKET=y
diff --git a/arch/sh/configs/sh03_defconfig b/arch/sh/configs/sh03_defconfig
index 2051821..0cf4097 100644
--- a/arch/sh/configs/sh03_defconfig
+++ b/arch/sh/configs/sh03_defconfig
@@ -22,7 +22,7 @@ CONFIG_PREEMPT=y
CONFIG_CMDLINE_OVERWRITE=y
CONFIG_CMDLINE="console=ttySC1,115200 mem=64M root=/dev/nfs"
CONFIG_PCI=y
-CONFIG_HOTPLUG_PCI=m
+CONFIG_HOTPLUG_PCI=y
CONFIG_BINFMT_MISC=y
CONFIG_NET=y
CONFIG_PACKET=y
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index bb7ebb2..d85009d 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -3,16 +3,13 @@
#
menuconfig HOTPLUG_PCI
- tristate "Support for PCI Hotplug"
+ bool "Support for PCI Hotplug"
depends on PCI && SYSFS
---help---
Say Y here if you have a motherboard with a PCI Hotplug controller.
This allows you to add and remove PCI cards while the machine is
powered up and running.
- To compile this driver as a module, choose M here: the
- module will be called pci_hotplug.
-
When in doubt, say N.
if HOTPLUG_PCI
^ permalink raw reply related
* [PATCH 2/2] PCI: pciehp: Convert pciehp to be builtin only, not modular
From: Bjorn Helgaas @ 2013-07-25 17:57 UTC (permalink / raw)
To: linux-pci
Cc: Fenghua Yu, Tony Luck, linux-ia64, linux-sh, linuxppc-dev,
Rafael J. Wysocki, Paul Mundt, Paul Mackerras, Yinghai Lu
In-Reply-To: <20130725175242.6006.56007.stgit@bhelgaas-glaptop>
Convert pciehp to be builtin only, with no module option.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/pci/pcie/Kconfig | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
index 569f82f..3b94cfc 100644
--- a/drivers/pci/pcie/Kconfig
+++ b/drivers/pci/pcie/Kconfig
@@ -14,15 +14,12 @@ config PCIEPORTBUS
# Include service Kconfig here
#
config HOTPLUG_PCI_PCIE
- tristate "PCI Express Hotplug driver"
+ bool "PCI Express Hotplug driver"
depends on HOTPLUG_PCI && PCIEPORTBUS
help
Say Y here if you have a motherboard that supports PCI Express Native
Hotplug
- To compile this driver as a module, choose M here: the
- module will be called pciehp.
-
When in doubt, say N.
source "drivers/pci/pcie/aer/Kconfig"
^ permalink raw reply related
* Re: [PATCHv5 02/11] PCI: use weak functions for MSI arch-specific functions
From: Thierry Reding @ 2013-07-25 18:37 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Lior Amsalem, Andrew Lunn, linux-ia64, linux-mips, linux-pci,
Heiko Carstens, Paul Mackerras, H. Peter Anvin, sparclinux,
linux-s390, Russell King, x86, Ingo Molnar, Ezequiel Garcia,
Fenghua Yu, Jason Cooper, Rob Herring, Chris Metcalf,
Gregory Clement, Thomas Gleixner, linux-arm-kernel,
Thomas Petazzoni, Tony Luck, Ralf Baechle, Maen Suleiman,
Martin Schwidefsky, linux390, linuxppc-dev, David S. Miller
In-Reply-To: <1373889167-27878-3-git-send-email-thomas.petazzoni@free-electrons.com>
[-- Attachment #1: Type: text/plain, Size: 10164 bytes --]
On Mon, Jul 15, 2013 at 01:52:38PM +0200, Thomas Petazzoni wrote:
> Until now, the MSI architecture-specific functions could be overloaded
> using a fairly complex set of #define and compile-time
> conditionals. In order to prepare for the introduction of the msi_chip
> infrastructure, it is desirable to switch all those functions to use
> the 'weak' mechanism. This commit converts all the architectures that
> were overidding those MSI functions to use the new strategy.
>
> Note that we keep a separate, non-weak, function
> default_teardown_msi_irqs() for the default behavior of the
> arch_teardown_msi_irqs(), as the default behavior is needed by the Xen
> x86 PCI code.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: linux390@de.ibm.com
> Cc: linux-s390@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: David S. Miller <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Cc: Chris Metcalf <cmetcalf@tilera.com>
> ---
> arch/mips/include/asm/pci.h | 5 -----
> arch/powerpc/include/asm/pci.h | 5 -----
> arch/s390/include/asm/pci.h | 4 ----
> arch/x86/include/asm/pci.h | 28 --------------------------
> arch/x86/kernel/x86_init.c | 21 ++++++++++++++++++++
> drivers/pci/msi.c | 45 +++++++++++++++++++-----------------------
> include/linux/msi.h | 7 ++++++-
> 7 files changed, 47 insertions(+), 68 deletions(-)
Bjorn,
any chance that we can get your Acked-by on this?
Thierry
>
> diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
> index fa8e0aa..f194c08 100644
> --- a/arch/mips/include/asm/pci.h
> +++ b/arch/mips/include/asm/pci.h
> @@ -136,11 +136,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
> return channel ? 15 : 14;
> }
>
> -#ifdef CONFIG_CPU_CAVIUM_OCTEON
> -/* MSI arch hook for OCTEON */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#endif
> -
> extern char * (*pcibios_plat_setup)(char *str);
>
> #ifdef CONFIG_OF
> diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
> index 6653f27..95145a1 100644
> --- a/arch/powerpc/include/asm/pci.h
> +++ b/arch/powerpc/include/asm/pci.h
> @@ -113,11 +113,6 @@ extern int pci_domain_nr(struct pci_bus *bus);
> /* Decide whether to display the domain number in /proc */
> extern int pci_proc_domain(struct pci_bus *bus);
>
> -/* MSI arch hooks */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#define arch_teardown_msi_irqs arch_teardown_msi_irqs
> -#define arch_msi_check_device arch_msi_check_device
> -
> struct vm_area_struct;
> /* Map a range of PCI memory or I/O space for a device into user space */
> int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
> diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
> index 6e577ba..262b91b 100644
> --- a/arch/s390/include/asm/pci.h
> +++ b/arch/s390/include/asm/pci.h
> @@ -21,10 +21,6 @@ void pci_iounmap(struct pci_dev *, void __iomem *);
> int pci_domain_nr(struct pci_bus *);
> int pci_proc_domain(struct pci_bus *);
>
> -/* MSI arch hooks */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#define arch_teardown_msi_irqs arch_teardown_msi_irqs
> -
> #define ZPCI_BUS_NR 0 /* default bus number */
> #define ZPCI_DEVFN 0 /* default device number */
>
> diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
> index d9e9e6c..8c61de0 100644
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -100,29 +100,6 @@ static inline void early_quirks(void) { }
> extern void pci_iommu_alloc(void);
>
> #ifdef CONFIG_PCI_MSI
> -/* MSI arch specific hooks */
> -static inline int x86_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> -{
> - return x86_msi.setup_msi_irqs(dev, nvec, type);
> -}
> -
> -static inline void x86_teardown_msi_irqs(struct pci_dev *dev)
> -{
> - x86_msi.teardown_msi_irqs(dev);
> -}
> -
> -static inline void x86_teardown_msi_irq(unsigned int irq)
> -{
> - x86_msi.teardown_msi_irq(irq);
> -}
> -static inline void x86_restore_msi_irqs(struct pci_dev *dev, int irq)
> -{
> - x86_msi.restore_msi_irqs(dev, irq);
> -}
> -#define arch_setup_msi_irqs x86_setup_msi_irqs
> -#define arch_teardown_msi_irqs x86_teardown_msi_irqs
> -#define arch_teardown_msi_irq x86_teardown_msi_irq
> -#define arch_restore_msi_irqs x86_restore_msi_irqs
> /* implemented in arch/x86/kernel/apic/io_apic. */
> struct msi_desc;
> int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
> @@ -130,11 +107,6 @@ void native_teardown_msi_irq(unsigned int irq);
> void native_restore_msi_irqs(struct pci_dev *dev, int irq);
> int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
> unsigned int irq_base, unsigned int irq_offset);
> -/* default to the implementation in drivers/lib/msi.c */
> -#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> -#define HAVE_DEFAULT_MSI_RESTORE_IRQS
> -void default_teardown_msi_irqs(struct pci_dev *dev);
> -void default_restore_msi_irqs(struct pci_dev *dev, int irq);
> #else
> #define native_setup_msi_irqs NULL
> #define native_teardown_msi_irq NULL
> diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
> index 45a14db..a2b189c 100644
> --- a/arch/x86/kernel/x86_init.c
> +++ b/arch/x86/kernel/x86_init.c
> @@ -116,6 +116,27 @@ struct x86_msi_ops x86_msi = {
> .setup_hpet_msi = default_setup_hpet_msi,
> };
>
> +/* MSI arch specific hooks */
> +int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +{
> + return x86_msi.setup_msi_irqs(dev, nvec, type);
> +}
> +
> +void arch_teardown_msi_irqs(struct pci_dev *dev)
> +{
> + x86_msi.teardown_msi_irqs(dev);
> +}
> +
> +void arch_teardown_msi_irq(unsigned int irq)
> +{
> + x86_msi.teardown_msi_irq(irq);
> +}
> +
> +void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
> +{
> + x86_msi.restore_msi_irqs(dev, irq);
> +}
> +
> struct x86_io_apic_ops x86_io_apic_ops = {
> .init = native_io_apic_init_mappings,
> .read = native_io_apic_read,
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index aca7578..aa2f697 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -30,20 +30,21 @@ static int pci_msi_enable = 1;
>
> /* Arch hooks */
>
> -#ifndef arch_msi_check_device
> -int arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
> +int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
> {
> - return 0;
> + return -EINVAL;
> }
> -#endif
>
> -#ifndef arch_setup_msi_irqs
> -# define arch_setup_msi_irqs default_setup_msi_irqs
> -# define HAVE_DEFAULT_MSI_SETUP_IRQS
> -#endif
> +void __weak arch_teardown_msi_irq(unsigned int irq)
> +{
> +}
>
> -#ifdef HAVE_DEFAULT_MSI_SETUP_IRQS
> -int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
> +{
> + return 0;
> +}
> +
> +int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> {
> struct msi_desc *entry;
> int ret;
> @@ -65,14 +66,11 @@ int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>
> return 0;
> }
> -#endif
>
> -#ifndef arch_teardown_msi_irqs
> -# define arch_teardown_msi_irqs default_teardown_msi_irqs
> -# define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> -#endif
> -
> -#ifdef HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> +/*
> + * We have a default implementation available as a separate non-weak
> + * function, as it is used by the Xen x86 PCI code
> + */
> void default_teardown_msi_irqs(struct pci_dev *dev)
> {
> struct msi_desc *entry;
> @@ -89,15 +87,13 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
> arch_teardown_msi_irq(entry->irq + i);
> }
> }
> -#endif
>
> -#ifndef arch_restore_msi_irqs
> -# define arch_restore_msi_irqs default_restore_msi_irqs
> -# define HAVE_DEFAULT_MSI_RESTORE_IRQS
> -#endif
> +void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
> +{
> + return default_teardown_msi_irqs(dev);
> +}
>
> -#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
> -void default_restore_msi_irqs(struct pci_dev *dev, int irq)
> +void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq)
> {
> struct msi_desc *entry;
>
> @@ -114,7 +110,6 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq)
> if (entry)
> write_msi_msg(irq, &entry->msg);
> }
> -#endif
>
> static void msi_set_enable(struct pci_dev *dev, int enable)
> {
> diff --git a/include/linux/msi.h b/include/linux/msi.h
> index ee66f3a..18870b0 100644
> --- a/include/linux/msi.h
> +++ b/include/linux/msi.h
> @@ -51,12 +51,17 @@ struct msi_desc {
> };
>
> /*
> - * The arch hook for setup up msi irqs
> + * The arch hooks to setup up msi irqs. Those functions are
> + * implemented as weak symbols so that they /can/ be overriden by
> + * architecture specific code if needed.
> */
> int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
> void arch_teardown_msi_irq(unsigned int irq);
> int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
> void arch_teardown_msi_irqs(struct pci_dev *dev);
> int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
> +void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
> +
> +void default_teardown_msi_irqs(struct pci_dev *dev);
>
> #endif /* LINUX_MSI_H */
> --
> 1.8.1.2
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH] ASoC: fsl: Set sdma peripheral type directly
From: Mark Brown @ 2013-07-25 19:11 UTC (permalink / raw)
To: Nicolin Chen; +Cc: fabio.estevam, alsa-devel, shawn.guo, linuxppc-dev, timur
In-Reply-To: <1374745301-29508-1-git-send-email-b42378@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
On Thu, Jul 25, 2013 at 05:41:41PM +0800, Nicolin Chen wrote:
> Let CPU DAI drivers set SDMA periperal type directly to support more
> dma types(SPDIF, ESAI) other than only two for SSI.
> This will easily allow some non-SSI drivers to use the imx-pcm-dma
> as well.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] PCI: hotplug: Convert to be builtin only, not modular
From: Rafael J. Wysocki @ 2013-07-25 19:34 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Fenghua Yu, Tony Luck, linux-ia64, linux-sh, linux-pci,
linuxppc-dev, Paul Mundt, Paul Mackerras, Yinghai Lu
In-Reply-To: <20130725175720.6006.96448.stgit@bhelgaas-glaptop>
On Thursday, July 25, 2013 11:57:20 AM Bjorn Helgaas wrote:
> Convert CONFIG_HOTPLUG_PCI from tristate to bool. This only affects
> the hotplug core; several of the hotplug drivers can still be modules.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> arch/ia64/configs/generic_defconfig | 2 +-
> arch/ia64/configs/gensparse_defconfig | 2 +-
> arch/ia64/configs/tiger_defconfig | 2 +-
> arch/ia64/configs/xen_domu_defconfig | 2 +-
> arch/powerpc/configs/ppc64_defconfig | 2 +-
> arch/powerpc/configs/ppc64e_defconfig | 2 +-
> arch/powerpc/configs/pseries_defconfig | 2 +-
> arch/sh/configs/sh03_defconfig | 2 +-
> drivers/pci/hotplug/Kconfig | 5 +----
> 9 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig
> index 7913695..efbd292 100644
> --- a/arch/ia64/configs/generic_defconfig
> +++ b/arch/ia64/configs/generic_defconfig
> @@ -31,7 +31,7 @@ CONFIG_ACPI_FAN=m
> CONFIG_ACPI_DOCK=y
> CONFIG_ACPI_PROCESSOR=m
> CONFIG_ACPI_CONTAINER=m
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_ACPI=m
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig
> index f8e9133..f64980d 100644
> --- a/arch/ia64/configs/gensparse_defconfig
> +++ b/arch/ia64/configs/gensparse_defconfig
> @@ -25,7 +25,7 @@ CONFIG_ACPI_BUTTON=m
> CONFIG_ACPI_FAN=m
> CONFIG_ACPI_PROCESSOR=m
> CONFIG_ACPI_CONTAINER=m
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_ACPI=m
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
> index a5a9e02..0f4e9e4 100644
> --- a/arch/ia64/configs/tiger_defconfig
> +++ b/arch/ia64/configs/tiger_defconfig
> @@ -31,7 +31,7 @@ CONFIG_ACPI_BUTTON=m
> CONFIG_ACPI_FAN=m
> CONFIG_ACPI_PROCESSOR=m
> CONFIG_ACPI_CONTAINER=m
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_ACPI=m
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> diff --git a/arch/ia64/configs/xen_domu_defconfig b/arch/ia64/configs/xen_domu_defconfig
> index 37b9b42..b025acf 100644
> --- a/arch/ia64/configs/xen_domu_defconfig
> +++ b/arch/ia64/configs/xen_domu_defconfig
> @@ -32,7 +32,7 @@ CONFIG_ACPI_BUTTON=m
> CONFIG_ACPI_FAN=m
> CONFIG_ACPI_PROCESSOR=m
> CONFIG_ACPI_CONTAINER=m
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_ACPI=m
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
> index c86fcb9..0e8cfd0 100644
> --- a/arch/powerpc/configs/ppc64_defconfig
> +++ b/arch/powerpc/configs/ppc64_defconfig
> @@ -58,7 +58,7 @@ CONFIG_SCHED_SMT=y
> CONFIG_PPC_DENORMALISATION=y
> CONFIG_PCCARD=y
> CONFIG_ELECTRA_CF=y
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_RPA=m
> CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
> CONFIG_PACKET=y
> diff --git a/arch/powerpc/configs/ppc64e_defconfig b/arch/powerpc/configs/ppc64e_defconfig
> index 4b20f76..0085dc4 100644
> --- a/arch/powerpc/configs/ppc64e_defconfig
> +++ b/arch/powerpc/configs/ppc64e_defconfig
> @@ -32,7 +32,7 @@ CONFIG_IRQ_ALL_CPUS=y
> CONFIG_SPARSEMEM_MANUAL=y
> CONFIG_PCI_MSI=y
> CONFIG_PCCARD=y
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_PACKET=y
> CONFIG_UNIX=y
> CONFIG_XFRM_USER=m
> diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig
> index bea8587..1d4b976 100644
> --- a/arch/powerpc/configs/pseries_defconfig
> +++ b/arch/powerpc/configs/pseries_defconfig
> @@ -53,7 +53,7 @@ CONFIG_PPC_64K_PAGES=y
> CONFIG_PPC_SUBPAGE_PROT=y
> CONFIG_SCHED_SMT=y
> CONFIG_PPC_DENORMALISATION=y
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_RPA=m
> CONFIG_HOTPLUG_PCI_RPA_DLPAR=m
> CONFIG_PACKET=y
> diff --git a/arch/sh/configs/sh03_defconfig b/arch/sh/configs/sh03_defconfig
> index 2051821..0cf4097 100644
> --- a/arch/sh/configs/sh03_defconfig
> +++ b/arch/sh/configs/sh03_defconfig
> @@ -22,7 +22,7 @@ CONFIG_PREEMPT=y
> CONFIG_CMDLINE_OVERWRITE=y
> CONFIG_CMDLINE="console=ttySC1,115200 mem=64M root=/dev/nfs"
> CONFIG_PCI=y
> -CONFIG_HOTPLUG_PCI=m
> +CONFIG_HOTPLUG_PCI=y
> CONFIG_BINFMT_MISC=y
> CONFIG_NET=y
> CONFIG_PACKET=y
> diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
> index bb7ebb2..d85009d 100644
> --- a/drivers/pci/hotplug/Kconfig
> +++ b/drivers/pci/hotplug/Kconfig
> @@ -3,16 +3,13 @@
> #
>
> menuconfig HOTPLUG_PCI
> - tristate "Support for PCI Hotplug"
> + bool "Support for PCI Hotplug"
> depends on PCI && SYSFS
> ---help---
> Say Y here if you have a motherboard with a PCI Hotplug controller.
> This allows you to add and remove PCI cards while the machine is
> powered up and running.
>
> - To compile this driver as a module, choose M here: the
> - module will be called pci_hotplug.
> -
> When in doubt, say N.
>
> if HOTPLUG_PCI
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply
* Re: [PATCHv5 02/11] PCI: use weak functions for MSI arch-specific functions
From: Bjorn Helgaas @ 2013-07-25 20:27 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Lior Amsalem, Andrew Lunn, linux-ia64@vger.kernel.org,
linux-mips@linux-mips.org, linux-pci@vger.kernel.org,
Heiko Carstens, Thierry Reding, Paul Mackerras, H. Peter Anvin,
sparclinux, linux-s390, Russell King, x86@kernel.org, Ingo Molnar,
Ezequiel Garcia, Fenghua Yu, Jason Cooper, Rob Herring,
Chris Metcalf, Gregory Clement, Thomas Gleixner, linux-arm,
Tony Luck, Ralf Baechle, Maen Suleiman, Martin Schwidefsky,
linux390, linuxppc-dev, David S. Miller
In-Reply-To: <1373889167-27878-3-git-send-email-thomas.petazzoni@free-electrons.com>
On Mon, Jul 15, 2013 at 5:52 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Until now, the MSI architecture-specific functions could be overloaded
> using a fairly complex set of #define and compile-time
> conditionals. In order to prepare for the introduction of the msi_chip
> infrastructure, it is desirable to switch all those functions to use
> the 'weak' mechanism. This commit converts all the architectures that
> were overidding those MSI functions to use the new strategy.
>
> Note that we keep a separate, non-weak, function
> default_teardown_msi_irqs() for the default behavior of the
> arch_teardown_msi_irqs(), as the default behavior is needed by the Xen
> x86 PCI code.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: linux390@de.ibm.com
> Cc: linux-s390@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: x86@kernel.org
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: linux-ia64@vger.kernel.org
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: David S. Miller <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> Cc: Chris Metcalf <cmetcalf@tilera.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
> arch/mips/include/asm/pci.h | 5 -----
> arch/powerpc/include/asm/pci.h | 5 -----
> arch/s390/include/asm/pci.h | 4 ----
> arch/x86/include/asm/pci.h | 28 --------------------------
> arch/x86/kernel/x86_init.c | 21 ++++++++++++++++++++
> drivers/pci/msi.c | 45 +++++++++++++++++++-----------------------
> include/linux/msi.h | 7 ++++++-
> 7 files changed, 47 insertions(+), 68 deletions(-)
>
> diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
> index fa8e0aa..f194c08 100644
> --- a/arch/mips/include/asm/pci.h
> +++ b/arch/mips/include/asm/pci.h
> @@ -136,11 +136,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
> return channel ? 15 : 14;
> }
>
> -#ifdef CONFIG_CPU_CAVIUM_OCTEON
> -/* MSI arch hook for OCTEON */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#endif
> -
> extern char * (*pcibios_plat_setup)(char *str);
>
> #ifdef CONFIG_OF
> diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
> index 6653f27..95145a1 100644
> --- a/arch/powerpc/include/asm/pci.h
> +++ b/arch/powerpc/include/asm/pci.h
> @@ -113,11 +113,6 @@ extern int pci_domain_nr(struct pci_bus *bus);
> /* Decide whether to display the domain number in /proc */
> extern int pci_proc_domain(struct pci_bus *bus);
>
> -/* MSI arch hooks */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#define arch_teardown_msi_irqs arch_teardown_msi_irqs
> -#define arch_msi_check_device arch_msi_check_device
> -
> struct vm_area_struct;
> /* Map a range of PCI memory or I/O space for a device into user space */
> int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
> diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h
> index 6e577ba..262b91b 100644
> --- a/arch/s390/include/asm/pci.h
> +++ b/arch/s390/include/asm/pci.h
> @@ -21,10 +21,6 @@ void pci_iounmap(struct pci_dev *, void __iomem *);
> int pci_domain_nr(struct pci_bus *);
> int pci_proc_domain(struct pci_bus *);
>
> -/* MSI arch hooks */
> -#define arch_setup_msi_irqs arch_setup_msi_irqs
> -#define arch_teardown_msi_irqs arch_teardown_msi_irqs
> -
> #define ZPCI_BUS_NR 0 /* default bus number */
> #define ZPCI_DEVFN 0 /* default device number */
>
> diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
> index d9e9e6c..8c61de0 100644
> --- a/arch/x86/include/asm/pci.h
> +++ b/arch/x86/include/asm/pci.h
> @@ -100,29 +100,6 @@ static inline void early_quirks(void) { }
> extern void pci_iommu_alloc(void);
>
> #ifdef CONFIG_PCI_MSI
> -/* MSI arch specific hooks */
> -static inline int x86_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> -{
> - return x86_msi.setup_msi_irqs(dev, nvec, type);
> -}
> -
> -static inline void x86_teardown_msi_irqs(struct pci_dev *dev)
> -{
> - x86_msi.teardown_msi_irqs(dev);
> -}
> -
> -static inline void x86_teardown_msi_irq(unsigned int irq)
> -{
> - x86_msi.teardown_msi_irq(irq);
> -}
> -static inline void x86_restore_msi_irqs(struct pci_dev *dev, int irq)
> -{
> - x86_msi.restore_msi_irqs(dev, irq);
> -}
> -#define arch_setup_msi_irqs x86_setup_msi_irqs
> -#define arch_teardown_msi_irqs x86_teardown_msi_irqs
> -#define arch_teardown_msi_irq x86_teardown_msi_irq
> -#define arch_restore_msi_irqs x86_restore_msi_irqs
> /* implemented in arch/x86/kernel/apic/io_apic. */
> struct msi_desc;
> int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
> @@ -130,11 +107,6 @@ void native_teardown_msi_irq(unsigned int irq);
> void native_restore_msi_irqs(struct pci_dev *dev, int irq);
> int setup_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc,
> unsigned int irq_base, unsigned int irq_offset);
> -/* default to the implementation in drivers/lib/msi.c */
> -#define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> -#define HAVE_DEFAULT_MSI_RESTORE_IRQS
> -void default_teardown_msi_irqs(struct pci_dev *dev);
> -void default_restore_msi_irqs(struct pci_dev *dev, int irq);
> #else
> #define native_setup_msi_irqs NULL
> #define native_teardown_msi_irq NULL
> diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
> index 45a14db..a2b189c 100644
> --- a/arch/x86/kernel/x86_init.c
> +++ b/arch/x86/kernel/x86_init.c
> @@ -116,6 +116,27 @@ struct x86_msi_ops x86_msi = {
> .setup_hpet_msi = default_setup_hpet_msi,
> };
>
> +/* MSI arch specific hooks */
> +int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +{
> + return x86_msi.setup_msi_irqs(dev, nvec, type);
> +}
> +
> +void arch_teardown_msi_irqs(struct pci_dev *dev)
> +{
> + x86_msi.teardown_msi_irqs(dev);
> +}
> +
> +void arch_teardown_msi_irq(unsigned int irq)
> +{
> + x86_msi.teardown_msi_irq(irq);
> +}
> +
> +void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
> +{
> + x86_msi.restore_msi_irqs(dev, irq);
> +}
> +
> struct x86_io_apic_ops x86_io_apic_ops = {
> .init = native_io_apic_init_mappings,
> .read = native_io_apic_read,
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index aca7578..aa2f697 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -30,20 +30,21 @@ static int pci_msi_enable = 1;
>
> /* Arch hooks */
>
> -#ifndef arch_msi_check_device
> -int arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
> +int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
> {
> - return 0;
> + return -EINVAL;
> }
> -#endif
>
> -#ifndef arch_setup_msi_irqs
> -# define arch_setup_msi_irqs default_setup_msi_irqs
> -# define HAVE_DEFAULT_MSI_SETUP_IRQS
> -#endif
> +void __weak arch_teardown_msi_irq(unsigned int irq)
> +{
> +}
>
> -#ifdef HAVE_DEFAULT_MSI_SETUP_IRQS
> -int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> +int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
> +{
> + return 0;
> +}
> +
> +int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
> {
> struct msi_desc *entry;
> int ret;
> @@ -65,14 +66,11 @@ int default_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
>
> return 0;
> }
> -#endif
>
> -#ifndef arch_teardown_msi_irqs
> -# define arch_teardown_msi_irqs default_teardown_msi_irqs
> -# define HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> -#endif
> -
> -#ifdef HAVE_DEFAULT_MSI_TEARDOWN_IRQS
> +/*
> + * We have a default implementation available as a separate non-weak
> + * function, as it is used by the Xen x86 PCI code
> + */
> void default_teardown_msi_irqs(struct pci_dev *dev)
> {
> struct msi_desc *entry;
> @@ -89,15 +87,13 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
> arch_teardown_msi_irq(entry->irq + i);
> }
> }
> -#endif
>
> -#ifndef arch_restore_msi_irqs
> -# define arch_restore_msi_irqs default_restore_msi_irqs
> -# define HAVE_DEFAULT_MSI_RESTORE_IRQS
> -#endif
> +void __weak arch_teardown_msi_irqs(struct pci_dev *dev)
> +{
> + return default_teardown_msi_irqs(dev);
> +}
>
> -#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
> -void default_restore_msi_irqs(struct pci_dev *dev, int irq)
> +void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq)
> {
> struct msi_desc *entry;
>
> @@ -114,7 +110,6 @@ void default_restore_msi_irqs(struct pci_dev *dev, int irq)
> if (entry)
> write_msi_msg(irq, &entry->msg);
> }
> -#endif
>
> static void msi_set_enable(struct pci_dev *dev, int enable)
> {
> diff --git a/include/linux/msi.h b/include/linux/msi.h
> index ee66f3a..18870b0 100644
> --- a/include/linux/msi.h
> +++ b/include/linux/msi.h
> @@ -51,12 +51,17 @@ struct msi_desc {
> };
>
> /*
> - * The arch hook for setup up msi irqs
> + * The arch hooks to setup up msi irqs. Those functions are
> + * implemented as weak symbols so that they /can/ be overriden by
> + * architecture specific code if needed.
> */
> int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
> void arch_teardown_msi_irq(unsigned int irq);
> int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
> void arch_teardown_msi_irqs(struct pci_dev *dev);
> int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
> +void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
> +
> +void default_teardown_msi_irqs(struct pci_dev *dev);
>
> #endif /* LINUX_MSI_H */
> --
> 1.8.1.2
>
^ permalink raw reply
* Re: [RFC 11/14] powerpc: Eliminate NO_IRQ usage
From: Geert Uytterhoeven @ 2013-07-25 21:58 UTC (permalink / raw)
To: Grant Likely
Cc: Linux-Arch, Stephen Rothwell, Russell King,
linux-kernel@vger.kernel.org, Rob Herring, Linux-Next,
Thomas Gleixner, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1326313337-24603-12-git-send-email-grant.likely@secretlab.ca>
On Wed, Jan 11, 2012 at 9:22 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> NO_IRQ is evil. Stop using it in arch/powerpc and powerpc device drivers
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 3e06696..55c6ff9 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -666,7 +666,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
> ssi_private->ssi_phys = res.start;
>
> ssi_private->irq = irq_of_parse_and_map(np, 0);
> - if (ssi_private->irq == NO_IRQ) {
> + if (!ssi_private->irq) {
> dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
> ret = -ENXIO;
> goto error_iomap;
What's the plan with this patch?
This is now failing on xtensa, as it's one of the architectures that doesn't
define NO_IRQ. Only arm, c6x, mn10300, openrisc, parisc, powerpc, and sparc
define it.
sound/soc/fsl/fsl_ssi.c:705:26: error: 'NO_IRQ' undeclared (first use
in this function)
make[4]: *** [sound/soc/fsl/fsl_ssi.o] Error 1
http://kisskb.ellerman.id.au/kisskb/buildresult/9187959/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH 1/2] powerpc: Add smp_generic_cpu_bootable
From: Andy Fleming @ 2013-07-25 22:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
Cell and PSeries both implemented their own versions of a
cpu_bootable smp_op which do the same thing (well, the PSeries
one has support for more than 2 threads). Copy the PSeries one
to generic code, and rename it smp_generic_cpu_bootable.
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
arch/powerpc/include/asm/smp.h | 2 ++
arch/powerpc/kernel/smp.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index ffbaabe..f2b5d41 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -182,6 +182,8 @@ extern int smt_enabled_at_boot;
extern int smp_mpic_probe(void);
extern void smp_mpic_setup_cpu(int cpu);
extern int smp_generic_kick_cpu(int nr);
+extern int smp_generic_cpu_bootable(unsigned int nr);
+
extern void smp_generic_give_timebase(void);
extern void smp_generic_take_timebase(void);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 38b0ba6..3cd42aa 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -81,6 +81,29 @@ int smt_enabled_at_boot = 1;
static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
+/*
+ * Returns 1 if the specified cpu should be brought up during boot.
+ * Used to inhibit booting threads if they've been disabled or
+ * limited on the command line
+ */
+int smp_generic_cpu_bootable(unsigned int nr)
+{
+ /* Special case - we inhibit secondary thread startup
+ * during boot if the user requests it.
+ */
+ if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
+ if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
+ return 0;
+ if (smt_enabled_at_boot
+ && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
+ return 0;
+ }
+
+ return 1;
+}
+EXPORT_SYMBOL(smp_generic_cpu_bootable);
+
+
#ifdef CONFIG_PPC64
int smp_generic_kick_cpu(int nr)
{
--
1.7.9.7
^ permalink raw reply related
* [PATCH 2/2] powerpc: Convert platforms to smp_generic_cpu_bootable
From: Andy Fleming @ 2013-07-25 22:02 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1374789726-10633-1-git-send-email-afleming@freescale.com>
T4, Cell, powernv, and pseries had the same implementation, so switch
them to use a generic version. A2 apparently had a version, but
removed it at some point, so we remove the declaration, too.
Signed-off-by: Andy Fleming <afleming@freescale.com>
Conflicts:
arch/powerpc/platforms/cell/smp.c
arch/powerpc/platforms/powernv/smp.c
arch/powerpc/platforms/pseries/smp.c
Change-Id: If12e2f83f7187ee5982dca9f89c68e0600f0cc49
---
arch/powerpc/platforms/85xx/smp.c | 1 +
arch/powerpc/platforms/cell/smp.c | 15 +--------------
arch/powerpc/platforms/powernv/smp.c | 18 +-----------------
arch/powerpc/platforms/pseries/smp.c | 18 +-----------------
arch/powerpc/platforms/wsp/wsp.h | 1 -
5 files changed, 4 insertions(+), 49 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 5ced4f5..ea9c626 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -255,6 +255,7 @@ out:
struct smp_ops_t smp_85xx_ops = {
.kick_cpu = smp_85xx_kick_cpu,
+ .cpu_bootable = smp_generic_cpu_bootable,
#ifdef CONFIG_HOTPLUG_CPU
.cpu_disable = generic_cpu_disable,
.cpu_die = generic_cpu_die,
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index f75f6fc..90745ea 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -136,25 +136,12 @@ static int smp_cell_kick_cpu(int nr)
return 0;
}
-static int smp_cell_cpu_bootable(unsigned int nr)
-{
- /* Special case - we inhibit secondary thread startup
- * during boot if the user requests it. Odd-numbered
- * cpus are assumed to be secondary threads.
- */
- if (system_state == SYSTEM_BOOTING &&
- cpu_has_feature(CPU_FTR_SMT) &&
- !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
- return 0;
-
- return 1;
-}
static struct smp_ops_t bpa_iic_smp_ops = {
.message_pass = iic_message_pass,
.probe = smp_iic_probe,
.kick_cpu = smp_cell_kick_cpu,
.setup_cpu = smp_cell_setup_cpu,
- .cpu_bootable = smp_cell_cpu_bootable,
+ .cpu_bootable = smp_generic_cpu_bootable,
};
/* This is called very early */
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 89e3857..908672b 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -46,22 +46,6 @@ static void pnv_smp_setup_cpu(int cpu)
xics_setup_cpu();
}
-static int pnv_smp_cpu_bootable(unsigned int nr)
-{
- /* Special case - we inhibit secondary thread startup
- * during boot if the user requests it.
- */
- if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
- if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
- return 0;
- if (smt_enabled_at_boot
- && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
- return 0;
- }
-
- return 1;
-}
-
int pnv_smp_kick_cpu(int nr)
{
unsigned int pcpu = get_hard_smp_processor_id(nr);
@@ -195,7 +179,7 @@ static struct smp_ops_t pnv_smp_ops = {
.probe = xics_smp_probe,
.kick_cpu = pnv_smp_kick_cpu,
.setup_cpu = pnv_smp_setup_cpu,
- .cpu_bootable = pnv_smp_cpu_bootable,
+ .cpu_bootable = smp_generic_cpu_bootable,
#ifdef CONFIG_HOTPLUG_CPU
.cpu_disable = pnv_smp_cpu_disable,
.cpu_die = generic_cpu_die,
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 306643c..ca2d1f6 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -187,22 +187,6 @@ static int smp_pSeries_kick_cpu(int nr)
return 0;
}
-static int smp_pSeries_cpu_bootable(unsigned int nr)
-{
- /* Special case - we inhibit secondary thread startup
- * during boot if the user requests it.
- */
- if (system_state == SYSTEM_BOOTING && cpu_has_feature(CPU_FTR_SMT)) {
- if (!smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
- return 0;
- if (smt_enabled_at_boot
- && cpu_thread_in_core(nr) >= smt_enabled_at_boot)
- return 0;
- }
-
- return 1;
-}
-
/* Only used on systems that support multiple IPI mechanisms */
static void pSeries_cause_ipi_mux(int cpu, unsigned long data)
{
@@ -237,7 +221,7 @@ static struct smp_ops_t pSeries_xics_smp_ops = {
.probe = pSeries_smp_probe,
.kick_cpu = smp_pSeries_kick_cpu,
.setup_cpu = smp_xics_setup_cpu,
- .cpu_bootable = smp_pSeries_cpu_bootable,
+ .cpu_bootable = smp_generic_cpu_bootable,
};
/* This is called very early */
diff --git a/arch/powerpc/platforms/wsp/wsp.h b/arch/powerpc/platforms/wsp/wsp.h
index 62ef21a..a563a8a 100644
--- a/arch/powerpc/platforms/wsp/wsp.h
+++ b/arch/powerpc/platforms/wsp/wsp.h
@@ -17,7 +17,6 @@ extern void scom_init_wsp(void);
extern void a2_setup_smp(void);
extern int a2_scom_startup_cpu(unsigned int lcpu, int thr_idx,
struct device_node *np);
-extern int smp_a2_cpu_bootable(unsigned int nr);
extern int smp_a2_kick_cpu(int nr);
extern void opb_pic_init(void);
--
1.7.9.7
^ permalink raw reply related
* Re: [PATCH] module: ppc64 module CRC relocation fix causes perf issues
From: Anton Blanchard @ 2013-07-26 1:19 UTC (permalink / raw)
To: Neil Horman
Cc: Rusty Russell, linux-kernel, Paul Mackerras, Scott Wood,
linuxppc-dev
In-Reply-To: <20130725130212.GA19366@hmsreliant.think-freely.org>
Hi Neil,
> Sorry I'm a bit late to the thread, I've ben swamped. Has someone
> tested this with kexec/kdump? Thats why the origional patch was
> created, because when kexec loads the kernel at a different physical
> address, the relocations messed with the module crc's, and modules
> couldn't load during the kexec boot. Assuming that kernaddr_start
> gets set appropriately during boot, using PHYSICAL_START should be
> fine, but I wanted to check, and don't currently have access to a
> powerpc system to do so. Neil
I tested a relocatable kernel forced to run at a non zero physical
address (ie basically kdump). I verified CRCs were bad with your
original patch backed out, and were good with this patch applied.
Anton
^ permalink raw reply
* SIGSTKSZ/MINSIGSTKSZ too small on 64bit
From: Anton Blanchard @ 2013-07-26 2:23 UTC (permalink / raw)
To: Michael Neuling, Alan Modra, Ryan Arnold; +Cc: linuxppc-dev
Hi,
Alan has been looking at a glibc test fail. His analysis shows SEGVs
in signal handlers using sigaltstack, and that MINSIGSTKSZ and SIGSTKSZ
are too small.
We increased the size of rt_sigframe in commit 2b0a576d15e0
(powerpc: Add new transactional memory state to the signal context) but
didn't bump either SIGSTKSZ and MINSIGSTKSZ. We need to do that in both
the kernel and glibc, but I'm a bit worried we could have broken
existing applications that use sigaltstack.
Anton
^ permalink raw reply
* Re: [RFC PATCH 4/5] cpuidle/ppc: CPU goes tickless if there are no arch-specific constraints
From: Preeti U Murthy @ 2013-07-26 2:39 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: deepthi, shangw, arnd, linux-pm, geoff, linux-kernel, rostedt,
rjw, paul.gortmaker, paulus, srivatsa.bhat, schwidefsky,
john.stultz, tglx, paulmck, linuxppc-dev, chenhui.zhao
In-Reply-To: <20130725133044.GA7400@somewhere>
Hi Frederic,
On 07/25/2013 07:00 PM, Frederic Weisbecker wrote:
> On Thu, Jul 25, 2013 at 02:33:02PM +0530, Preeti U Murthy wrote:
>> In the current design of timer offload framework, the broadcast cpu should
>> *not* go into tickless idle so as to avoid missed wakeups on CPUs in deep idle states.
>>
>> Since we prevent the CPUs entering deep idle states from programming the lapic of the
>> broadcast cpu for their respective next local events for reasons mentioned in
>> PATCH[3/5], the broadcast CPU checks if there are any CPUs to be woken up during
>> each of its timer interrupt programmed to its local events.
>>
>> With tickless idle, the broadcast CPU might not get a timer interrupt till after
>> many ticks which can result in missed wakeups on CPUs in deep idle states. By
>> disabling tickless idle, worst case, the tick_sched hrtimer will trigger a
>> timer interrupt every period to check for broadcast.
>>
>> However the current setup of tickless idle does not let us make the choice
>> of tickless on individual cpus. NOHZ_MODE_INACTIVE which disables tickless idle,
>> is a system wide setting. Hence resort to an arch specific call to check if a cpu
>> can go into tickless idle.
>
> Hi Preeti,
>
> I'm not exactly sure why you can't enter the broadcast CPU in dynticks idle mode.
> I read in the previous patch that's because in dynticks idle mode the broadcast
> CPU deactivates its lapic so it doesn't receive the IPI. But may be I misunderstood.
> Anyway that's not good for powersaving.
Let me elaborate. The CPUs in deep idle states have their lapics
deactivated. This means the next timer event which would typically have
been taken care of by a lapic firing at the appropriate moment does not
get taken care of in deep idle states, due to the lapic being switched off.
Hence such CPUs offload their next timer event to the broadcast CPU,
which should *not* enter deep idle states. The broadcast CPU has the
responsibility of waking the CPUs in deep idle states.
*The lapic of a broadcast CPU is active always*. Say CPUX, wants the
broadcast CPU to wake it up at timeX. Since we cannot program the lapic
of a remote CPU, CPUX will need to send an IPI to the broadcast CPU,
asking it to program its lapic to fire at timeX so as to wake up CPUX.
*With multiple CPUs the overhead of sending IPI, could result in
performance bottlenecks and may not scale well.*
Hence the workaround is that the broadcast CPU on each of its timer
interrupt checks if any of the next timer event of a CPU in deep idle
state has expired, which can very well be found from dev->next_event of
that CPU. For example the timeX that has been mentioned above has
expired. If so the broadcast handler is called to send an IPI to the
idling CPU to wake it up.
*If the broadcast CPU, is in tickless idle, its timer interrupt could be
many ticks away. It could miss waking up a CPU in deep idle*, if its
wakeup is much before this timer interrupt of the broadcast CPU. But
without tickless idle, atleast at each period we are assured of a timer
interrupt. At which time broadcast handling is done as stated in the
previous paragraph and we will not miss wakeup of CPUs in deep idle states.
Yeah it is true that not allowing the broadcast CPU to enter tickless
idle is bad for power savings, but for the use case that we are aiming
at in this patch series, the current approach seems to be the best, with
minimal trade-offs in performance, power savings, scalability and no
change in the broadcast framework that exists today in the kernel.
>
> Also when an arch wants to prevent a CPU from entering dynticks idle mode, it typically
> use arch_needs_cpu(). May be that could fit for you as well?
Oh ok thanks :) I will look into this and get back on if we can use it.
Regards
Preeti U Murthy
^ permalink raw reply
* Re: [RFC PATCH 4/5] cpuidle/ppc: CPU goes tickless if there are no arch-specific constraints
From: Preeti U Murthy @ 2013-07-26 3:03 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: deepthi, shangw, arnd, linux-pm, geoff, linux-kernel, rostedt,
rjw, paul.gortmaker, paulus, srivatsa.bhat, schwidefsky,
john.stultz, tglx, paulmck, linuxppc-dev, chenhui.zhao
In-Reply-To: <20130725133044.GA7400@somewhere>
Hi Frederic,
On 07/25/2013 07:00 PM, Frederic Weisbecker wrote:
> On Thu, Jul 25, 2013 at 02:33:02PM +0530, Preeti U Murthy wrote:
>> In the current design of timer offload framework, the broadcast cpu should
>> *not* go into tickless idle so as to avoid missed wakeups on CPUs in deep idle states.
>>
>> Since we prevent the CPUs entering deep idle states from programming the lapic of the
>> broadcast cpu for their respective next local events for reasons mentioned in
>> PATCH[3/5], the broadcast CPU checks if there are any CPUs to be woken up during
>> each of its timer interrupt programmed to its local events.
>>
>> With tickless idle, the broadcast CPU might not get a timer interrupt till after
>> many ticks which can result in missed wakeups on CPUs in deep idle states. By
>> disabling tickless idle, worst case, the tick_sched hrtimer will trigger a
>> timer interrupt every period to check for broadcast.
>>
>> However the current setup of tickless idle does not let us make the choice
>> of tickless on individual cpus. NOHZ_MODE_INACTIVE which disables tickless idle,
>> is a system wide setting. Hence resort to an arch specific call to check if a cpu
>> can go into tickless idle.
>
> Hi Preeti,
>
> I'm not exactly sure why you can't enter the broadcast CPU in dynticks idle mode.
> I read in the previous patch that's because in dynticks idle mode the broadcast
> CPU deactivates its lapic so it doesn't receive the IPI. But may be I misunderstood.
> Anyway that's not good for powersaving.
>
> Also when an arch wants to prevent a CPU from entering dynticks idle mode, it typically
> use arch_needs_cpu(). May be that could fit for you as well?
Yes this will suit our requirement perfectly. I will note down this
change for the next version of this patchset. Thank you very much for
pointing this out :)
Regards
Preeti U Murthy
^ permalink raw reply
* Re: [RFC PATCH 4/5] cpuidle/ppc: CPU goes tickless if there are no arch-specific constraints
From: Paul Mackerras @ 2013-07-26 3:19 UTC (permalink / raw)
To: Preeti U Murthy
Cc: deepthi, shangw, arnd, linux-pm, geoff, Frederic Weisbecker,
linux-kernel, rostedt, rjw, paul.gortmaker, john.stultz,
srivatsa.bhat, schwidefsky, tglx, paulmck, linuxppc-dev,
chenhui.zhao
In-Reply-To: <51F1E15B.3050106@linux.vnet.ibm.com>
On Fri, Jul 26, 2013 at 08:09:23AM +0530, Preeti U Murthy wrote:
> Hi Frederic,
>
> On 07/25/2013 07:00 PM, Frederic Weisbecker wrote:
> > Hi Preeti,
> >
> > I'm not exactly sure why you can't enter the broadcast CPU in dynticks idle mode.
> > I read in the previous patch that's because in dynticks idle mode the broadcast
> > CPU deactivates its lapic so it doesn't receive the IPI. But may be I misunderstood.
> > Anyway that's not good for powersaving.
>
> Let me elaborate. The CPUs in deep idle states have their lapics
> deactivated. This means the next timer event which would typically have
> been taken care of by a lapic firing at the appropriate moment does not
> get taken care of in deep idle states, due to the lapic being switched off.
I really don't think it's helpful to use the term "lapic" in
connection with Power systems. There is nothing that is called a
"lapic" in a Power machine. The nearest equivalent of the LAPIC on
x86 machines is the ICP, the interrupt-controller presentation
element, of which there is one per CPU thread.
However, I don't believe the ICP gets disabled in deep sleep modes.
What does get disabled is the "decrementer", which is a register that
normally counts down (at 512MHz) and generates an exception when it is
negative. The decrementer *is* part of the CPU core, unlike the ICP.
That's why we can still get IPIs but not timer interrupts.
Please reword your patch description to not use the term "lapic",
which is not defined in the Power context and is therefore just
causing confusion.
Paul.
^ permalink raw reply
* [PATCH v2 3/3] powerpc/85xx: Add C293PCIE board support
From: Po Liu @ 2013-07-26 2:41 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Mingkai Hu, afleming, Po Liu
In-Reply-To: <1374806479-812-1-git-send-email-Po.Liu@freescale.com>
From: Mingkai Hu <Mingkai.Hu@freescale.com>
C293PCIE board is a series of Freescale PCIe add-in cards to perform
as public key crypto accelerator or secure key management module.
- 512KB platform SRAM in addition to 512K L2 Cache/SRAM
- 512MB soldered DDR3 32bit memory
- CPLD System Logic
- 64MB x16 NOR flash and 4GB x8 NAND flash
- 16MB SPI flash
Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
Signed-off-by: Po Liu <Po.Liu@freescale.com>
---
Changes for v2:
- Remove the JFFS2 partitions in NOR/NAND/SPI flash;
- Implement the NAND partitions;
- Remove the no use descriptions for cpld node;
- Add mpc85xx_smp_defconfig and mpc85xx_defconfig for C293;
- Remove the no use includes in c293pcie.c
arch/powerpc/boot/dts/c293pcie.dts | 243 +++++++++++++++++++++++++++++
arch/powerpc/configs/mpc85xx_defconfig | 1 +
arch/powerpc/configs/mpc85xx_smp_defconfig | 1 +
arch/powerpc/platforms/85xx/Kconfig | 6 +
arch/powerpc/platforms/85xx/Makefile | 1 +
arch/powerpc/platforms/85xx/c293pcie.c | 75 +++++++++
6 files changed, 327 insertions(+)
create mode 100644 arch/powerpc/boot/dts/c293pcie.dts
create mode 100644 arch/powerpc/platforms/85xx/c293pcie.c
diff --git a/arch/powerpc/boot/dts/c293pcie.dts b/arch/powerpc/boot/dts/c293pcie.dts
new file mode 100644
index 0000000..dc91c47
--- /dev/null
+++ b/arch/powerpc/boot/dts/c293pcie.dts
@@ -0,0 +1,243 @@
+/*
+ * C293 PCIE Device Tree Source
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/include/ "fsl/c293si-pre.dtsi"
+
+/ {
+ model = "fsl,C293PCIE";
+ compatible = "fsl,C293PCIE";
+
+ memory {
+ device_type = "memory";
+ };
+
+ ifc: ifc@fffe1e000 {
+ reg = <0xf 0xffe1e000 0 0x2000>;
+ ranges = <0x0 0x0 0xf 0xec000000 0x04000000
+ 0x2 0x0 0xf 0xffdf0000 0x00010000>;
+
+ };
+
+ soc: soc@fffe00000 {
+ ranges = <0x0 0xf 0xffe00000 0x100000>;
+ };
+
+ pci0: pcie@fffe0a000 {
+ reg = <0xf 0xffe0a000 0 0x1000>;
+ ranges = <0x2000000 0x0 0x80000000 0xc 0x00000000 0x0 0x20000000
+ 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>;
+ pcie@0 {
+ ranges = <0x2000000 0x0 0x80000000
+ 0x2000000 0x0 0x80000000
+ 0x0 0x20000000
+
+ 0x1000000 0x0 0x0
+ 0x1000000 0x0 0x0
+ 0x0 0x100000>;
+ };
+ };
+};
+
+&ifc {
+ nor@0,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "cfi-flash";
+ reg = <0x0 0x0 0x4000000>;
+ bank-width = <2>;
+ device-width = <1>;
+
+ partition@0 {
+ /* 1MB for DTB Image */
+ reg = <0x0 0x00100000>;
+ label = "NOR DTB Image";
+ };
+
+ partition@100000 {
+ /* 8 MB for Linux Kernel Image */
+ reg = <0x00100000 0x00800000>;
+ label = "NOR Linux Kernel Image";
+ };
+
+ partition@900000 {
+ /* 53MB for rootfs */
+ reg = <0x00900000 0x03500000>;
+ label = "NOR Rootfs Image";
+ };
+
+ partition@3e00000 {
+ /* 1MB for blob encrypted key */
+ reg = <0x03e00000 0x00100000>;
+ label = "NOR blob encrypted key";
+ };
+
+ partition@3f00000 {
+ /* 512KB for u-boot Bootloader Image and evn */
+ reg = <0x03f00000 0x00100000>;
+ label = "NOR U-Boot Image";
+ read-only;
+ };
+ };
+
+ nand@1,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,ifc-nand";
+ reg = <0x1 0x0 0x10000>;
+
+ partition@0 {
+ /* This location must not be altered */
+ /* 1MB for u-boot Bootloader Image */
+ reg = <0x0 0x00100000>;
+ label = "NAND U-Boot Image";
+ read-only;
+ };
+
+ partition@100000 {
+ /* 1MB for DTB Image */
+ reg = <0x00100000 0x00100000>;
+ label = "NAND DTB Image";
+ };
+
+ partition@200000 {
+ /* 4MB for Linux Kernel Image */
+ reg = <0x00200000 0x00400000>;
+ label = "NAND Linux Kernel Image";
+ };
+
+ partition@600000 {
+ /* 19MB for Compressed Root file System Image */
+ reg = <0x00600000 0x01300000>;
+ label = "NAND Compressed RFS Image";
+ };
+
+ partition@1900000 {
+ /* 7MB for User Area */
+ reg = <0x01900000 0x00700000>;
+ label = "NAND User area";
+ };
+
+ partition@2000000 {
+ /* 96MB for Root File System */
+ reg = <0x02000000 0x06000000>;
+ label = "NAND Root File System";
+ };
+
+ partition@8000000 {
+ /* 3968MB for Others */
+ reg = <0x08000000 0xF8000000>;
+ label = "NAND Others";
+ };
+ };
+
+ cpld@2,0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,c293pcie-cpld";
+ reg = <0x2 0x0 0x20>;
+ };
+};
+
+&soc {
+ i2c@3000 {
+ eeprom@50 {
+ compatible = "st,24c1024";
+ reg = <0x50>;
+ };
+
+ adt7461@4c {
+ compatible = "adi,adt7461";
+ reg = <0x4c>;
+ };
+ };
+
+ spi@7000 {
+ flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "spansion,s25sl12801";
+ reg = <0>;
+ spi-max-frequency = <50000000>;
+
+ partition@0 {
+ /* 1MB for u-boot Bootloader Image */
+ /* 1MB for Environment */
+ reg = <0x0 0x00100000>;
+ label = "SPI Flash U-Boot Image";
+ read-only;
+ };
+
+ partition@100000 {
+ /* 512KB for DTB Image */
+ reg = <0x00100000 0x00080000>;
+ label = "SPI Flash DTB Image";
+ };
+
+ partition@180000 {
+ /* 4MB for Linux Kernel Image */
+ reg = <0x00180000 0x00400000>;
+ label = "SPI Flash Linux Kernel Image";
+ };
+
+ partition@580000 {
+ /* 10.5MB for Compressed RFS Image */
+ reg = <0x00580000 0x00a80000>;
+ label = "SPI Flash Compressed RFSImage";
+ };
+ };
+ };
+
+ mdio@24000 {
+ phy0: ethernet-phy@0 {
+ interrupts = <2 1 0 0>;
+ reg = <0x0>;
+ };
+
+ phy1: ethernet-phy@1 {
+ interrupts = <2 1 0 0>;
+ reg = <0x2>;
+ };
+ };
+
+ enet0: ethernet@b0000 {
+ phy-handle = <&phy0>;
+ phy-connection-type = "rgmii-id";
+ };
+
+ enet1: ethernet@b1000 {
+ phy-handle = <&phy1>;
+ phy-connection-type = "rgmii-id";
+ };
+};
+/include/ "fsl/c293si-post.dtsi"
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index 5a58882..1592f8c 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -27,6 +27,7 @@ CONFIG_MPC85xx_MDS=y
CONFIG_MPC8536_DS=y
CONFIG_MPC85xx_DS=y
CONFIG_MPC85xx_RDB=y
+CONFIG_C293_PCIE=y
CONFIG_P1010_RDB=y
CONFIG_P1022_DS=y
CONFIG_P1022_RDK=y
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index 152fa05..d6549ff 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -30,6 +30,7 @@ CONFIG_MPC85xx_MDS=y
CONFIG_MPC8536_DS=y
CONFIG_MPC85xx_DS=y
CONFIG_MPC85xx_RDB=y
+CONFIG_C293_PCIE=y
CONFIG_P1010_RDB=y
CONFIG_P1022_DS=y
CONFIG_P1022_RDK=y
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index efdd37c..42fc72a 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -32,6 +32,12 @@ config BSC9131_RDB
StarCore SC3850 DSP
Manufacturer : Freescale Semiconductor, Inc
+config C293_PCIE
+ bool "Freescale C293PCIE"
+ select DEFAULT_UIMAGE
+ help
+ This option enables support for the C293PCIE board
+
config MPC8540_ADS
bool "Freescale MPC8540 ADS"
select DEFAULT_UIMAGE
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index 2eab37e..53c9f75 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_SMP) += smp.o
obj-y += common.o
obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o
+obj-$(CONFIG_C293_PCIE) += c293pcie.o
obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o
obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/c293pcie.c b/arch/powerpc/platforms/85xx/c293pcie.c
new file mode 100644
index 0000000..6208e49
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/c293pcie.c
@@ -0,0 +1,75 @@
+/*
+ * C293PCIE Board Setup
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/udbg.h>
+#include <asm/mpic.h>
+
+#include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
+
+#include "mpc85xx.h"
+
+void __init c293_pcie_pic_init(void)
+{
+ struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
+ MPIC_SINGLE_DEST_CPU, 0, 256, " OpenPIC ");
+
+ BUG_ON(mpic == NULL);
+
+ mpic_init(mpic);
+}
+
+
+/*
+ * Setup the architecture
+ */
+static void __init c293_pcie_setup_arch(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("c293_pcie_setup_arch()", 0);
+
+ fsl_pci_assign_primary();
+
+ printk(KERN_INFO "C293 PCIE board from Freescale Semiconductor\n");
+}
+
+machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices);
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init c293_pcie_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+
+ if (of_flat_dt_is_compatible(root, "fsl,C293PCIE"))
+ return 1;
+ return 0;
+}
+
+define_machine(c293_pcie) {
+ .name = "C293 PCIE",
+ .probe = c293_pcie_probe,
+ .setup_arch = c293_pcie_setup_arch,
+ .init_IRQ = c293_pcie_pic_init,
+#ifdef CONFIG_PCI
+ .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+#endif
+ .get_irq = mpic_get_irq,
+ .restart = fsl_rstcr_restart,
+ .calibrate_decr = generic_calibrate_decr,
+ .progress = udbg_progress,
+};
--
1.8.0
^ permalink raw reply related
* [PATCH v2 1/3] powerpc/85xx: Add SEC6.0 device tree
From: Po Liu @ 2013-07-26 2:41 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Mingkai Hu, afleming, Po Liu
In-Reply-To: <1366854857-22791-4-git-send-email-Po.Liu@freescale.com>
From: Mingkai Hu <Mingkai.Hu@freescale.com>
Add device tree for SEC 6.0 used on C29x silicon.
Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
Signed-off-by: Po Liu <Po.Liu@freescale.com>
---
Changes for v2:
- Remove the compatible sec v4.0/v4.4/v5.0;
- Add the device tree binding file fsl-sec6.txt;
.../devicetree/bindings/crypto/fsl-sec6.txt | 162 +++++++++++++++++++++
arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi | 56 +++++++
2 files changed, 218 insertions(+)
create mode 100644 Documentation/devicetree/bindings/crypto/fsl-sec6.txt
create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi
diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec6.txt b/Documentation/devicetree/bindings/crypto/fsl-sec6.txt
new file mode 100644
index 0000000..f6d2a69
--- /dev/null
+++ b/Documentation/devicetree/bindings/crypto/fsl-sec6.txt
@@ -0,0 +1,162 @@
+SEC 6 is as Freescale's Cryptographic Accelerator and Assurance Module (CAAM).
+Currently Freescale powerpc chip C29X is embeded with SEC 6.
+SEC 6 device tree binding include:
+ -SEC 6 Node
+ -Job Ring Node
+ -Full Example
+
+=====================================================================
+SEC 6 Node
+
+Description
+
+ Node defines the base address of the SEC 6 block.
+ This block specifies the address range of all global
+ configuration registers for the SEC 6 block.
+ For example, In C293, we could see three SEC 6 node.
+
+PROPERTIES
+
+ - compatible
+ Usage: required
+ Value type: <string>
+ Definition: Must include "fsl,sec-v6.0"
+
+ - fsl,sec-era
+ Usage: optional
+ Value type: <u32>
+ Definition: A standard property. Define the 'ERA' of the SEC
+ device.
+
+ - #address-cells
+ Usage: required
+ Value type: <u32>
+ Definition: A standard property. Defines the number of cells
+ for representing physical addresses in child nodes.
+
+ - #size-cells
+ Usage: required
+ Value type: <u32>
+ Definition: A standard property. Defines the number of cells
+ for representing the size of physical addresses in
+ child nodes.
+
+ - reg
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A standard property. Specifies the physical
+ address and length of the SEC 6 configuration registers.
+ registers
+
+ - ranges
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A standard property. Specifies the physical address
+ range of the SEC 6.0 register space (-SNVS not included). A
+ triplet that includes the child address, parent address, &
+ length.
+
+ Note: All other standard properties (see the ePAPR) are allowed
+ but are optional.
+
+
+EXAMPLE
+ crypto@a0000 {
+ compatible = "fsl,sec-v6.0";
+ fsl,sec-era = <6>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ reg = <0xa0000 0x20000>;
+ ranges = <0 0xa0000 0x20000>;
+ };
+
+=====================================================================
+Job Ring (JR) Node
+
+ Child of the crypto node defines data processing interface to SEC 6
+ across the peripheral bus for purposes of processing
+ cryptographic descriptors. The specified address
+ range can be made visible to one (or more) cores.
+ The interrupt defined for this node is controlled within
+ the address range of this node.
+
+ - compatible
+ Usage: required
+ Value type: <string>
+ Definition: Must include "fsl,sec-v6.0-job-ring", if it is
+ back compatible with old version, better add them all.
+
+ - reg
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Specifies a two JR parameters: an offset from
+ the parent physical address and the length the JR registers.
+
+ - interrupts
+ Usage: required
+ Value type: <prop_encoded-array>
+ Definition: Specifies the interrupts generated by this
+ device. The value of the interrupts property
+ consists of one interrupt specifier. The format
+ of the specifier is defined by the binding document
+ describing the node's interrupt parent.
+
+EXAMPLE
+ jr@1000 {
+ compatible = "fsl,sec-v6.0-job-ring";
+ reg = <0x1000 0x1000>;
+ interrupts = <49 2 0 0>;
+ };
+
+===================================================================
+Full Example
+
+Since some chips may embeded with more than one SEC 6, we abstract
+all the same properties into one file qoriq-sec6.0-0.dtsi. Each chip
+want to binding the node could simply include it in its own device
+node tree. Below is full example in C293PCIE:
+
+In qoriq-sec6.0-0.dtsi:
+
+ compatible = "fsl,sec-v6.0";
+ fsl,sec-era = <6>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ jr@1000 {
+ compatible = "fsl,sec-v6.0-job-ring",
+ "fsl,sec-v5.2-job-ring",
+ "fsl,sec-v5.0-job-ring",
+ "fsl,sec-v4.4-job-ring",
+ "fsl,sec-v4.0-job-ring";
+ reg = <0x1000 0x1000>;
+ };
+
+ jr@2000 {
+ compatible = "fsl,sec-v6.0-job-ring",
+ "fsl,sec-v5.2-job-ring",
+ "fsl,sec-v5.0-job-ring",
+ "fsl,sec-v4.4-job-ring",
+ "fsl,sec-v4.0-job-ring";
+ reg = <0x2000 0x1000>;
+ };
+
+In the C293 device tree, we add the include of public property:
+
+crypto@a0000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+ };
+
+ crypto@a0000 {
+ reg = <0xa0000 0x20000>;
+ ranges = <0x0 0xa0000 0x20000>;
+
+ jr@1000{
+ interrupts = <49 2 0 0>;
+ };
+ jr@2000{
+ interrupts = <50 2 0 0>;
+ };
+ };
+
+
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi
new file mode 100644
index 0000000..f75b4f820
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sec6.0-0.dtsi
@@ -0,0 +1,56 @@
+/*
+ * QorIQ Sec/Crypto 6.0 device tree stub
+ *
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+ compatible = "fsl,sec-v6.0";
+ fsl,sec-era = <6>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ jr@1000 {
+ compatible = "fsl,sec-v6.0-job-ring",
+ "fsl,sec-v5.2-job-ring",
+ "fsl,sec-v5.0-job-ring",
+ "fsl,sec-v4.4-job-ring",
+ "fsl,sec-v4.0-job-ring";
+ reg = <0x1000 0x1000>;
+ };
+
+ jr@2000 {
+ compatible = "fsl,sec-v6.0-job-ring",
+ "fsl,sec-v5.2-job-ring",
+ "fsl,sec-v5.0-job-ring",
+ "fsl,sec-v4.4-job-ring",
+ "fsl,sec-v4.0-job-ring";
+ reg = <0x2000 0x1000>;
+ };
--
1.8.0
^ permalink raw reply related
* [PATCH v2 2/3] powerpc/85xx: Add silicon device tree for C293
From: Po Liu @ 2013-07-26 2:41 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Mingkai Hu, afleming, Po Liu
In-Reply-To: <1374806479-812-1-git-send-email-Po.Liu@freescale.com>
From: Mingkai Hu <Mingkai.Hu@freescale.com>
Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com>
Signed-off-by: Po Liu <Po.Liu@freescale.com>
---
Changes for v2:
- None
arch/powerpc/boot/dts/fsl/c293si-post.dtsi | 193 +++++++++++++++++++++++++++++
arch/powerpc/boot/dts/fsl/c293si-pre.dtsi | 63 ++++++++++
2 files changed, 256 insertions(+)
create mode 100644 arch/powerpc/boot/dts/fsl/c293si-post.dtsi
create mode 100644 arch/powerpc/boot/dts/fsl/c293si-pre.dtsi
diff --git a/arch/powerpc/boot/dts/fsl/c293si-post.dtsi b/arch/powerpc/boot/dts/fsl/c293si-post.dtsi
new file mode 100644
index 0000000..bd20832
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/c293si-post.dtsi
@@ -0,0 +1,193 @@
+/*
+ * C293 Silicon/SoC Device Tree Source (post include)
+ *
+ * Copyright 2012 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+&ifc {
+ #address-cells = <2>;
+ #size-cells = <1>;
+ compatible = "fsl,ifc", "simple-bus";
+ interrupts = <19 2 0 0>;
+};
+
+/* controller at 0xa000 */
+&pci0 {
+ compatible = "fsl,qoriq-pcie-v2.2", "fsl,qoriq-pcie";
+ device_type = "pci";
+ #size-cells = <2>;
+ #address-cells = <3>;
+ bus-range = <0 255>;
+ clock-frequency = <33333333>;
+ interrupts = <16 2 0 0>;
+
+ pcie@0 {
+ reg = <0 0 0 0 0>;
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ device_type = "pci";
+ interrupts = <16 2 0 0>;
+ interrupt-map-mask = <0xf800 0 0 7>;
+ interrupt-map = <
+ /* IDSEL 0x0 */
+ 0000 0x0 0x0 0x1 &mpic 0x0 0x1 0x0 0x0
+ 0000 0x0 0x0 0x2 &mpic 0x1 0x1 0x0 0x0
+ 0000 0x0 0x0 0x3 &mpic 0x2 0x1 0x0 0x0
+ 0000 0x0 0x0 0x4 &mpic 0x3 0x1 0x0 0x0
+ >;
+ };
+};
+
+&soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ device_type = "soc";
+ compatible = "simple-bus";
+ bus-frequency = <0>; // Filled out by uboot.
+
+ ecm-law@0 {
+ compatible = "fsl,ecm-law";
+ reg = <0x0 0x1000>;
+ fsl,num-laws = <12>;
+ };
+
+ ecm@1000 {
+ compatible = "fsl,c293-ecm", "fsl,ecm";
+ reg = <0x1000 0x1000>;
+ interrupts = <16 2 0 0>;
+ };
+
+ memory-controller@2000 {
+ compatible = "fsl,c293-memory-controller";
+ reg = <0x2000 0x1000>;
+ interrupts = <16 2 0 0>;
+ };
+
+/include/ "pq3-i2c-0.dtsi"
+/include/ "pq3-i2c-1.dtsi"
+/include/ "pq3-duart-0.dtsi"
+/include/ "pq3-espi-0.dtsi"
+ spi0: spi@7000 {
+ fsl,espi-num-chipselects = <1>;
+ };
+
+/include/ "pq3-gpio-0.dtsi"
+ L2: l2-cache-controller@20000 {
+ compatible = "fsl,c293-l2-cache-controller";
+ reg = <0x20000 0x1000>;
+ cache-line-size = <32>; // 32 bytes
+ cache-size = <0x80000>; // L2,512K
+ interrupts = <16 2 0 0>;
+ };
+
+/include/ "pq3-dma-0.dtsi"
+/include/ "pq3-esdhc-0.dtsi"
+ sdhc@2e000 {
+ compatible = "fsl,c293-esdhc", "fsl,esdhc";
+ sdhci,auto-cmd12;
+ };
+
+ crypto@80000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+ };
+
+ crypto@80000 {
+ reg = <0x80000 0x20000>;
+ ranges = <0x0 0x80000 0x20000>;
+
+ jr@1000{
+ interrupts = <45 2 0 0>;
+ };
+ jr@2000{
+ interrupts = <57 2 0 0>;
+ };
+ };
+
+ crypto@a0000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+ };
+
+ crypto@a0000 {
+ reg = <0xa0000 0x20000>;
+ ranges = <0x0 0xa0000 0x20000>;
+
+ jr@1000{
+ interrupts = <49 2 0 0>;
+ };
+ jr@2000{
+ interrupts = <50 2 0 0>;
+ };
+ };
+
+ crypto@c0000 {
+/include/ "qoriq-sec6.0-0.dtsi"
+ };
+
+ crypto@c0000 {
+ reg = <0xc0000 0x20000>;
+ ranges = <0x0 0xc0000 0x20000>;
+
+ jr@1000{
+ interrupts = <55 2 0 0>;
+ };
+ jr@2000{
+ interrupts = <56 2 0 0>;
+ };
+ };
+
+/include/ "pq3-mpic.dtsi"
+/include/ "pq3-mpic-timer-B.dtsi"
+
+/include/ "pq3-etsec2-0.dtsi"
+ enet0: ethernet@b0000 {
+ queue-group@b0000 {
+ reg = <0x10000 0x1000>;
+ fsl,rx-bit-map = <0xff>;
+ fsl,tx-bit-map = <0xff>;
+ };
+ };
+
+/include/ "pq3-etsec2-1.dtsi"
+ enet1: ethernet@b1000 {
+ queue-group@b1000 {
+ reg = <0x11000 0x1000>;
+ fsl,rx-bit-map = <0xff>;
+ fsl,tx-bit-map = <0xff>;
+ };
+ };
+
+ global-utilities@e0000 {
+ compatible = "fsl,c293-guts";
+ reg = <0xe0000 0x1000>;
+ fsl,has-rstcr;
+ };
+};
diff --git a/arch/powerpc/boot/dts/fsl/c293si-pre.dtsi b/arch/powerpc/boot/dts/fsl/c293si-pre.dtsi
new file mode 100644
index 0000000..065049d
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/c293si-pre.dtsi
@@ -0,0 +1,63 @@
+/*
+ * C293 Silicon/SoC Device Tree Source (pre include)
+ *
+ * Copyright 2012 Freescale Semiconductor Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Freescale Semiconductor nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ *
+ * ALTERNATIVELY, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") as published by the Free Software
+ * Foundation, either version 2 of that License or (at your option) any
+ * later version.
+ *
+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/dts-v1/;
+
+/include/ "e500v2_power_isa.dtsi"
+
+/ {
+ compatible = "fsl,C293";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ interrupt-parent = <&mpic>;
+
+ aliases {
+ serial0 = &serial0;
+ serial1 = &serial1;
+ ethernet0 = &enet0;
+ ethernet1 = &enet1;
+ pci0 = &pci0;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ PowerPC,e500v2@0 {
+ device_type = "cpu";
+ reg = <0x0>;
+ next-level-cache = <&L2>;
+ };
+ };
+};
--
1.8.0
^ permalink raw reply related
* Re: [RFC PATCH 4/5] cpuidle/ppc: CPU goes tickless if there are no arch-specific constraints
From: Preeti U Murthy @ 2013-07-26 3:35 UTC (permalink / raw)
To: Paul Mackerras
Cc: deepthi, shangw, arnd, linux-pm, geoff, Frederic Weisbecker,
linux-kernel, rostedt, rjw, paul.gortmaker, john.stultz,
srivatsa.bhat, schwidefsky, tglx, paulmck, linuxppc-dev,
chenhui.zhao
In-Reply-To: <20130726031950.GA6438@iris.ozlabs.ibm.com>
Hi Paul,
On 07/26/2013 08:49 AM, Paul Mackerras wrote:
> On Fri, Jul 26, 2013 at 08:09:23AM +0530, Preeti U Murthy wrote:
>> Hi Frederic,
>>
>> On 07/25/2013 07:00 PM, Frederic Weisbecker wrote:
>>> Hi Preeti,
>>>
>>> I'm not exactly sure why you can't enter the broadcast CPU in dynticks idle mode.
>>> I read in the previous patch that's because in dynticks idle mode the broadcast
>>> CPU deactivates its lapic so it doesn't receive the IPI. But may be I misunderstood.
>>> Anyway that's not good for powersaving.
>>
>> Let me elaborate. The CPUs in deep idle states have their lapics
>> deactivated. This means the next timer event which would typically have
>> been taken care of by a lapic firing at the appropriate moment does not
>> get taken care of in deep idle states, due to the lapic being switched off.
>
> I really don't think it's helpful to use the term "lapic" in
> connection with Power systems. There is nothing that is called a
> "lapic" in a Power machine. The nearest equivalent of the LAPIC on
> x86 machines is the ICP, the interrupt-controller presentation
> element, of which there is one per CPU thread.
>
> However, I don't believe the ICP gets disabled in deep sleep modes.
> What does get disabled is the "decrementer", which is a register that
> normally counts down (at 512MHz) and generates an exception when it is
> negative. The decrementer *is* part of the CPU core, unlike the ICP.
> That's why we can still get IPIs but not timer interrupts.
>
> Please reword your patch description to not use the term "lapic",
> which is not defined in the Power context and is therefore just
> causing confusion.
Noted. Thank you :) I will probably send out a fresh patchset with the
appropriate changelog to avoid this confusion ?
>
> Paul.
>
Regards
Preeti U murthy
^ permalink raw reply
* Re: [RFC 11/14] powerpc: Eliminate NO_IRQ usage
From: Grant Likely @ 2013-07-26 3:56 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linux-Arch, Stephen Rothwell, Russell King,
linux-kernel@vger.kernel.org, Rob Herring, Linux-Next,
Thomas Gleixner, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <CAMuHMdV=pSG+CtvGqr1c9nDKeHCU0cVQcFkfAo5iMMna2HOvZg@mail.gmail.com>
On Thu, Jul 25, 2013 at 3:58 PM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Wed, Jan 11, 2012 at 9:22 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
>> NO_IRQ is evil. Stop using it in arch/powerpc and powerpc device drivers
>
>> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
>> index 3e06696..55c6ff9 100644
>> --- a/sound/soc/fsl/fsl_ssi.c
>> +++ b/sound/soc/fsl/fsl_ssi.c
>> @@ -666,7 +666,7 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
>> ssi_private->ssi_phys = res.start;
>>
>> ssi_private->irq = irq_of_parse_and_map(np, 0);
>> - if (ssi_private->irq == NO_IRQ) {
>> + if (!ssi_private->irq) {
>> dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
>> ret = -ENXIO;
>> goto error_iomap;
>
> What's the plan with this patch?
>
> This is now failing on xtensa, as it's one of the architectures that doesn't
> define NO_IRQ. Only arm, c6x, mn10300, openrisc, parisc, powerpc, and sparc
> define it.
Wow. I'd pretty much dropped that patch because I didn't have time to
chase it down. It should be pursued though.
In that particular case it is safe I think to apply the change. PPC
defines NO_IRQ to be 0 anyway.
g.
^ permalink raw reply
* Re: [Suggestion] powerpc: xmon: about 'longjmp' related warning.
From: Chen Gang @ 2013-07-26 4:11 UTC (permalink / raw)
To: Michael Ellerman
Cc: Michael Neuling, paulus@samba.org, Andrew Morton,
linuxppc-dev@lists.ozlabs.org, jovi.zhangwei
In-Reply-To: <51EF21FD.9020509@asianux.com>
On 07/24/2013 08:38 AM, Chen Gang wrote:
> On 07/23/2013 09:58 PM, Michael Ellerman wrote:
>> On Mon, Jul 22, 2013 at 03:02:53PM +0800, Chen Gang wrote:
>>> Hello Maintainers:
>>>
>>> With allmodconfig and EXTRA_CFLAGS=-W", it reports warnings below:
>>
>>>
>>> arch/powerpc/xmon/xmon.c:3027:6: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
>>> arch/powerpc/xmon/xmon.c:3068:6: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
>>
>> In both these cases we are inside the body of a for loop and we do a
>> if (setjmp) / else block. Although looking at the source the value of i
>> is not modified by the setjmp, I guess it's possible that the compiler
>> might reorder the increment of i inside the setjmp and loose the value
>> when we longjmp.
>>
>
> I should continue to confirm the details based on your valuable
> information, thanks.
>
>
For stop_spus() and restart_spus(), at least now, the related warnings
are not issue: the variable 'i' is stored in stack "120(r1)".
The related warning:
arch/powerpc/xmon/xmon.c:3027:6: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
arch/powerpc/xmon/xmon.c:3068:6: warning: variable ‘i’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
The related source code:
3024 static void stop_spus(void)
3025 {
3026 struct spu *spu;
3027 int i;
3028 u64 tmp;
3029
3030 for (i = 0; i < XMON_NUM_SPUS; i++) { /* XMON_NUM_SPUS == 16 */
3031 if (!spu_info[i].spu)
3032 continue;
3033
3034 if (setjmp(bus_error_jmp) == 0) {
3035 catch_memory_errors = 1;
3036 sync();
3037
3038 spu = spu_info[i].spu;
3039
3040 spu_info[i].saved_spu_runcntl_RW =
3041 in_be32(&spu->problem->spu_runcntl_RW);
3042
3043 tmp = spu_mfc_sr1_get(spu);
3044 spu_info[i].saved_mfc_sr1_RW = tmp;
3045
3046 tmp &= ~MFC_STATE1_MASTER_RUN_CONTROL_MASK;
3047 spu_mfc_sr1_set(spu, tmp);
3048
3049 sync();
3050 __delay(200);
3051
3052 spu_info[i].stopped_ok = 1;
3053
3054 printf("Stopped spu %.2d (was %s)\n", i,
3055 spu_info[i].saved_spu_runcntl_RW ?
3056 "running" : "stopped");
3057 } else {
3058 catch_memory_errors = 0;
3059 printf("*** Error stopping spu %.2d\n", i);
3060 }
3061 catch_memory_errors = 0;
3062 }
3063 }
3064
The related disassembly code:
"make ARCH=powerpc EXTRA_CFLAGS=-W"
"powerpc64-linux-gnu-objdump -d vmlinux.o > vmlinux.S"
"gcc version 4.7.1 20120606 (Red Hat 4.7.1-0.1.20120606) (GCC)"
"GNU objdump version 2.23.51.0.3-1.fc16 20120918"
c00000000007cfd0 <.stop_spus>:
/* { */
c00000000007cfd0: 7c 08 02 a6 mflr r0
c00000000007cfd4: fb c1 ff f0 std r30,-16(r1)
c00000000007cfd8: fb e1 ff f8 std r31,-8(r1)
c00000000007cfdc: 3d 22 00 0f addis r9,r2,15
c00000000007cfe0: 39 29 3e 10 addi r9,r9,15888
c00000000007cfe4: 3d 02 ff d4 addis r8,r2,-44
c00000000007cfe8: 39 29 21 50 addi r9,r9,8528
c00000000007cfec: 3d 42 ff d4 addis r10,r2,-44
c00000000007cff0: 39 08 83 f8 addi r8,r8,-31752
c00000000007cff4: 39 4a 83 d8 addi r10,r10,-31784
c00000000007cff8: f8 01 00 10 std r0,16(r1)
c00000000007cffc: f8 21 ff 51 stdu r1,-176(r1)
c00000000007d000: f9 21 00 70 std r9,112(r1)
c00000000007d004: 39 20 00 00 li r9,0
c00000000007d008: f9 21 00 78 std r9,120(r1) ; i = 0;
c00000000007d00c: f9 01 00 88 std r8,136(r1)
c00000000007d010: f9 41 00 90 std r10,144(r1)
c00000000007d014: 48 00 01 28 b c00000000007d13c <.stop_spus+0x16c>
c00000000007d018: 60 00 00 00 nop
c00000000007d01c: 60 00 00 00 nop
/* if (setjmp(bus_error_jmp) == 0) { */
c00000000007d020: 3d 22 00 0f addis r9,r2,15
c00000000007d024: 39 40 00 01 li r10,1
c00000000007d028: 39 29 3e 10 addi r9,r9,15888
c00000000007d02c: 91 49 20 c0 stw r10,8384(r9)
c00000000007d030: 7c 00 04 ac sync
c00000000007d034: 4c 00 01 2c isync
c00000000007d038: e9 01 00 80 ld r8,128(r1)
c00000000007d03c: eb e8 00 00 ld r31,0(r8)
c00000000007d040: e9 3f 00 20 ld r9,32(r31)
c00000000007d044: 7c 00 04 ac sync
c00000000007d048: 81 29 40 1c lwz r9,16412(r9)
c00000000007d04c: 0c 09 00 00 twi 0,r9,0
c00000000007d050: 4c 00 01 2c isync
c00000000007d054: 91 28 00 10 stw r9,16(r8)
c00000000007d058: 3d 22 00 0f addis r9,r2,15
c00000000007d05c: 3b c9 f5 e8 addi r30,r9,-2584
c00000000007d060: 7f e3 fb 78 mr r3,r31
c00000000007d064: e9 3e 00 00 ld r9,0(r30)
c00000000007d068: e9 29 00 60 ld r9,96(r9)
c00000000007d06c: e9 49 00 00 ld r10,0(r9)
c00000000007d070: f8 41 00 28 std r2,40(r1)
c00000000007d074: 7d 49 03 a6 mtctr r10
c00000000007d078: e8 49 00 08 ld r2,8(r9)
c00000000007d07c: 4e 80 04 21 bctrl
c00000000007d080: e8 41 00 28 ld r2,40(r1)
c00000000007d084: e9 01 00 80 ld r8,128(r1)
c00000000007d088: e9 3e 00 00 ld r9,0(r30)
c00000000007d08c: f8 68 00 08 std r3,8(r8)
c00000000007d090: 7c 64 1b 78 mr r4,r3
c00000000007d094: 78 84 d0 42 rldicl r4,r4,58,1
c00000000007d098: 7f e3 fb 78 mr r3,r31
c00000000007d09c: 78 84 30 00 rotldi r4,r4,6
c00000000007d0a0: e9 29 00 58 ld r9,88(r9)
c00000000007d0a4: e9 49 00 00 ld r10,0(r9)
c00000000007d0a8: f8 41 00 28 std r2,40(r1)
c00000000007d0ac: 7d 49 03 a6 mtctr r10
c00000000007d0b0: e8 49 00 08 ld r2,8(r9)
c00000000007d0b4: 4e 80 04 21 bctrl
c00000000007d0b8: e8 41 00 28 ld r2,40(r1)
c00000000007d0bc: 7c 00 04 ac sync
c00000000007d0c0: 4c 00 01 2c isync
c00000000007d0c4: 38 60 00 c8 li r3,200
c00000000007d0c8: 4b fa 01 e9 bl c00000000001d2b0 <.__delay> ; __delay(200)
c00000000007d0cc: 60 00 00 00 nop
c00000000007d0d0: e9 01 00 80 ld r8,128(r1)
c00000000007d0d4: 39 40 00 01 li r10,1
c00000000007d0d8: 81 28 00 10 lwz r9,16(r8)
c00000000007d0dc: 99 48 00 20 stb r10,32(r8)
c00000000007d0e0: 3d 02 ff d4 addis r8,r2,-44
c00000000007d0e4: 38 a8 83 c8 addi r5,r8,-31800
c00000000007d0e8: 2f 89 00 00 cmpwi cr7,r9,0
c00000000007d0ec: 40 9e 00 0c bne- cr7,c00000000007d0f8 <.stop_spus+0x128>
c00000000007d0f0: 3d 22 ff d4 addis r9,r2,-44
c00000000007d0f4: 38 a9 83 d0 addi r5,r9,-31792
c00000000007d0f8: e8 61 00 90 ld r3,144(r1)
c00000000007d0fc: e8 81 00 78 ld r4,120(r1) ; 120(r1) = i
c00000000007d100: 48 00 67 41 bl c000000000083840 <.xmon_printf>
c00000000007d104: 60 00 00 00 nop
/* catch_memory_errors = 0; */
c00000000007d108: 3d 22 00 0f addis r9,r2,15
c00000000007d10c: 39 40 00 00 li r10,0
c00000000007d110: 39 29 3e 10 addi r9,r9,15888
c00000000007d114: 91 49 20 c0 stw r10,8384(r9)
/* for (i = 0; i < XMON_NUM_SPUS; i++) { */
c00000000007d118: e9 01 00 78 ld r8,120(r1) ; 120(r1) = i;
c00000000007d11c: 39 28 00 01 addi r9,r8,1 ; i++
c00000000007d120: 2f 89 00 10 cmpwi cr7,r9,16 ; i < XMON_NUM_SPUS
c00000000007d124: 7d 29 07 b4 extsw r9,r9
c00000000007d128: f9 21 00 78 std r9,120(r1) ; 120(r1) = i;
c00000000007d12c: e9 21 00 70 ld r9,112(r1) ;
c00000000007d130: 39 29 00 28 addi r9,r9,40 ; 112(r1) = [i] for spu_info;
c00000000007d134: f9 21 00 70 std r9,112(r1) ;
c00000000007d138: 41 9e 00 58 beq- cr7,c00000000007d190 <.stop_spus+0x1c0>
/* if (!spu_info[i].spu) */
/* continue; */
c00000000007d13c: e9 01 00 70 ld r8,112(r1)
c00000000007d140: 3d 42 00 0f addis r10,r2,15
c00000000007d144: 38 6a 5e 18 addi r3,r10,24088
c00000000007d148: e9 28 00 00 ld r9,0(r8)
c00000000007d14c: f9 01 00 80 std r8,128(r1)
c00000000007d150: 2f a9 00 00 cmpdi cr7,r9,0
c00000000007d154: 41 9e ff c4 beq+ cr7,c00000000007d118 <.stop_spus+0x148>
/* if (setjmp(bus_error_jmp) == 0) { */
c00000000007d158: 4b fa 44 99 bl c0000000000215f0 <.setjmp>
c00000000007d15c: 60 00 00 00 nop
c00000000007d160: 2f a3 00 00 cmpdi cr7,r3,0
c00000000007d164: e8 81 00 78 ld r4,120(r1) ; 120(r1) = i for 2nd param of printf in exception processing after setjmp.
c00000000007d168: e8 61 00 88 ld r3,136(r1)
c00000000007d16c: 41 9e fe b4 beq+ cr7,c00000000007d020 <.stop_spus+0x50>
/* } else { */
c00000000007d170: 3d 42 00 0f addis r10,r2,15
c00000000007d174: 39 00 00 00 li r8,0
c00000000007d178: 39 4a 3e 10 addi r10,r10,15888
c00000000007d17c: 91 0a 20 c0 stw r8,8384(r10) /* catch_memory_errors = 0; */
c00000000007d180: 48 00 66 c1 bl c000000000083840 <.xmon_printf> /* called with correct i */
c00000000007d184: 60 00 00 00 nop
c00000000007d188: 4b ff ff 80 b c00000000007d108 <.stop_spus+0x138>
c00000000007d18c: 60 00 00 00 nop
/* } */
c00000000007d190: 38 21 00 b0 addi r1,r1,176
c00000000007d194: e8 01 00 10 ld r0,16(r1)
c00000000007d198: eb c1 ff f0 ld r30,-16(r1)
c00000000007d19c: eb e1 ff f8 ld r31,-8(r1)
c00000000007d1a0: 7c 08 03 a6 mtlr r0
c00000000007d1a4: 4e 80 00 20 blr
c00000000007d1a8: 60 00 00 00 nop
c00000000007d1ac: 60 00 00 00 nop
/* } */
The related assembly code (they really save and restore 'r1'):
_GLOBAL(setjmp)
mflr r0
PPC_STL r0,0(r3)
PPC_STL r1,SZL(r3)
PPC_STL r2,2*SZL(r3)
mfcr r0
PPC_STL r0,3*SZL(r3)
PPC_STL r13,4*SZL(r3)
PPC_STL r14,5*SZL(r3)
PPC_STL r15,6*SZL(r3)
PPC_STL r16,7*SZL(r3)
PPC_STL r17,8*SZL(r3)
PPC_STL r18,9*SZL(r3)
PPC_STL r19,10*SZL(r3)
PPC_STL r20,11*SZL(r3)
PPC_STL r21,12*SZL(r3)
PPC_STL r22,13*SZL(r3)
PPC_STL r23,14*SZL(r3)
PPC_STL r24,15*SZL(r3)
PPC_STL r25,16*SZL(r3)
PPC_STL r26,17*SZL(r3)
PPC_STL r27,18*SZL(r3)
PPC_STL r28,19*SZL(r3)
PPC_STL r29,20*SZL(r3)
PPC_STL r30,21*SZL(r3)
PPC_STL r31,22*SZL(r3)
li r3,0
blr
_GLOBAL(longjmp)
PPC_LCMPI r4,0
bne 1f
li r4,1
1: PPC_LL r13,4*SZL(r3)
PPC_LL r14,5*SZL(r3)
PPC_LL r15,6*SZL(r3)
PPC_LL r16,7*SZL(r3)
PPC_LL r17,8*SZL(r3)
PPC_LL r18,9*SZL(r3)
PPC_LL r19,10*SZL(r3)
PPC_LL r20,11*SZL(r3)
PPC_LL r21,12*SZL(r3)
PPC_LL r22,13*SZL(r3)
PPC_LL r23,14*SZL(r3)
PPC_LL r24,15*SZL(r3)
PPC_LL r25,16*SZL(r3)
PPC_LL r26,17*SZL(r3)
PPC_LL r27,18*SZL(r3)
PPC_LL r28,19*SZL(r3)
PPC_LL r29,20*SZL(r3)
PPC_LL r30,21*SZL(r3)
PPC_LL r31,22*SZL(r3)
PPC_LL r0,3*SZL(r3)
mtcrf 0x38,r0
PPC_LL r0,0(r3)
PPC_LL r1,SZL(r3)
PPC_LL r2,2*SZL(r3)
mtlr r0
mr r3,r4
blr
The same to resetart_spus()
3065 static void restart_spus(void)
3066 {
3067 struct spu *spu;
3068 int i;
3069
3070 for (i = 0; i < XMON_NUM_SPUS; i++) {
3071 if (!spu_info[i].spu)
3072 continue;
3073
3074 if (!spu_info[i].stopped_ok) {
3075 printf("*** Error, spu %d was not successfully stopped"
3076 ", not restarting\n", i);
3077 continue;
3078 }
3079
3080 if (setjmp(bus_error_jmp) == 0) {
3081 catch_memory_errors = 1;
3082 sync();
3083
3084 spu = spu_info[i].spu;
3085 spu_mfc_sr1_set(spu, spu_info[i].saved_mfc_sr1_RW);
3086 out_be32(&spu->problem->spu_runcntl_RW,
3087 spu_info[i].saved_spu_runcntl_RW);
3088
3089 sync();
3090 __delay(200);
3091
3092 printf("Restarted spu %.2d\n", i);
3093 } else {
3094 catch_memory_errors = 0;
3095 printf("*** Error restarting spu %.2d\n", i);
3096 }
3097 catch_memory_errors = 0;
3098 }
3099 }
3100
c00000000007d1b0 <.restart_spus>:
/* { */
c00000000007d1b0: 7c 08 02 a6 mflr r0
c00000000007d1b4: fb e1 ff f8 std r31,-8(r1)
c00000000007d1b8: 3d 22 00 0f addis r9,r2,15
c00000000007d1bc: 3c e2 ff d4 addis r7,r2,-44
c00000000007d1c0: 39 29 3e 10 addi r9,r9,15888
c00000000007d1c4: 3d 02 ff d4 addis r8,r2,-44
c00000000007d1c8: 39 29 21 50 addi r9,r9,8528
c00000000007d1cc: 3d 42 ff d4 addis r10,r2,-44
c00000000007d1d0: 38 e7 84 70 addi r7,r7,-31632
c00000000007d1d4: 39 08 84 58 addi r8,r8,-31656
c00000000007d1d8: f8 01 00 10 std r0,16(r1)
c00000000007d1dc: 39 4a 84 18 addi r10,r10,-31720
c00000000007d1e0: f8 21 ff 51 stdu r1,-176(r1)
c00000000007d1e4: f9 21 00 70 std r9,112(r1)
c00000000007d1e8: 39 20 00 00 li r9,0
c00000000007d1ec: f9 21 00 78 std r9,120(r1) ; i = 0;
c00000000007d1f0: f8 e1 00 88 std r7,136(r1)
c00000000007d1f4: f9 01 00 98 std r8,152(r1)
c00000000007d1f8: f9 41 00 90 std r10,144(r1)
c00000000007d1fc: 48 00 00 34 b c00000000007d230 <.restart_spus+0x80>
/* if (!spu_info[i].stopped_ok) { */
/* printf(....); */
/* continue; */
c00000000007d200: e8 61 00 90 ld r3,144(r1)
c00000000007d204: 48 00 66 3d bl c000000000083840 <.xmon_printf>
c00000000007d208: 60 00 00 00 nop
/* for (i = 0; i < XMON_NUM_SPUS; i++) { */
c00000000007d20c: e9 01 00 78 ld r8,120(r1)
c00000000007d210: 39 28 00 01 addi r9,r8,1 ; i++
c00000000007d214: 2f 89 00 10 cmpwi cr7,r9,16 ; i < XMON_NUM_SPUS
c00000000007d218: 7d 29 07 b4 extsw r9,r9
c00000000007d21c: f9 21 00 78 std r9,120(r1)
c00000000007d220: e9 21 00 70 ld r9,112(r1)
c00000000007d224: 39 29 00 28 addi r9,r9,40
c00000000007d228: f9 21 00 70 std r9,112(r1)
c00000000007d22c: 41 9e 01 0c beq- cr7,c00000000007d338 <.restart_spus+0x188>
/* if (!spu_info[i].spu) */
/* continue; */
c00000000007d230: e9 01 00 70 ld r8,112(r1)
c00000000007d234: 3d 42 00 0f addis r10,r2,15
c00000000007d238: e8 81 00 78 ld r4,120(r1) ; i as 2nd parameter for xmon_printf().
c00000000007d23c: 38 6a 5e 18 addi r3,r10,24088
c00000000007d240: e9 28 00 00 ld r9,0(r8)
c00000000007d244: f9 01 00 80 std r8,128(r1)
c00000000007d248: 2f a9 00 00 cmpdi cr7,r9,0
c00000000007d24c: 41 9e ff c0 beq+ cr7,c00000000007d20c <.restart_spus+0x5c>
/* if (!spu_info[i].stopped_ok) { */
c00000000007d250: 89 28 00 20 lbz r9,32(r8)
c00000000007d254: 2f 89 00 00 cmpwi cr7,r9,0
c00000000007d258: 41 9e ff a8 beq+ cr7,c00000000007d200 <.restart_spus+0x50>
/* } */
/* if (setjmp(bus_error_jmp) == 0) { */
c00000000007d25c: 4b fa 43 95 bl c0000000000215f0 <.setjmp>
c00000000007d260: 60 00 00 00 nop
c00000000007d264: 2f a3 00 00 cmpdi cr7,r3,0
c00000000007d268: e8 81 00 78 ld r4,120(r1) ; i as 2nd parameter for xmon_printf() after setjmp().
c00000000007d26c: e8 61 00 88 ld r3,136(r1)
c00000000007d270: 40 9e 00 e0 bne- cr7,c00000000007d350 <.restart_spus+0x1a0>
c00000000007d274: 3d 22 00 0f addis r9,r2,15
c00000000007d278: 39 40 00 01 li r10,1
c00000000007d27c: 39 29 3e 10 addi r9,r9,15888
c00000000007d280: 91 49 20 c0 stw r10,8384(r9)
c00000000007d284: 7c 00 04 ac sync
c00000000007d288: 4c 00 01 2c isync
c00000000007d28c: 3d 02 00 0f addis r8,r2,15
c00000000007d290: e9 41 00 80 ld r10,128(r1)
c00000000007d294: 39 28 f5 e8 addi r9,r8,-2584
c00000000007d298: eb ea 00 00 ld r31,0(r10)
c00000000007d29c: e8 8a 00 08 ld r4,8(r10)
c00000000007d2a0: e9 29 00 00 ld r9,0(r9)
c00000000007d2a4: 7f e3 fb 78 mr r3,r31
c00000000007d2a8: e9 29 00 58 ld r9,88(r9)
c00000000007d2ac: e9 49 00 00 ld r10,0(r9)
c00000000007d2b0: f8 41 00 28 std r2,40(r1)
c00000000007d2b4: 7d 49 03 a6 mtctr r10
c00000000007d2b8: e8 49 00 08 ld r2,8(r9)
c00000000007d2bc: 4e 80 04 21 bctrl
c00000000007d2c0: e8 41 00 28 ld r2,40(r1)
c00000000007d2c4: e9 01 00 80 ld r8,128(r1)
c00000000007d2c8: e9 3f 00 20 ld r9,32(r31)
c00000000007d2cc: 81 48 00 10 lwz r10,16(r8)
c00000000007d2d0: 7c 00 04 ac sync
c00000000007d2d4: 91 49 40 1c stw r10,16412(r9)
c00000000007d2d8: 39 20 00 01 li r9,1
c00000000007d2dc: 99 2d 02 74 stb r9,628(r13)
c00000000007d2e0: 7c 00 04 ac sync
c00000000007d2e4: 4c 00 01 2c isync
c00000000007d2e8: 38 60 00 c8 li r3,200
c00000000007d2ec: 4b f9 ff c5 bl c00000000001d2b0 <.__delay>
c00000000007d2f0: 60 00 00 00 nop
c00000000007d2f4: e8 61 00 98 ld r3,152(r1)
c00000000007d2f8: e8 81 00 78 ld r4,120(r1)
c00000000007d2fc: 48 00 65 45 bl c000000000083840 <.xmon_printf>
c00000000007d300: 60 00 00 00 nop
/* } */
/* for (i = 0; i < XMON_NUM_SPUS; i++) { */
c00000000007d304: e9 01 00 78 ld r8,120(r1)
c00000000007d308: 3d 22 00 0f addis r9,r2,15
c00000000007d30c: 39 40 00 00 li r10,0
c00000000007d310: 39 29 3e 10 addi r9,r9,15888
c00000000007d314: 91 49 20 c0 stw r10,8384(r9) ; catch_memory_errors = 0;
c00000000007d318: 39 28 00 01 addi r9,r8,1
c00000000007d31c: 2f 89 00 10 cmpwi cr7,r9,16 ; i < XMON_NUM_SPUS
c00000000007d320: 7d 29 07 b4 extsw r9,r9
c00000000007d324: f9 21 00 78 std r9,120(r1) ; i++;
c00000000007d328: e9 21 00 70 ld r9,112(r1)
c00000000007d32c: 39 29 00 28 addi r9,r9,40 ; [i] for spu_info
c00000000007d330: f9 21 00 70 std r9,112(r1)
c00000000007d334: 40 9e fe fc bne+ cr7,c00000000007d230 <.restart_spus+0x80>
/* } */
c00000000007d338: 38 21 00 b0 addi r1,r1,176
c00000000007d33c: e8 01 00 10 ld r0,16(r1)
c00000000007d340: eb e1 ff f8 ld r31,-8(r1)
c00000000007d344: 7c 08 03 a6 mtlr r0
c00000000007d348: 4e 80 00 20 blr
c00000000007d34c: 60 00 00 00 nop
/* } */
/* } else { */
c00000000007d350: 3d 42 00 0f addis r10,r2,15
c00000000007d354: 39 00 00 00 li r8,0
c00000000007d358: 39 4a 3e 10 addi r10,r10,15888
c00000000007d35c: 91 0a 20 c0 stw r8,8384(r10) ; catch_memory_errors = 0;
c00000000007d360: 48 00 64 e1 bl c000000000083840 <.xmon_printf>
c00000000007d364: 60 00 00 00 nop
c00000000007d368: 4b ff ff 9c b c00000000007d304 <.restart_spus+0x154>
c00000000007d36c: 60 00 00 00 nop
>>> arch/powerpc/xmon/xmon.c:352:48: warning: argument ‘fromipi’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered]
>>
>> This one I can't see, but I assume it's a similar case.
>>
>
> OK, I should continue for it.
>
>
>>> Excuse me, I am not quite sure about it whether can cause issue or not.
>>
>> I've never seen it get stuck in those loops or anything, but I guess
>> it's possible.
>>
>
> OK, I should make the confirmation.
>
>> The first thing to do would be to analyse the generated assembler code
>> to determine if there really is any possiblity of the value being
>> clobbered, or if it's just a theoretical bug.
>>
>
> Thank you for your valuable information again.
>
> Excuse me, I have to do another things within this month, so I should
> provide the confirmation within next month (2013-08-31), is it OK (no
> reply means OK).
>
> Welcome any suggestions or completions.
>
>
> Thanks.
>
--
Chen Gang
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox