* [PATCH 05/13] powerpc: Use list_add_(before|after) macros
From: Ken Helias @ 2014-06-06 17:34 UTC (permalink / raw)
To: Andrew Morton; +Cc: Ken Helias, linuxppc-dev, linux-kernel
In-Reply-To: <1402076072-4044-1-git-send-email-kenhelias@web.de>
From: Ken Helias <kenhelias@firemail.de>
Many places in the code uses list_add_tail/list_add to insert an entry
before/after another entry. This confuses the reader because these are usually
used to add an item to a list_head and not an entry. Better use the self
explaining function name.
Signed-off-by: Ken Helias <kenhelias@firemail.de>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/lib/rheap.c | 2 +-
arch/powerpc/mm/dma-noncoherent.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
index a1060a8..d8c5f16 100644
--- a/arch/powerpc/lib/rheap.c
+++ b/arch/powerpc/lib/rheap.c
@@ -486,7 +486,7 @@ unsigned long rh_alloc_align(rh_info_t * info, int size, int alignment, const ch
spblk->start = blk->start;
spblk->size = sp_size;
/* add before the blk */
- list_add(&spblk->list, blk->list.prev);
+ list_add_before(&spblk->list, &blk->list);
}
newblk = get_slot(info);
newblk->start = start;
diff --git a/arch/powerpc/mm/dma-noncoherent.c b/arch/powerpc/mm/dma-noncoherent.c
index d85e86a..222ae97 100644
--- a/arch/powerpc/mm/dma-noncoherent.c
+++ b/arch/powerpc/mm/dma-noncoherent.c
@@ -120,7 +120,7 @@ ppc_vm_region_alloc(struct ppc_vm_region *head, size_t size, gfp_t gfp)
/*
* Insert this entry _before_ the one we found.
*/
- list_add_tail(&new->vm_list, &c->vm_list);
+ list_add_before(&new->vm_list, &c->vm_list);
new->vm_start = addr;
new->vm_end = addr + size;
--
2.0.0
^ permalink raw reply related
* Re: [PATCH] powerpc/powernv: Fix endian issues in memory error handling code
From: Mahesh J Salgaonkar @ 2014-06-06 18:14 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <20140604144848.459a15e5@kryten>
On 2014-06-04 14:48:48 Wed, Anton Blanchard wrote:
> struct OpalMemoryErrorData is passed to us from firmware, so we
> have to byteswap it.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Tested-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
> ---
>
> Having enums in a firmware interface concerns me, but that cleanup
> can be in a subsequent patch.
>
> Mahesh, could you give this a test to see if it works?
>
> Index: b/arch/powerpc/include/asm/opal.h
> ===================================================================
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -482,7 +482,7 @@ enum OpalMemErr_DynErrType {
> struct OpalMemoryErrorData {
> enum OpalMemErr_Version version:8; /* 0x00 */
> enum OpalMemErrType type:8; /* 0x01 */
> - uint16_t flags; /* 0x02 */
> + __be16 flags; /* 0x02 */
> uint8_t reserved_1[4]; /* 0x04 */
>
> union {
> @@ -490,15 +490,15 @@ struct OpalMemoryErrorData {
> struct {
> enum OpalMemErr_ResilErrType resil_err_type:8;
> uint8_t reserved_1[7];
> - uint64_t physical_address_start;
> - uint64_t physical_address_end;
> + __be64 physical_address_start;
> + __be64 physical_address_end;
> } resilience;
> /* Dynamic memory deallocation error info */
> struct {
> enum OpalMemErr_DynErrType dyn_err_type:8;
> uint8_t reserved_1[7];
> - uint64_t physical_address_start;
> - uint64_t physical_address_end;
> + __be64 physical_address_start;
> + __be64 physical_address_end;
> } dyn_dealloc;
> } u;
> };
> Index: b/arch/powerpc/platforms/powernv/opal-memory-errors.c
> ===================================================================
> --- a/arch/powerpc/platforms/powernv/opal-memory-errors.c
> +++ b/arch/powerpc/platforms/powernv/opal-memory-errors.c
> @@ -47,12 +47,12 @@ static void handle_memory_error_event(st
> __func__, merr_evt->type);
> switch (merr_evt->type) {
> case OPAL_MEM_ERR_TYPE_RESILIENCE:
> - paddr_start = merr_evt->u.resilience.physical_address_start;
> - paddr_end = merr_evt->u.resilience.physical_address_end;
> + paddr_start = be64_to_cpu(merr_evt->u.resilience.physical_address_start);
> + paddr_end = be64_to_cpu(merr_evt->u.resilience.physical_address_end);
> break;
> case OPAL_MEM_ERR_TYPE_DYN_DALLOC:
> - paddr_start = merr_evt->u.dyn_dealloc.physical_address_start;
> - paddr_end = merr_evt->u.dyn_dealloc.physical_address_end;
> + paddr_start = be64_to_cpu(merr_evt->u.dyn_dealloc.physical_address_start);
> + paddr_end = be64_to_cpu(merr_evt->u.dyn_dealloc.physical_address_end);
> break;
> default:
> return;
>
--
Mahesh J Salgaonkar
^ permalink raw reply
* Re: [PATCH v9 3/3] drivers/vfio: EEH support for VFIO PCI device
From: Alex Williamson @ 2014-06-06 18:20 UTC (permalink / raw)
To: Gavin Shan; +Cc: aik, agraf, kvm-ppc, qiudayu, linuxppc-dev
In-Reply-To: <1402030856-11106-4-git-send-email-gwshan@linux.vnet.ibm.com>
On Fri, 2014-06-06 at 15:00 +1000, Gavin Shan wrote:
> The patch adds new IOCTL commands for sPAPR VFIO container device
> to support EEH functionality for PCI devices, which have been passed
> through from host to somebody else via VFIO.
>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Acked-by: Alexander Graf <agraf@suse.de>
> ---
> Documentation/vfio.txt | 87 +++++++++++++++++++++++++++++++++++--
> drivers/vfio/Makefile | 1 +
> drivers/vfio/pci/vfio_pci.c | 18 ++++++--
> drivers/vfio/vfio_iommu_spapr_tce.c | 17 +++++++-
> drivers/vfio/vfio_spapr_eeh.c | 87 +++++++++++++++++++++++++++++++++++++
> include/linux/vfio.h | 23 ++++++++++
> include/uapi/linux/vfio.h | 34 +++++++++++++++
> 7 files changed, 259 insertions(+), 8 deletions(-)
> create mode 100644 drivers/vfio/vfio_spapr_eeh.c
>
> diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt
> index b9ca023..3fa4538 100644
> --- a/Documentation/vfio.txt
> +++ b/Documentation/vfio.txt
> @@ -305,7 +305,15 @@ faster, the map/unmap handling has been implemented in real mode which provides
> an excellent performance which has limitations such as inability to do
> locked pages accounting in real time.
>
> -So 3 additional ioctls have been added:
> +4) According to sPAPR specification, A Partitionable Endpoint (PE) is an I/O
> +subtree that can be treated as a unit for the purposes of partitioning and
> +error recovery. A PE may be a single or multi-function IOA (IO Adapter), a
> +function of a multi-function IOA, or multiple IOAs (possibly including switch
> +and bridge structures above the multiple IOAs). PPC64 guests detect PCI errors
> +and recover from them via EEH RTAS services, which works on the basis of
> +additional ioctl commands.
> +
> +So 4 additional ioctls have been added:
>
> VFIO_IOMMU_SPAPR_TCE_GET_INFO - returns the size and the start
> of the DMA window on the PCI bus.
> @@ -316,9 +324,12 @@ So 3 additional ioctls have been added:
>
> VFIO_IOMMU_DISABLE - disables the container.
>
> + VFIO_EEH_PE_OP - provides an API for EEH setup, error detection and recovery.
>
> The code flow from the example above should be slightly changed:
>
> + struct vfio_eeh_pe_op pe_op = { .argsz = sizeof(pe_op) };
> +
> .....
> /* Add the group to the container */
> ioctl(group, VFIO_GROUP_SET_CONTAINER, &container);
> @@ -342,9 +353,79 @@ The code flow from the example above should be slightly changed:
> dma_map.flags = VFIO_DMA_MAP_FLAG_READ | VFIO_DMA_MAP_FLAG_WRITE;
>
> /* Check here is .iova/.size are within DMA window from spapr_iommu_info */
> -
> ioctl(container, VFIO_IOMMU_MAP_DMA, &dma_map);
> - .....
> +
> + /* Get a file descriptor for the device */
> + device = ioctl(group, VFIO_GROUP_GET_DEVICE_FD, "0000:06:0d.0");
> +
> + ....
> +
> + /* Gratuitous device reset and go... */
> + ioctl(device, VFIO_DEVICE_RESET);
> +
> + /* Make sure EEH is supported */
> + ioctl(container, VFIO_CHECK_EXTENSION, VFIO_EEH);
> +
> + /* Enable the EEH functionality on the device */
> + pe_op.op = VFIO_EEH_PE_ENABLE;
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> +
> + /* You're suggested to create additional data struct to represent
> + * PE, and put child devices belonging to same IOMMU group to the
> + * PE instance for later reference.
> + */
> +
> + /* Check the PE's state and make sure it's in functional state */
> + pe_op.op = VFIO_EEH_PE_GET_STATE;
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> +
> + /* Save device state using pci_save_state().
> + * EEH should be enabled on the specified device.
> + */
> +
> + ....
> +
> + /* When 0xFF's returned from reading PCI config space or IO BARs
> + * of the PCI device. Check the PE's state to see if that has been
> + * frozen.
> + */
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> +
> + /* Waiting for pending PCI transactions to be completed and don't
> + * produce any more PCI traffic from/to the affected PE until
> + * recovery is finished.
> + */
> +
> + /* Enable IO for the affected PE and collect logs. Usually, the
> + * standard part of PCI config space, AER registers are dumped
> + * as logs for further analysis.
> + */
> + pe_op.op = VFIO_EEH_PE_UNFREEZE_IO;
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> +
> + /*
> + * Issue PE reset: hot or fundamental reset. Usually, hot reset
> + * is enough. However, the firmware of some PCI adapters would
> + * require fundamental reset.
> + */
> + pe_op.op = VFIO_EEH_PE_RESET_HOT;
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> + pe_op.op = VFIO_EEH_PE_RESET_DEACTIVATE;
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> +
> + /* Configure the PCI bridges for the affected PE */
> + pe_op.op = VFIO_EEH_PE_CONFIGURE;
> + ioctl(container, VFIO_EEH_PE_OP, &pe_op);
> +
> + /* Restored state we saved at initialization time. pci_restore_state()
> + * is good enough as an example.
> + */
> +
> + /* Hopefully, error is recovered successfully. Now, you can resume to
> + * start PCI traffic to/from the affected PE.
> + */
> +
> + ....
>
> -------------------------------------------------------------------------------
>
> diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile
> index 72bfabc..50e30bc 100644
> --- a/drivers/vfio/Makefile
> +++ b/drivers/vfio/Makefile
> @@ -1,4 +1,5 @@
> obj-$(CONFIG_VFIO) += vfio.o
> obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o
> obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o
> +obj-$(CONFIG_EEH) += vfio_spapr_eeh.o
> obj-$(CONFIG_VFIO_PCI) += pci/
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index 7ba0424..0122665 100644
> --- a/drivers/vfio/pci/vfio_pci.c
> +++ b/drivers/vfio/pci/vfio_pci.c
> @@ -156,8 +156,10 @@ static void vfio_pci_release(void *device_data)
> {
> struct vfio_pci_device *vdev = device_data;
>
> - if (atomic_dec_and_test(&vdev->refcnt))
> + if (atomic_dec_and_test(&vdev->refcnt)) {
> + vfio_spapr_pci_eeh_release(vdev->pdev);
> vfio_pci_disable(vdev);
> + }
>
> module_put(THIS_MODULE);
> }
> @@ -165,19 +167,27 @@ static void vfio_pci_release(void *device_data)
> static int vfio_pci_open(void *device_data)
> {
> struct vfio_pci_device *vdev = device_data;
> + int ret;
>
> if (!try_module_get(THIS_MODULE))
> return -ENODEV;
>
> if (atomic_inc_return(&vdev->refcnt) == 1) {
> - int ret = vfio_pci_enable(vdev);
> + ret = vfio_pci_enable(vdev);
> + if (ret)
> + goto error;
> +
> + ret = vfio_spapr_pci_eeh_open(vdev->pdev);
> if (ret) {
> - module_put(THIS_MODULE);
> - return ret;
> + vfio_pci_disable(vdev);
> + goto error;
> }
> }
>
> return 0;
> +error:
> + module_put(THIS_MODULE);
> + return ret;
> }
>
> static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type)
> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
> index a84788b..730b4ef 100644
> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
> @@ -156,7 +156,16 @@ static long tce_iommu_ioctl(void *iommu_data,
>
> switch (cmd) {
> case VFIO_CHECK_EXTENSION:
> - return (arg == VFIO_SPAPR_TCE_IOMMU) ? 1 : 0;
> + switch (arg) {
> + case VFIO_SPAPR_TCE_IOMMU:
> + ret = 1;
> + break;
> + default:
> + ret = vfio_spapr_iommu_eeh_ioctl(NULL, cmd, arg);
> + break;
> + }
> +
> + return (ret < 0) ? 0 : ret;
>
> case VFIO_IOMMU_SPAPR_TCE_GET_INFO: {
> struct vfio_iommu_spapr_tce_info info;
> @@ -283,6 +292,12 @@ static long tce_iommu_ioctl(void *iommu_data,
> tce_iommu_disable(container);
> mutex_unlock(&container->lock);
> return 0;
> + case VFIO_EEH_PE_OP:
> + if (!container->tbl || !container->tbl->it_group)
> + return -ENODEV;
> +
> + return vfio_spapr_iommu_eeh_ioctl(container->tbl->it_group,
> + cmd, arg);
> }
>
> return -ENOTTY;
> diff --git a/drivers/vfio/vfio_spapr_eeh.c b/drivers/vfio/vfio_spapr_eeh.c
> new file mode 100644
> index 0000000..d438394
> --- /dev/null
> +++ b/drivers/vfio/vfio_spapr_eeh.c
> @@ -0,0 +1,87 @@
> +/*
> + * EEH functionality support for VFIO devices. The feature is only
> + * available on sPAPR compatible platforms.
> + *
> + * Copyright Gavin Shan, IBM Corporation 2014.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/uaccess.h>
> +#include <linux/vfio.h>
> +#include <asm/eeh.h>
> +
> +/* We might build address mapping here for "fast" path later */
> +int vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
> +{
> + return eeh_dev_open(pdev);
> +}
> +
> +void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
> +{
> + eeh_dev_release(pdev);
> +}
> +
> +long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
> + unsigned int cmd, unsigned long arg)
> +{
> + struct eeh_pe *pe;
> + struct vfio_eeh_pe_op op;
> + unsigned long minsz;
> + long ret = -EINVAL;
> +
> + switch (cmd) {
> + case VFIO_CHECK_EXTENSION:
> + if (arg == VFIO_EEH)
> + ret = eeh_enabled() ? 1 : 0;
> + else
> + ret = 0;
> + break;
> + case VFIO_EEH_PE_OP:
> + pe = eeh_iommu_group_to_pe(group);
> + if (!pe)
> + return -ENODEV;
> +
> + minsz = offsetofend(struct vfio_eeh_pe_op, op);
> + if (copy_from_user(&op, (void __user *)arg, minsz))
> + return -EFAULT;
> + if (op.argsz < minsz)
> + return -EINVAL;
I'm running low on comments, but I found one more. flags should be
tested as zero here or else we'll run into problems with adding new
functionality later. The caller could leave it uninitialized and pass
junk which would then break if we start using those flags. New
userspace on an old kernel could also intentionally pass flag bits that
we ignore and let through here.
How are you expecting this to go in, an ack from me then pushed through
AlexG's tree? Thanks,
Alex
> +
> + switch (op.op) {
> + case VFIO_EEH_PE_DISABLE:
> + ret = eeh_pe_set_option(pe, EEH_OPT_DISABLE);
> + break;
> + case VFIO_EEH_PE_ENABLE:
> + ret = eeh_pe_set_option(pe, EEH_OPT_ENABLE);
> + break;
> + case VFIO_EEH_PE_UNFREEZE_IO:
> + ret = eeh_pe_set_option(pe, EEH_OPT_THAW_MMIO);
> + break;
> + case VFIO_EEH_PE_UNFREEZE_DMA:
> + ret = eeh_pe_set_option(pe, EEH_OPT_THAW_DMA);
> + break;
> + case VFIO_EEH_PE_GET_STATE:
> + ret = eeh_pe_get_state(pe);
> + break;
> + case VFIO_EEH_PE_RESET_DEACTIVATE:
> + ret = eeh_pe_reset(pe, EEH_RESET_DEACTIVATE);
> + break;
> + case VFIO_EEH_PE_RESET_HOT:
> + ret = eeh_pe_reset(pe, EEH_RESET_HOT);
> + break;
> + case VFIO_EEH_PE_RESET_FUNDAMENTAL:
> + ret = eeh_pe_reset(pe, EEH_RESET_FUNDAMENTAL);
> + break;
> + case VFIO_EEH_PE_CONFIGURE:
> + ret = eeh_pe_configure(pe);
> + break;
> + default:
> + ret = -EINVAL;
> + }
> + }
> +
> + return ret;
> +}
> diff --git a/include/linux/vfio.h b/include/linux/vfio.h
> index 81022a52..0d3bb8f 100644
> --- a/include/linux/vfio.h
> +++ b/include/linux/vfio.h
> @@ -99,4 +99,27 @@ extern int vfio_external_user_iommu_id(struct vfio_group *group);
> extern long vfio_external_check_extension(struct vfio_group *group,
> unsigned long arg);
>
> +#ifdef CONFIG_EEH
> +extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
> +extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
> +extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
> + unsigned int cmd,
> + unsigned long arg);
> +#else
> +static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
> +{
> + return 0;
> +}
> +
> +static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)
> +{
> +}
> +
> +static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group,
> + unsigned int cmd,
> + unsigned long arg)
> +{
> + return -ENOTTY;
> +}
> +#endif /* CONFIG_EEH */
> #endif /* VFIO_H */
> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
> index cb9023d..6612974 100644
> --- a/include/uapi/linux/vfio.h
> +++ b/include/uapi/linux/vfio.h
> @@ -30,6 +30,9 @@
> */
> #define VFIO_DMA_CC_IOMMU 4
>
> +/* Check if EEH is supported */
> +#define VFIO_EEH 5
> +
> /*
> * The IOCTL interface is designed for extensibility by embedding the
> * structure length (argsz) and flags into structures passed between
> @@ -455,6 +458,37 @@ struct vfio_iommu_spapr_tce_info {
>
> #define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
>
> +/*
> + * EEH PE operation struct provides ways to:
> + * - enable/disable EEH functionality;
> + * - unfreeze IO/DMA for frozen PE;
> + * - read PE state;
> + * - reset PE;
> + * - configure PE.
> + */
> +struct vfio_eeh_pe_op {
> + __u32 argsz;
> + __u32 flags;
> + __u32 op;
> +};
> +
> +#define VFIO_EEH_PE_DISABLE 0 /* Disable EEH functionality */
> +#define VFIO_EEH_PE_ENABLE 1 /* Enable EEH functionality */
> +#define VFIO_EEH_PE_UNFREEZE_IO 2 /* Enable IO for frozen PE */
> +#define VFIO_EEH_PE_UNFREEZE_DMA 3 /* Enable DMA for frozen PE */
> +#define VFIO_EEH_PE_GET_STATE 4 /* PE state retrieval */
> +#define VFIO_EEH_PE_STATE_NORMAL 0 /* PE in functional state */
> +#define VFIO_EEH_PE_STATE_RESET 1 /* PE reset in progress */
> +#define VFIO_EEH_PE_STATE_STOPPED 2 /* Stopped DMA and IO */
> +#define VFIO_EEH_PE_STATE_STOPPED_DMA 4 /* Stopped DMA only */
> +#define VFIO_EEH_PE_STATE_UNAVAIL 5 /* State unavailable */
> +#define VFIO_EEH_PE_RESET_DEACTIVATE 5 /* Deassert PE reset */
> +#define VFIO_EEH_PE_RESET_HOT 6 /* Assert hot reset */
> +#define VFIO_EEH_PE_RESET_FUNDAMENTAL 7 /* Assert fundamental reset */
> +#define VFIO_EEH_PE_CONFIGURE 8 /* PE configuration */
> +
> +#define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
> +
> /* ***************************************************************** */
>
> #endif /* _UAPIVFIO_H */
^ permalink raw reply
* Re: [PATCH] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
From: Vivek Goyal @ 2014-06-06 18:27 UTC (permalink / raw)
To: Srivatsa S. Bhat
Cc: ego, matt, mahesh, kexec, linux-kernel, suzuki, ebiederm, paulus,
linuxppc-dev
In-Reply-To: <5391B473.2050809@linux.vnet.ibm.com>
On Fri, Jun 06, 2014 at 06:00:43PM +0530, Srivatsa S. Bhat wrote:
> On 06/04/2014 07:16 PM, Vivek Goyal wrote:
> > On Wed, Jun 04, 2014 at 08:09:25AM +1000, Benjamin Herrenschmidt wrote:
> >> On Wed, 2014-06-04 at 01:58 +0530, Srivatsa S. Bhat wrote:
> >>> Yep, that makes sense. But unfortunately I don't have enough insight into
> >>> why exactly powerpc has to online the CPUs before doing a kexec. I just
> >>> know from the commit log and the comment mentioned above (and from my own
> >>> experiments) that the CPUs will get stuck if they were offline. Perhaps
> >>> somebody more knowledgeable can explain this in detail and suggest a proper
> >>> long-term solution.
> >>>
> >>> Matt, Ben, any thoughts on this?
> >>
> >> The problem is with our "soft offline" which we do on some platforms. When we
> >> offline we don't actually send the CPUs back to firmware or anything like that.
> >>
> >> We put them into a very low low power loop inside Linux.
> >>
> >> The new kernel has no way to extract them from that loop. So we must re-"online"
> >> them before we kexec so they can be passed to the new kernel normally (or returned
> >> to firmware like we do on powernv).
> >
> > Srivatsa,
> >
> > Looks like your patch has been merged.
> >
> > I don't like the following change in arch independent code.
> >
> > /*
> > * migrate_to_reboot_cpu() disables CPU hotplug assuming that
> > * no further code needs to use CPU hotplug (which is true in
> > * the reboot case). However, the kexec path depends on using
> > * CPU hotplug again; so re-enable it here.
> > */
> > cpu_hotplug_enable();
> >
> > As it is very powerpc specific requirement, can you enable hotplug in powerpc
> > arch dependent code as a short term solution.
> >
>
> I didn't do that because that would mean that the _disable() would be
> performed inside kernel/kexec.c and the corresponding _enable() would
> be performed in arch/powerpc/kernel/machine_kexec_64.c -- with no apparent
> connection between them, which would have made them hard to relate.
Which we are doing anyway. The difference is that now we are doing it
for all arches.
If this is powerpc specific requirement, then we should limit this to
powerpc only and not let spill over in generic code.
And putting a big fat comment should take care of being able to figure
out why arch code is overwriting the generic code's decision. By putting
it in generic code and enforcing this on all arches does not buy us
anything, IMHO.
>
> > Ideally one needs to fix the requirement of online all cpus in powerpc
> > as a long term solution and then get rid of hotplug enable call.
> >
>
> Yes, I agree. I'm trying out a solution at the moment (see the 4
> preliminary patches I sent in my reply to Ben). If that works, we won't
> need the enable call on powerpc.
Thanks. This will help.
Thanks
Vivek
^ permalink raw reply
* Re: [PATCH] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
From: Srivatsa S. Bhat @ 2014-06-06 19:00 UTC (permalink / raw)
To: Vivek Goyal
Cc: ego, matt, mahesh, kexec, linux-kernel, suzuki, ebiederm, paulus,
linuxppc-dev
In-Reply-To: <20140606182720.GL1526@redhat.com>
On 06/06/2014 11:57 PM, Vivek Goyal wrote:
> On Fri, Jun 06, 2014 at 06:00:43PM +0530, Srivatsa S. Bhat wrote:
>> On 06/04/2014 07:16 PM, Vivek Goyal wrote:
>>> On Wed, Jun 04, 2014 at 08:09:25AM +1000, Benjamin Herrenschmidt wrote:
>>>> On Wed, 2014-06-04 at 01:58 +0530, Srivatsa S. Bhat wrote:
>>>>> Yep, that makes sense. But unfortunately I don't have enough insight into
>>>>> why exactly powerpc has to online the CPUs before doing a kexec. I just
>>>>> know from the commit log and the comment mentioned above (and from my own
>>>>> experiments) that the CPUs will get stuck if they were offline. Perhaps
>>>>> somebody more knowledgeable can explain this in detail and suggest a proper
>>>>> long-term solution.
>>>>>
>>>>> Matt, Ben, any thoughts on this?
>>>>
>>>> The problem is with our "soft offline" which we do on some platforms. When we
>>>> offline we don't actually send the CPUs back to firmware or anything like that.
>>>>
>>>> We put them into a very low low power loop inside Linux.
>>>>
>>>> The new kernel has no way to extract them from that loop. So we must re-"online"
>>>> them before we kexec so they can be passed to the new kernel normally (or returned
>>>> to firmware like we do on powernv).
>>>
>>> Srivatsa,
>>>
>>> Looks like your patch has been merged.
>>>
>>> I don't like the following change in arch independent code.
>>>
>>> /*
>>> * migrate_to_reboot_cpu() disables CPU hotplug assuming that
>>> * no further code needs to use CPU hotplug (which is true in
>>> * the reboot case). However, the kexec path depends on using
>>> * CPU hotplug again; so re-enable it here.
>>> */
>>> cpu_hotplug_enable();
>>>
>>> As it is very powerpc specific requirement, can you enable hotplug in powerpc
>>> arch dependent code as a short term solution.
>>>
>>
>> I didn't do that because that would mean that the _disable() would be
>> performed inside kernel/kexec.c and the corresponding _enable() would
>> be performed in arch/powerpc/kernel/machine_kexec_64.c -- with no apparent
>> connection between them, which would have made them hard to relate.
>
> Which we are doing anyway. The difference is that now we are doing it
> for all arches.
>
> If this is powerpc specific requirement, then we should limit this to
> powerpc only and not let spill over in generic code.
>
> And putting a big fat comment should take care of being able to figure
> out why arch code is overwriting the generic code's decision. By putting
> it in generic code and enforcing this on all arches does not buy us
> anything, IMHO.
>
Yep, I see your point. Sorry about that!
Actually, I originally thought of fixing cpu_hotplug_disable/enable itself:
their true intent is to prevent *userspace* (i.e., from sysfs) from performing
CPU hotplug after a certain quiescent point in the kernel, and not to prevent
the kernel's own cpu hotplug attempts. But currently it prevents _all_ hotplug,
including those that are initiated from within the kernel, which is the reason
why kexec was effectively locking itself out on powerpc. I explored options to
fix that (which would in turn fix the powerpc problem automatically, without
having to add any code to kernel/kexec.c or even arch/powerpc code). But it
turned out to be too difficult and ugly given the current CPU hotplug locking
scheme. I'll revisit that once CPU hotplug locking is cleaned up.
But anyway, the powerpc kexec fix that I'm working on right now is not only a
much better solution, but it will also restore the original kexec code in
kernel/kexec.c, by removing the _enable() call.
Thank you!
Regards,
Srivatsa S. Bhat
^ permalink raw reply
* Re: [linuxppc-release] [PATCH][v10] powerpc/mpc85xx:Add initial device tree support of T104x
From: Scott Wood @ 2014-06-06 20:47 UTC (permalink / raw)
To: Liu Shengzhou-B36685
Cc: Aggrwal Poonam-B10812, Jain Priyanka-B32167,
linuxppc-dev@lists.ozlabs.org, Kushwaha Prabhakar-B32579
In-Reply-To: <c0213fde8dd24026af31ccce2fec21bf@DM2PR03MB398.namprd03.prod.outlook.com>
On Fri, 2014-06-06 at 00:04 -0500, Liu Shengzhou-B36685 wrote:
>
> > -----Original Message-----
> > From: linuxppc-release-bounces@linux.freescale.net [mailto:linuxppc-
> > release-bounces@linux.freescale.net] On Behalf Of Prabhakar Kushwaha
> > Sent: Monday, April 21, 2014 7:34 PM
> > To: linuxppc-dev@lists.ozlabs.org
> > Cc: Wood Scott-B07421; Jain Priyanka-B32167; Aggrwal Poonam-B10812;
> > Kushwaha Prabhakar-B32579
> > Subject: [linuxppc-release] [PATCH][v10] powerpc/mpc85xx:Add initial
> > device tree support of T104x
> >
> > The QorIQ T1040/T1042 processor support four integrated 64-bit e5500 PA
> > processor cores with high-performance data path acceleration architecture
> > and network peripheral interfaces required for networking &
> > telecommunications.
> >
> > +
> > + iommu@20000 {
> > + compatible = "fsl,pamu-v1.0", "fsl,pamu";
> > + reg = <0x20000 0x1000>;
> > + ranges = <0 0x20000 0x1000>;
> > + #address-cells = <1>;
> > + #size-cells = <1>;
> > + interrupts = <
> > + 24 2 0 0
> > + 16 2 1 30>;
> > + pamu0: pamu@0 {
> > + reg = <0 0x1000>;
> > + fsl,primary-cache-geometry = <128 1>;
> > + fsl,secondary-cache-geometry = <16 2>;
> > + };
>
>
> [Shengzhou] T1040 RM says:
> Hardware coherent PAMU Look-aside caches to improve performance
> * A 32-entry, direct-mapped primary PAACT cache
> * A 128-entry, 2-way, set-associative secondary PAACT cache
> It appears it should be:
> fsl,primary-cache-geometry = <32 1>;
> fsl,secondary-cache-geometry = <128 2>;
>
> is there any reason that it was "<128 1>, <16 2>" ?
The B4 device trees are also suspicous.
-Scott
^ permalink raw reply
* Re: [PATCH] powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode
From: Srivatsa S. Bhat @ 2014-06-06 21:16 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: ego, matt, mahesh, kexec, linux-kernel, suzuki, ebiederm, paulus,
linuxppc-dev, Vivek Goyal
In-Reply-To: <5391B413.100@linux.vnet.ibm.com>
On 06/06/2014 05:59 PM, Srivatsa S. Bhat wrote:
> On 06/04/2014 03:39 AM, Benjamin Herrenschmidt wrote:
>> On Wed, 2014-06-04 at 01:58 +0530, Srivatsa S. Bhat wrote:
>>> Yep, that makes sense. But unfortunately I don't have enough insight into
>>> why exactly powerpc has to online the CPUs before doing a kexec. I just
>>> know from the commit log and the comment mentioned above (and from my own
>>> experiments) that the CPUs will get stuck if they were offline. Perhaps
>>> somebody more knowledgeable can explain this in detail and suggest a proper
>>> long-term solution.
>>>
>>> Matt, Ben, any thoughts on this?
>>
>> The problem is with our "soft offline" which we do on some platforms. When we
>> offline we don't actually send the CPUs back to firmware or anything like that.
>>
>> We put them into a very low low power loop inside Linux.
>>
>> The new kernel has no way to extract them from that loop. So we must re-"online"
>> them before we kexec so they can be passed to the new kernel normally (or returned
>> to firmware like we do on powernv).
>>
>
> Thanks a lot for the explanation Ben!
>
> I thought about this and this is what I think: whether the CPU is in the kernel
> or in the firmware is a hard-boundary. But once we know it is still in the
> kernel, whether it is online or offline is a soft-boundary, something that
> ideally shouldn't make any difference to kexec.
>
> Then I looked at what is that special state that kexec expects the online CPUs
> to be in, before performing kexec, and I found that that state is entered via
> kexec_smp_down().
>
> Which means, if we poke the soft-offline CPUs and make them execute
> kexec_smp_down(), we should be able to do a successful kexec without having to
> actually online them. After all, the core kexec code doesn't mandate that they
> should be online. So if we satisfy powerpc's requirement that all the CPUs are
> in a sane state, that should be good enough. (This would be similar to how the
> subcore code wakes up offline CPUs to perform the split-core procedure).
>
> I know, this is all theory for now since I haven't tested it yet, but I think
> we can make this work.
>
> Below are the 4 preliminary patches I'm have so far, to implement this.
>
And with the following hunk added (which I had forgotten earlier), it worked just
fine on powernv :-)
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index 2ef6c58..84e91293 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -243,6 +243,9 @@ static void wake_offline_cpus(void)
{
int cpu = 0;
+ if (ppc_md.kexec_wake_prepare)
+ ppc_md.kexec_wake_prepare();
+
for_each_present_cpu(cpu) {
if (!cpu_online(cpu)) {
printk(KERN_INFO "kexec: Waking offline cpu %d.\n",
I tried putting the machine into ST mode, and in a separate experiment, I kept
just CPU 0 online in the first kernel, and then issued a kexec. The second kernel
booted successfully with all the CPUs in both the cases.
I haven't explored the crashed-kernel case though, it might need some auditing
to check if the code handles that as well.
Regards,
Srivatsa S. Bhat
^ permalink raw reply related
* [PATCH] powernv: Fix permissions on sysparam sysfs entries
From: Anton Blanchard @ 2014-06-07 1:29 UTC (permalink / raw)
To: benh, paulus, joel, neelegup; +Cc: linuxppc-dev
Everyone can write to these files, which is not what we want.
Cc: stable@vger.kernel.org # 3.15
Signed-off-by: Anton Blanchard <anton@samba.org>
---
diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c
index d202f9b..9d1acf2 100644
--- a/arch/powerpc/platforms/powernv/opal-sysparam.c
+++ b/arch/powerpc/platforms/powernv/opal-sysparam.c
@@ -260,10 +260,10 @@ void __init opal_sys_param_init(void)
attr[i].kobj_attr.attr.mode = S_IRUGO;
break;
case OPAL_SYSPARAM_WRITE:
- attr[i].kobj_attr.attr.mode = S_IWUGO;
+ attr[i].kobj_attr.attr.mode = S_IWUSR;
break;
case OPAL_SYSPARAM_RW:
- attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUGO;
+ attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUSR;
break;
default:
break;
^ permalink raw reply related
* [PATCH] crypto/nx: disable NX on little endian builds
From: Anton Blanchard @ 2014-06-07 1:33 UTC (permalink / raw)
To: benh, paulus, nfont, mhcerri, herbert, davem; +Cc: linuxppc-dev, linux-crypto
The NX driver has endian issues so disable it for now.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 03ccdb0..8280a7a3 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -313,7 +313,7 @@ config CRYPTO_DEV_S5P
config CRYPTO_DEV_NX
bool "Support for IBM Power7+ in-Nest cryptographic acceleration"
- depends on PPC64 && IBMVIO
+ depends on PPC64 && IBMVIO && !CPU_LITTLE_ENDIAN
default n
help
Support for Power7+ in-Nest cryptographic acceleration.
^ permalink raw reply related
* [git pull] Please pull powerpc.git next branch
From: Benjamin Herrenschmidt @ 2014-06-07 4:34 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev, Linux Kernel list
Hi Linus !
Here is the bulk of the powerpc changes for this merge window. It got a bit
delayed in part because I wasn't paying attention, and in part because I
discovered I had a core PCI change without a PCI maintainer ack in it. Bjorn
eventually agreed it was ok to merge it though we'll probably improve it
later and I didn't want to rebase to add his ack.
There is going to be a bit more next week, essentially fixes that I still
want to sort through and test.
The biggest item this time is the support to build the ppc64 LE kernel
with our new v2 ABI. We previously supported v2 userspace but the kernel
itself was a tougher nut to crack. This is now sorted mostly thanks to Anton
and Rusty.
We also have a fairly big series from Cedric that add support for 64-bit
LE zImage boot wrapper. This was made harder by the fact that traditionally
our zImage wrapper was always 32-bit, but our new LE toolchains don't really
support 32-bit anymore (it's somewhat there but not really "supported") so
we didn't want to rely on it. This meant more churn that just endian fixes.
This brings some more LE bits as well, such as the ability to run in LE mode
without a hypervisor (ie. under OPAL firmware) by doing the right OPAL call
to reinitialize the CPU to take HV interrupts in the right mode and the usual
pile of endian fixes.
There's another series from Gavin adding EEH improvements (one day we *will*
have a release with less than 20 EEH patches, I promise !).
Another highlight is the support for the "Split core" functionality on P8
by Michael. This allows a P8 core to be split into "sub cores" of 4 threads
which allows the subcores to run different guests under KVM (the HW still
doesn't support a partition per thread).
And then the usual misc bits and fixes ...
Cheers,
Ben.
The following changes since commit 011e4b02f1da156ac7fea28a9da878f3c23af739:
powerpc, kexec: Fix "Processor X is stuck" issue during kexec from ST mode (2014-05-28 13:24:26 +1000)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next
for you to fetch changes up to 0c0a3e5a100bbc4aaedd140e82b429227a76701b:
powerpc/powernv: Add missing include to LPC code (2014-06-07 08:57:21 +1000)
----------------------------------------------------------------
Alexander Graf (2):
powerpc: Use 64k io pages when we never see an HEA
PPC: ePAPR: Fix hypercall on LE guest
Alistair Popple (4):
IBM Currituck: Clean up board specific code before adding Akebono code
IBM Akebono: Add the Akebono platform
powerpc: Added PCI MSI support using the HSTA module
ppc476: Enable a linker work around for IBM errata #46
Andrew Murray (1):
powerpc/pci: Use of_pci_range_parser helper in pci_process_bridge_OF_ranges
Anton Blanchard (36):
powerpc: Don't build assembly files with ABIv2
powerpc: No need to use dot symbols when branching to a function
powerpc: Remove superflous function descriptors in assembly only code
powerpc: Don't use a function descriptor for system call table
powerpc: Remove some unnecessary uses of _GLOBAL() and _STATIC()
powerpc: Remove _INIT_GLOBAL(), _STATIC() and _INIT_STATIC()
powerpc: Remove dot symbol usage in exception macros
powerpc: Create DOTSYM to wrap dot symbol usage
powerpc: Remove function descriptors and dot symbols on new ABI
powerpc: ABIv2 function calls must place target address in r12
powerpc: Ignore .TOC. relocations
powerpc: Add ABIv2 support to ppc_function_entry
powerpc: Use ppc_function_entry instead of open coding it
powerpc: Fix branch patching code for ABIv2
powerpc: Fix kernel thread creation on ABIv2
powerpc: Fix ABIv2 issues with stack offsets in assembly code
powerpc/tm: Use STK_PARAM
powerpc/tm: Fix GOT save offset for ABIv2
powerpc/tracing: TRACE_WITH_FRAME_BUFFER creates invalid stack frames
powerpc: Fix SMP issues with ppc64le ABIv2
powerpc: Fix ABIv2 issue with dereference_function_descriptor
powerpc: Add _GLOBAL_TOC for ABIv2 assembly functions exported to modules
powerpc: ftrace_caller, _mcount is exported to modules so needs _GLOBAL_TOC()
powerpc/kprobes: Fix ABIv2 issues with kprobe_lookup_name
powerpc/modules: Create is_module_trampoline()
powerpc/modules: Create module_trampoline_target()
powerpc/ftrace: Use module loader helpers to parse trampolines
powerpc/ftrace: Fix ABIv2 issues with __ftrace_make_call
powerpc: Build little endian ppc64 kernel with ABIv2
selftests/powerpc: Update for ABIv2
powerpc: 64bit sendfile is capped at 2GB
powerpc/powernv: Fix endian issues in memory error handling code
powerpc: Allow ppc_md platform hook to override memory_block_size_bytes
powerpc/powernv: Set memory_block_size_bytes to 256MB
powerpc: Exported functions __clear_user and copy_page use r2 so need _GLOBAL_TOC()
powerpc/pseries: hcall functions are exported to modules, need _GLOBAL_TOC()
Benjamin Herrenschmidt (10):
Merge commit 'f3cae355a962784101478504ef7f6a389ad62979' into next
Merge remote-tracking branch 'anton/abiv2' into next
Revert "powerpc/powernv: Fundamental reset on PLX ports"
powerpc/powernv: Add calls to support little endian host
powerpc/serial: Use saner flags when creating legacy ports
powerpc/powernv: Provide debugfs access to the LPC bus via OPAL
powerpc/powernv: Add missing include to LPC code
Cédric Le Goater (15):
powerpc/boot: Fix do_div for 64bit wrapper
powerpc/boot: Use a common prom_args struct in oflib
powerpc/boot: Use prom_arg_t in oflib
powerpc/boot: Add byteswapping routines in oflib
powerpc/boot: Add PROM_ERROR define in oflib
powerpc/boot: Rework of_claim() to make it 64bit friendly
powerpc/boot: Define typedef ihandle as u32
powerpc/boot: Fix compile warning in 64bit
powerpc/boot: Define byteswapping routines for little endian
powerpc/boot: Add 64bit and little endian support to addnote
powerpc/boot: Add little endian support to elf utils
powerpc/boot: Define a routine to enter prom
powerpc/boot: Modify entry point for 64bit
powerpc/boot: Add a global entry point for pseries
powerpc/boot: Add support for 64bit little endian wrapper
Diana Craciun (3):
powerpc/fsl: Added binding for Freescale CoreNet coherency fabric (CCF)
powerpc/fsl: Updated device trees for platforms with corenet version 2
powerpc/fsl: Updated corenet-cf compatible string for corenet1-cf chips
Gautham R. Shenoy (2):
powerpc: powernv: Framework to show the correct clock in /proc/cpuinfo
powerpc: powernv: Implement ppc_md.get_proc_freq()
Gavin Shan (25):
powerpc/eeh: Remove EEH_PE_PHB_DEAD
powerpc/powernv: Remove PNV_EEH_STATE_REMOVED
powerpc/powernv: Move PNV_EEH_STATE_ENABLED around
powerpc/powernv: Remove fields in PHB diag-data dump
powerpc/eeh: EEH_PE_ISOLATED not reflect HW state
powerpc/eeh: Block PCI-CFG access during PE reset
powerpc/powernv: Use EEH PCI config accessors
powerpc/eeh: Avoid I/O access during PE reset
powerpc/eeh: Cleanup eeh_gather_pci_data()
powerpc/eeh: Use cached capability for log dump
powerpc/eeh: Cleanup EEH subsystem variables
powerpc/eeh: Allow to disable EEH
powerpc/eeh: No hotplug on permanently removed dev
powerpc/powernv: Fix endless reporting frozen PE
powerpc/pseries: Fix overwritten PE state
powerpc/powernv: Reset root port in firmware
powerpc/eeh: Make the delay for PE reset unified
powerpc/pci: Mask linkDown on resetting PCI bus
powrpc/powernv: Reset PHB in kdump kernel
powerpc/eeh: Can't recover from non-PE-reset case
powerpc/powernv: Fundamental reset on PLX ports
powerpc/powernv: Missed IOMMU table type
powerpc/powernv: Don't use pe->pbus to get the domain number
powerpc/prom: Stop scanning dev-tree for fdump early
powerpc/eeh: Fix build error for celleb
James Hogan (1):
powerpc: Remove non-uapi linkage.h export
Jeff Bailey (1):
powerpc: Clear ELF personality flag if ELFv2 is not requested.
Lijun Pan (1):
powerpc/mpc85xx: Remove P1023 RDS support
Liu Gang (1):
powerpc/rmu: Fix the error memory free parameters
Liu Ping Fan (1):
powerpc/mm: use macro PGTABLE_EADDR_SIZE instead of digital
Martijn de Gouw (1):
powerpc/85xx: Add OCA4080 board support
Michael Ellerman (10):
powerpc/kvm/book3s_hv: Rework the secondary inhibit code
powerpc/powernv: Make it possible to skip the IRQHAPPENED check in power7_nap()
powerpc: Add threads_per_subcore
powerpc: Check cpu_thread_in_subcore() in __cpu_up()
powerpc/kvm/book3s_hv: Use threads_per_subcore in KVM
powerpc/powernv: Add support for POWER8 split core on powernv
powerpc/xmon: Fix up xmon format strings
powerpc: Add cpu family documentation
powerpc/mm: Check paca psize is up to date for huge mappings
selftests/powerpc: Test the THP bug we fixed in the previous commit
Michael Neuling (2):
powerpc/tm: Remove unnecessary r1 save
powerpc/tm: Add checking to treclaim/trechkpt
Nishanth Aravamudan (2):
powerpc/numa: Enable USE_PERCPU_NUMA_NODE_ID
powerpc/numa: Enable CONFIG_HAVE_MEMORYLESS_NODES
Paul Gortmaker (2):
powerpc: Drop return value from set_breakpoint as it is unused
powerpc: Fix smp_processor_id() in preemptible splat in set_breakpoint
Philippe Bergheaud (1):
powerpc: memcpy optimization for 64bit LE
Prabhakar Kushwaha (2):
powerpc/mpc85xx:Add initial device tree support of T104x
powerpc/fsl-booke: Add initial T104x_QDS board support
Preeti U Murthy (1):
powerpc: Fix comment around arch specific definition of RECLAIM_DISTANCE
Rickard Strandqvist (2):
macintosh/windfarm_pm121.c: Fix for possible null pointer dereference
arch: powerpc/fadump: Cleaning up inconsistent NULL checks
Rusty Russell (12):
powerpc: make module stub code endian independent
powerpc: modules implement R_PPC64_TOCSAVE relocation.
powerpc: EXPORT_SYMBOL(.TOC.)
powerpc: module: handle MODVERSION for .TOC.
powerpc: Fix up TOC. for modules.
powerpc: Handle new ELFv2 module relocations
powerpc: modules: comment about de-dotifying symbols when using the ELFv2 ABI.
powerpc: modules: change r2 save/restore offset for ELFv2 ABI.
powerpc: modules: use r12 for stub jump address.
powerpc: modules: skip r2 setup for ELFv2
powerpc: modules: implement stubs for ELFv2 ABI.
powerpc/module: Fix stubs for BE
Sam bobroff (3):
powerpc: Split __SYSFS_SPRSETUP macro
powerpc: Fix regression of per-CPU DSCR setting
powerpc: Document sysfs DSCR interface
Scott Wood (6):
powerpc/fsl-rio: Fix fsl_rio_setup error paths and use-after-unmap
powerpc/fsl-booke64: Set vmemmap_psize to 4K
powerpc: fix build of epapr_paravirt on 64-bit book3s
powerpc: Fix unused variable warning for epapr_has_idle
powerpc/mpic: Don't init the fsl error int until after mpic init
powerpc/fsl: Add fsl,portid-mapping to corenet1-cf chips
Stephen Chivers (1):
powerpc/legacy_serial: Support MVME5100 UARTS with shifted registers
Stuart Yoder (1):
powerpc: move epapr paravirt init of power_save to an initcall
Tang Yuantian (1):
clk: qoriq: Update the clock bindings
Tony Breeds (1):
powerpc/le: Show the endianess of the LPAR under PowerVM.
Ulrich Weigand (1):
powerpc: Fix unsafe accesses to parameter area in ELFv2
Valentin Longchamp (3):
devicetree: bindings: add Zarlink to the vendor prefixes
devcietree: bindings: add some MFD Keymile FPGAs
powerpc/mpc85xx: add support for Keymile's kmcoge4 board
Vasant Hegde (2):
powerpc/powernv: Return secondary CPUs to firmware before FW update
powerpc/powernv: Pass buffer size to OPAL validate flash call
Wang Dongsheng (1):
fsl/pci: fix RC cannot detect PME message coming
Wei Yang (1):
powerpc/eeh: Skip eeh sysfs when eeh is disabled
harninder rai (1):
powerpc/mpc85xx: Add BSC9132 QDS Support
Documentation/ABI/stable/sysfs-devices-system-cpu | 25 ++
.../clock/{corenet-clock.txt => qoriq-clock.txt} | 10 +-
Documentation/devicetree/bindings/mfd/bfticu.txt | 25 ++
Documentation/devicetree/bindings/mfd/qriox.txt | 17 +
.../devicetree/bindings/powerpc/4xx/akebono.txt | 54 +++
.../devicetree/bindings/powerpc/4xx/hsta.txt | 19 +
.../devicetree/bindings/powerpc/fsl/board.txt | 17 +
.../devicetree/bindings/powerpc/fsl/ccf.txt | 46 +++
.../devicetree/bindings/powerpc/fsl/cpus.txt | 11 +
.../devicetree/bindings/powerpc/fsl/pamu.txt | 10 +
.../devicetree/bindings/vendor-prefixes.txt | 1 +
Documentation/powerpc/cpu_families.txt | 221 +++++++++++
arch/powerpc/Kconfig | 8 +
arch/powerpc/Makefile | 16 +-
arch/powerpc/boot/Makefile | 24 +-
arch/powerpc/boot/addnote.c | 128 +++---
arch/powerpc/boot/crt0.S | 180 ++++++++-
arch/powerpc/boot/dcr.h | 4 +
arch/powerpc/boot/dts/akebono.dts | 415 ++++++++++++++++++++
arch/powerpc/boot/dts/b4860emu.dts | 7 +-
arch/powerpc/boot/dts/bsc9132qds.dts | 35 ++
arch/powerpc/boot/dts/bsc9132qds.dtsi | 101 +++++
arch/powerpc/boot/dts/fsl/b4420si-post.dtsi | 4 -
arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi | 2 +
arch/powerpc/boot/dts/fsl/b4860si-post.dtsi | 4 -
arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi | 4 +
arch/powerpc/boot/dts/fsl/b4si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi | 185 +++++++++
arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi | 66 ++++
arch/powerpc/boot/dts/fsl/p2041si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi | 4 +
arch/powerpc/boot/dts/fsl/p3041si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi | 4 +
arch/powerpc/boot/dts/fsl/p4080si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi | 8 +
arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi | 2 +
arch/powerpc/boot/dts/fsl/p5040si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi | 4 +
arch/powerpc/boot/dts/fsl/t1040si-post.dtsi | 430 +++++++++++++++++++++
arch/powerpc/boot/dts/fsl/t1042si-post.dtsi | 37 ++
arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi | 104 +++++
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 3 +-
arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi | 12 +
arch/powerpc/boot/dts/kmcoge4.dts | 152 ++++++++
arch/powerpc/boot/dts/oca4080.dts | 118 ++++++
arch/powerpc/boot/dts/p1023rds.dts | 219 -----------
arch/powerpc/boot/dts/t1040qds.dts | 46 +++
arch/powerpc/boot/dts/t1042qds.dts | 46 +++
arch/powerpc/boot/dts/t104xqds.dtsi | 166 ++++++++
arch/powerpc/boot/dts/t4240emu.dts | 15 +-
arch/powerpc/boot/elf_util.c | 4 +
arch/powerpc/boot/of.c | 4 +-
arch/powerpc/boot/of.h | 19 +-
arch/powerpc/boot/ofconsole.c | 6 +-
arch/powerpc/boot/oflib.c | 92 +++--
arch/powerpc/boot/ppc_asm.h | 12 +
arch/powerpc/boot/pseries-head.S | 8 +
arch/powerpc/boot/stdio.c | 14 +
arch/powerpc/boot/swab.h | 29 ++
arch/powerpc/boot/treeboot-akebono.c | 163 ++++++++
arch/powerpc/boot/util.S | 4 +-
arch/powerpc/boot/wrapper | 20 +-
arch/powerpc/boot/zImage.lds.S | 25 +-
arch/powerpc/configs/44x/akebono_defconfig | 148 +++++++
arch/powerpc/configs/85xx/kmp204x_defconfig | 225 +++++++++++
arch/powerpc/configs/corenet32_smp_defconfig | 1 +
arch/powerpc/configs/mpc85xx_defconfig | 1 -
arch/powerpc/configs/mpc85xx_smp_defconfig | 1 -
arch/powerpc/include/asm/code-patching.h | 40 +-
arch/powerpc/include/asm/context_tracking.h | 4 +-
arch/powerpc/include/asm/cputhreads.h | 7 +
arch/powerpc/include/asm/debug.h | 3 +-
arch/powerpc/include/asm/eeh.h | 46 ++-
arch/powerpc/include/asm/elf.h | 2 +
arch/powerpc/include/asm/exception-64e.h | 6 +-
arch/powerpc/include/asm/exception-64s.h | 2 +-
arch/powerpc/include/asm/ftrace.h | 2 +
arch/powerpc/include/asm/hw_breakpoint.h | 2 +-
arch/powerpc/include/asm/irqflags.h | 8 +-
arch/powerpc/include/asm/kprobes.h | 5 +-
arch/powerpc/include/asm/kvm_ppc.h | 7 +
arch/powerpc/include/asm/linkage.h | 2 +
arch/powerpc/include/asm/machdep.h | 8 +
arch/powerpc/include/asm/module.h | 4 +
arch/powerpc/include/asm/opal.h | 18 +-
arch/powerpc/include/asm/paca.h | 3 +
arch/powerpc/include/asm/ppc-pci.h | 1 +
arch/powerpc/include/asm/ppc_asm.h | 72 ++--
arch/powerpc/include/asm/processor.h | 2 +-
arch/powerpc/include/asm/reg.h | 10 +
arch/powerpc/include/asm/sections.h | 2 +
arch/powerpc/include/asm/smp.h | 8 -
arch/powerpc/include/asm/string.h | 4 -
arch/powerpc/include/asm/systbl.h | 8 +-
arch/powerpc/include/asm/topology.h | 15 +-
arch/powerpc/include/uapi/asm/Kbuild | 1 -
arch/powerpc/include/uapi/asm/elf.h | 10 +-
arch/powerpc/kernel/asm-offsets.c | 1 +
arch/powerpc/kernel/cpu_setup_fsl_booke.S | 28 +-
arch/powerpc/kernel/eeh.c | 212 ++++++----
arch/powerpc/kernel/eeh_driver.c | 118 +++++-
arch/powerpc/kernel/eeh_pe.c | 47 ++-
arch/powerpc/kernel/eeh_sysfs.c | 3 +
arch/powerpc/kernel/entry_64.S | 126 +++---
arch/powerpc/kernel/epapr_paravirt.c | 19 +-
arch/powerpc/kernel/exceptions-64e.S | 140 +++----
arch/powerpc/kernel/exceptions-64s.S | 206 +++++-----
arch/powerpc/kernel/fadump.c | 13 +-
arch/powerpc/kernel/ftrace.c | 137 ++-----
arch/powerpc/kernel/head_64.S | 117 +++---
arch/powerpc/kernel/hw_breakpoint.c | 8 +-
arch/powerpc/kernel/idle_book3e.S | 2 +-
arch/powerpc/kernel/idle_power4.S | 2 +-
arch/powerpc/kernel/idle_power7.S | 13 +-
arch/powerpc/kernel/legacy_serial.c | 36 +-
arch/powerpc/kernel/misc_64.S | 46 ++-
arch/powerpc/kernel/module_64.c | 279 ++++++++++---
arch/powerpc/kernel/pci-common.c | 108 +++---
arch/powerpc/kernel/pci_of_scan.c | 9 +
arch/powerpc/kernel/ppc_ksyms.c | 2 -
arch/powerpc/kernel/process.c | 32 +-
arch/powerpc/kernel/prom_init_check.sh | 2 +-
arch/powerpc/kernel/rtas_pci.c | 66 +++-
arch/powerpc/kernel/setup-common.c | 20 +-
arch/powerpc/kernel/setup_64.c | 12 +-
arch/powerpc/kernel/signal.c | 2 +-
arch/powerpc/kernel/smp.c | 43 +--
arch/powerpc/kernel/sysfs.c | 51 ++-
arch/powerpc/kernel/systbl.S | 18 +-
arch/powerpc/kernel/tm.S | 69 ++--
arch/powerpc/kvm/book3s_hv.c | 34 +-
arch/powerpc/kvm/book3s_hv_builtin.c | 31 ++
arch/powerpc/kvm/book3s_hv_interrupts.S | 2 +-
arch/powerpc/kvm/book3s_hv_rmhandlers.S | 37 +-
arch/powerpc/kvm/powerpc.c | 2 +-
arch/powerpc/lib/Makefile | 2 -
arch/powerpc/lib/copypage_64.S | 4 +-
arch/powerpc/lib/copypage_power7.S | 12 +-
arch/powerpc/lib/copyuser_64.S | 2 +-
arch/powerpc/lib/copyuser_power7.S | 32 +-
arch/powerpc/lib/hweight_64.S | 8 +-
arch/powerpc/lib/mem_64.S | 4 +-
arch/powerpc/lib/memcpy_64.S | 26 +-
arch/powerpc/lib/memcpy_power7.S | 26 +-
arch/powerpc/lib/string_64.S | 2 +-
arch/powerpc/mm/hash_low_64.S | 44 ++-
arch/powerpc/mm/hash_utils_64.c | 92 +++--
arch/powerpc/mm/slb.c | 12 +-
arch/powerpc/mm/slb_low.S | 14 +-
arch/powerpc/mm/tlb_nohash.c | 7 +-
arch/powerpc/platforms/44x/Kconfig | 42 ++
arch/powerpc/platforms/44x/Makefile | 3 +-
.../platforms/44x/{currituck.c => ppc476.c} | 120 ++++--
arch/powerpc/platforms/44x/ppc476_modules.lds | 15 +
arch/powerpc/platforms/85xx/Kconfig | 19 +-
arch/powerpc/platforms/85xx/Makefile | 3 +-
arch/powerpc/platforms/85xx/bsc913x_qds.c | 74 ++++
arch/powerpc/platforms/85xx/corenet_generic.c | 9 +-
.../platforms/85xx/{p1023_rds.c => p1023_rdb.c} | 36 +-
arch/powerpc/platforms/85xx/smp.c | 3 +-
arch/powerpc/platforms/Kconfig.cputype | 5 +
arch/powerpc/platforms/cell/smp.c | 5 +-
arch/powerpc/platforms/embedded6xx/Kconfig | 1 +
arch/powerpc/platforms/pasemi/powersave.S | 2 +-
arch/powerpc/platforms/powernv/Makefile | 2 +-
arch/powerpc/platforms/powernv/eeh-ioda.c | 264 +++++++------
arch/powerpc/platforms/powernv/eeh-powernv.c | 4 +
arch/powerpc/platforms/powernv/opal-flash.c | 50 ++-
arch/powerpc/platforms/powernv/opal-lpc.c | 151 ++++++++
.../powerpc/platforms/powernv/opal-memory-errors.c | 8 +-
arch/powerpc/platforms/powernv/opal-takeover.S | 2 +
arch/powerpc/platforms/powernv/opal-wrappers.S | 5 +-
arch/powerpc/platforms/powernv/opal.c | 22 ++
arch/powerpc/platforms/powernv/pci-ioda.c | 26 +-
arch/powerpc/platforms/powernv/pci.c | 202 +++++-----
arch/powerpc/platforms/powernv/pci.h | 11 +-
arch/powerpc/platforms/powernv/powernv.h | 2 +
arch/powerpc/platforms/powernv/setup.c | 56 ++-
arch/powerpc/platforms/powernv/smp.c | 25 +-
arch/powerpc/platforms/powernv/subcore-asm.S | 95 +++++
arch/powerpc/platforms/powernv/subcore.c | 392 +++++++++++++++++++
arch/powerpc/platforms/powernv/subcore.h | 18 +
arch/powerpc/platforms/pseries/eeh_pseries.c | 43 ++-
arch/powerpc/platforms/pseries/hotplug-memory.c | 17 +-
arch/powerpc/platforms/pseries/hvCall.S | 10 +-
arch/powerpc/platforms/pseries/pseries.h | 2 +
arch/powerpc/platforms/pseries/setup.c | 7 +
arch/powerpc/platforms/pseries/smp.c | 5 +-
arch/powerpc/platforms/wsp/scom_smp.c | 3 +-
arch/powerpc/sysdev/Kconfig | 6 +
arch/powerpc/sysdev/Makefile | 1 +
arch/powerpc/sysdev/fsl_pci.c | 3 +-
arch/powerpc/sysdev/fsl_rio.c | 10 +-
arch/powerpc/sysdev/fsl_rmu.c | 6 +-
arch/powerpc/sysdev/mpic.c | 8 +-
arch/powerpc/sysdev/ppc4xx_hsta_msi.c | 215 +++++++++++
arch/powerpc/sysdev/ppc4xx_pci.c | 21 +-
arch/powerpc/xmon/xmon.c | 28 +-
drivers/cpufreq/powernv-cpufreq.c | 1 +
drivers/cpufreq/unicore2-cpufreq.c | 4 +-
drivers/macintosh/windfarm_pm121.c | 16 +-
drivers/pci/pci.c | 21 +-
tools/testing/selftests/powerpc/Makefile | 2 +-
.../selftests/powerpc/copyloops/asm/ppc_asm.h | 5 +-
tools/testing/selftests/powerpc/mm/Makefile | 18 +
.../selftests/powerpc/mm/hugetlb_vs_thp_test.c | 72 ++++
207 files changed, 6903 insertions(+), 1778 deletions(-)
create mode 100644 Documentation/ABI/stable/sysfs-devices-system-cpu
rename Documentation/devicetree/bindings/clock/{corenet-clock.txt => qoriq-clock.txt} (95%)
create mode 100644 Documentation/devicetree/bindings/mfd/bfticu.txt
create mode 100644 Documentation/devicetree/bindings/mfd/qriox.txt
create mode 100644 Documentation/devicetree/bindings/powerpc/4xx/akebono.txt
create mode 100644 Documentation/devicetree/bindings/powerpc/4xx/hsta.txt
create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/ccf.txt
create mode 100644 Documentation/powerpc/cpu_families.txt
create mode 100644 arch/powerpc/boot/dts/akebono.dts
create mode 100644 arch/powerpc/boot/dts/bsc9132qds.dts
create mode 100644 arch/powerpc/boot/dts/bsc9132qds.dtsi
create mode 100644 arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi
create mode 100644 arch/powerpc/boot/dts/fsl/bsc9132si-pre.dtsi
create mode 100644 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
create mode 100644 arch/powerpc/boot/dts/fsl/t1042si-post.dtsi
create mode 100644 arch/powerpc/boot/dts/fsl/t104xsi-pre.dtsi
create mode 100644 arch/powerpc/boot/dts/kmcoge4.dts
create mode 100644 arch/powerpc/boot/dts/oca4080.dts
delete mode 100644 arch/powerpc/boot/dts/p1023rds.dts
create mode 100644 arch/powerpc/boot/dts/t1040qds.dts
create mode 100644 arch/powerpc/boot/dts/t1042qds.dts
create mode 100644 arch/powerpc/boot/dts/t104xqds.dtsi
create mode 100644 arch/powerpc/boot/pseries-head.S
create mode 100644 arch/powerpc/boot/swab.h
create mode 100644 arch/powerpc/boot/treeboot-akebono.c
create mode 100644 arch/powerpc/configs/44x/akebono_defconfig
create mode 100644 arch/powerpc/configs/85xx/kmp204x_defconfig
rename arch/powerpc/platforms/44x/{currituck.c => ppc476.c} (72%)
create mode 100644 arch/powerpc/platforms/44x/ppc476_modules.lds
create mode 100644 arch/powerpc/platforms/85xx/bsc913x_qds.c
rename arch/powerpc/platforms/85xx/{p1023_rds.c => p1023_rdb.c} (75%)
create mode 100644 arch/powerpc/platforms/powernv/subcore-asm.S
create mode 100644 arch/powerpc/platforms/powernv/subcore.c
create mode 100644 arch/powerpc/platforms/powernv/subcore.h
create mode 100644 arch/powerpc/sysdev/ppc4xx_hsta_msi.c
create mode 100644 tools/testing/selftests/powerpc/mm/Makefile
create mode 100644 tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c
^ permalink raw reply
* [PATCH] KVM: PPC: Book3S PR: ppc64 ABIv2 build fixes
From: Anton Blanchard @ 2014-06-08 5:06 UTC (permalink / raw)
To: agraf, benh, paulus; +Cc: linuxppc-dev, kvm-ppc
binutils knows that a branch to a function descriptor is actually
a branch to the function text. By removing the explicit branch to
dot symbols, we maintain both ABIv1 and ABIv2 compatibility.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: b/arch/powerpc/kvm/book3s_interrupts.S
===================================================================
--- a/arch/powerpc/kvm/book3s_interrupts.S
+++ b/arch/powerpc/kvm/book3s_interrupts.S
@@ -25,11 +25,9 @@
#include <asm/exception-64s.h>
#if defined(CONFIG_PPC_BOOK3S_64)
-#define FUNC(name) GLUE(.,name)
#define GET_SHADOW_VCPU(reg) addi reg, r13, PACA_SVCPU
#elif defined(CONFIG_PPC_BOOK3S_32)
-#define FUNC(name) name
#define GET_SHADOW_VCPU(reg) lwz reg, (THREAD + THREAD_KVM_SVCPU)(r2)
#endif /* CONFIG_PPC_BOOK3S_XX */
@@ -93,7 +91,7 @@ kvm_start_entry:
kvm_start_lightweight:
/* Copy registers into shadow vcpu so we can access them in real mode */
GET_SHADOW_VCPU(r3)
- bl FUNC(kvmppc_copy_to_svcpu)
+ bl kvmppc_copy_to_svcpu
nop
REST_GPR(4, r1)
@@ -131,7 +129,7 @@ after_sprg3_load:
PPC_LL r4, VCPU_SHADOW_MSR(r4) /* get shadow_msr */
/* Jump to segment patching handler and into our guest */
- bl FUNC(kvmppc_entry_trampoline)
+ bl kvmppc_entry_trampoline
nop
/*
@@ -164,7 +162,7 @@ after_sprg3_load:
/* On 64-bit, interrupts are still off at this point */
GET_SHADOW_VCPU(r4)
- bl FUNC(kvmppc_copy_from_svcpu)
+ bl kvmppc_copy_from_svcpu
nop
#ifdef CONFIG_PPC_BOOK3S_64
@@ -203,7 +201,7 @@ after_sprg3_load:
/* Restore r3 (kvm_run) and r4 (vcpu) */
REST_2GPRS(3, r1)
- bl FUNC(kvmppc_handle_exit_pr)
+ bl kvmppc_handle_exit_pr
/* If RESUME_GUEST, get back in the loop */
cmpwi r3, RESUME_GUEST
Index: b/arch/powerpc/kvm/book3s_rmhandlers.S
===================================================================
--- a/arch/powerpc/kvm/book3s_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_rmhandlers.S
@@ -34,13 +34,7 @@
* *
****************************************************************************/
-#if defined(CONFIG_PPC_BOOK3S_64)
-
-#define FUNC(name) GLUE(.,name)
-
-#elif defined(CONFIG_PPC_BOOK3S_32)
-
-#define FUNC(name) name
+#ifdef CONFIG_PPC_BOOK3S_32
.macro INTERRUPT_TRAMPOLINE intno
^ permalink raw reply
* Re: [PATCH 0/3] dmaengine: mpc512x: add device tree binding document and DMA channel lookup
From: Alexander Popov @ 2014-06-08 18:48 UTC (permalink / raw)
To: Gerhard Sittig, Dan Williams, Vinod Koul, Lars-Peter Clausen,
Arnd Bergmann, Anatolij Gustschin, Andy Shevchenko,
Alexander Popov, linuxppc-dev, dmaengine, devicetree
In-Reply-To: <1400924009-23992-1-git-send-email-a13xp0p0v88@gmail.com>
2014-05-24 13:33 GMT+04:00 Alexander Popov <a13xp0p0v88@gmail.com>:
> This patch series introduces a device tree binding document for
> the MPC512x DMA controller and adds device tree based DMA channel lookup
> for it.
Hello, excuse me, could I have a feedback?
Should I fix anything?
Thanks a lot!
Alexander
> Alexander Popov (3):
> dmaengine: mpc512x: add device tree binding document
> dmaengine: of: add common xlate function for matching by channel id
> dmaengine: mpc512x: register for device tree channel lookup
>
> .../devicetree/bindings/dma/mpc512x-dma.txt | 40 ++++++++++++++++++++++
> arch/powerpc/boot/dts/mpc5121.dtsi | 1 +
> drivers/dma/mpc512x_dma.c | 13 ++++++-
> drivers/dma/of-dma.c | 35 +++++++++++++++++++
> include/linux/of_dma.h | 4 +++
> 5 files changed, 92 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/devicetree/bindings/dma/mpc512x-dma.txt
>
> --
> 1.8.4.2
>
^ permalink raw reply
* Re: [PATCH 2/2] gpio: gpiolib: set gpiochip_remove retval to void
From: Ben Dooks @ 2014-06-08 23:18 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Linux MIPS Mailing List, m, Linux-sh list, Linus Walleij,
platform-driver-x86, linux-leds@vger.kernel.org, driverdevel,
Alexandre Courbot, patches, linux-samsungsoc, Geert Uytterhoeven,
linux-input@vger.kernel.org, Linux Media Mailing List,
spear-devel, linux-gpio@vger.kernel.org, David Daney,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
linux-wireless, linux-kernel@vger.kernel.org, abdoulaye berthe,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <5388CB1B.3090802@metafoo.de>
On Fri, May 30, 2014 at 08:16:59PM +0200, Lars-Peter Clausen wrote:
> On 05/30/2014 07:33 PM, David Daney wrote:
> >On 05/30/2014 04:39 AM, Geert Uytterhoeven wrote:
> >>On Fri, May 30, 2014 at 1:30 PM, abdoulaye berthe <berthe.ab@gmail.com>
> >>wrote:
> >>>--- a/drivers/gpio/gpiolib.c
> >>>+++ b/drivers/gpio/gpiolib.c
> >>>@@ -1263,10 +1263,9 @@ static void gpiochip_irqchip_remove(struct
> >>>gpio_chip *gpiochip);
> >>> *
> >>> * A gpio_chip with any GPIOs still requested may not be removed.
> >>> */
> >>>-int gpiochip_remove(struct gpio_chip *chip)
> >>>+void gpiochip_remove(struct gpio_chip *chip)
> >>> {
> >>> unsigned long flags;
> >>>- int status = 0;
> >>> unsigned id;
> >>>
> >>> acpi_gpiochip_remove(chip);
> >>>@@ -1278,24 +1277,15 @@ int gpiochip_remove(struct gpio_chip *chip)
> >>> of_gpiochip_remove(chip);
> >>>
> >>> for (id = 0; id < chip->ngpio; id++) {
> >>>- if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) {
> >>>- status = -EBUSY;
> >>>- break;
> >>>- }
> >>>- }
> >>>- if (status == 0) {
> >>>- for (id = 0; id < chip->ngpio; id++)
> >>>- chip->desc[id].chip = NULL;
> >>>-
> >>>- list_del(&chip->list);
> >>>+ if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags))
> >>>+ panic("gpio: removing gpiochip with gpios still
> >>>requested\n");
> >>
> >>panic?
> >
> >NACK to the patch for this reason. The strongest thing you should do here
> >is WARN.
> >
> >That said, I am not sure why we need this whole patch set in the first place.
>
> Well, what currently happens when you remove a device that is a
> provider of a gpio_chip which is still in use, is that the kernel
> crashes. Probably with a rather cryptic error message. So this patch
> doesn't really change the behavior, but makes it more explicit what
> is actually wrong. And even if you replace the panic() by a WARN()
> it will again just crash slightly later.
>
> This is a design flaw in the GPIO subsystem that needs to be fixed.
Surely then the best way is to error out to the module unload and
stop the driver being unloaded?
--
Ben Dooks, ben@fluff.org, http://www.fluff.org/ben/
Large Hadron Colada: A large Pina Colada that makes the universe disappear.
^ permalink raw reply
* Re: [PATCH v2] powerpc/powernv: hwmon driver for power values, fan rpm and temperature
From: Neelesh Gupta @ 2014-06-09 8:15 UTC (permalink / raw)
To: Guenter Roeck, linuxppc-dev, jdelvare, lm-sensors; +Cc: sbhat
In-Reply-To: <53858F02.2020808@roeck-us.net>
On 05/28/2014 12:53 PM, Guenter Roeck wrote:
> On 05/19/2014 07:26 AM, Neelesh Gupta wrote:
>> This patch adds basic kernel enablement for reading power values, fan
>> speed rpm and temperature values on powernv platforms which will
>> be exported to user space through sysfs interface.
>>
>> Test results:
>> -------------
>> [root@tul163p1 ~]# sensors
>> ibmpowernv-isa-0000
>> Adapter: ISA adapter
>> fan1: 5487 RPM (min = 0 RPM)
>> fan2: 5152 RPM (min = 0 RPM)
>> fan3: 5590 RPM (min = 0 RPM)
>> fan4: 4963 RPM (min = 0 RPM)
>> fan5: 0 RPM (min = 0 RPM)
>> fan6: 0 RPM (min = 0 RPM)
>> fan7: 7488 RPM (min = 0 RPM)
>> fan8: 7944 RPM (min = 0 RPM)
>> temp1: +39.0°C (high = +0.0°C)
>> power1: 192.00 W
>>
>> [root@tul163p1 ~]# ls /sys/devices/platform/
>> alarmtimer ibmpowernv.0 rtc-generic serial8250 uevent
>> [root@tul163p1 ~]# ls /sys/devices/platform/ibmpowernv.0/
>> driver/ hwmon/ modalias subsystem/ uevent
>> [root@tul163p1 ~]# ls /sys/devices/platform/ibmpowernv.0/hwmon/hwmon0/
>> device fan2_min fan4_min fan6_min fan8_min power1_input
>> fan1_fault fan3_fault fan5_fault fan7_fault in1_fault subsystem
>> fan1_input fan3_input fan5_input fan7_input in2_fault
>> temp1_input
>> fan1_min fan3_min fan5_min fan7_min in3_fault temp1_max
>> fan2_fault fan4_fault fan6_fault fan8_fault in4_fault uevent
>> fan2_input fan4_input fan6_input fan8_input name
>> [root@tul163p1 ~]#
>> [root@tul163p1 ~]# ls /sys/class/hwmon/hwmon0/
>> device fan2_min fan4_min fan6_min fan8_min power1_input
>> fan1_fault fan3_fault fan5_fault fan7_fault in1_fault subsystem
>> fan1_input fan3_input fan5_input fan7_input in2_fault
>> temp1_input
>> fan1_min fan3_min fan5_min fan7_min in3_fault temp1_max
>> fan2_fault fan4_fault fan6_fault fan8_fault in4_fault uevent
>> fan2_input fan4_input fan6_input fan8_input name
>> [root@tul163p1 ~]#
>>
>
>
> The inX_fault attributes don't really make much sense. _fault
> attributes without
> _input attributes don't have any value and are, as you noticed, not
> displayed
> with the sensors command. Is this a problem in teh devicetree data or
> do you
> really have voltage faults without voltages ?
There is no issue with the device data, somehow I'm getting only the
_fault attribute
for the inX_ (power-supply) attributes.
>
>> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
>> ---
>>
> Checkpatch says:
>
> total: 8 errors, 11 warnings, 389 lines checked
>
> NOTE: whitespace errors detected, you may wish to use
> scripts/cleanpatch or
> scripts/cleanfile
>
> which should really not happen at this point.
>
> Please make sure you follow CodingStyle. checkpatch --strict points to
> a number
> of additional violations.
>
> More comments inline.
Fixed all of these issues related to coding style.
>
>> Changes in v2
>> =============
>> - Generic use of devm_* functions in hwmon like using devm_kzalloc()
>> for dynamic
>> memory request, avoiding the need to explicit free of memory.
>> Adding 'struct attribute_group' as member of platform data
>> structure to be
>> populated and then passed to
>> devm_hwmon_device_register_with_groups().
>>
>> Note: Having an array of pointers of 'attribute_group' and each group
>> corresponds to 'enum sensors' type. Not completely sure, if it's
>> ideal or
>> could have just one group populated with attributes of sensor types?
>>
> Your call, really; whatever is easier for you. I won't dictate one or
> the other.
>
> Question though is what happens if one group is not populated. If I
> understand
> the code correctly this will result in the remaining groups to be
> 'dropped',
> ie not displayed at all.
Yes, should be fixed.
>
>> - 'ibmpowernv' is not hot-pluggable device so moving
>> 'platform_driver' callback
>> function (probe) as part of __init code.
>> - Fixed issues related to coding style.
>> - Other general comments in v1.
>>
>> drivers/hwmon/Kconfig | 8 +
>> drivers/hwmon/Makefile | 1
>> drivers/hwmon/ibmpowernv.c | 368
>> ++++++++++++++++++++++++++++++++++++++++++++
>
> You'll also need Documentation/hwmon/ibmpowernv and
> Documentation/devicetree/bindings/hwmon/ibmpowernv.
>
> The latter will need to get an Ack from the devicetree maintainers.
I'll do as required.
>> 3 files changed, 377 insertions(+)
>> create mode 100644 drivers/hwmon/ibmpowernv.c
>>
>> diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
>> index bc196f4..3e308fa 100644
>> --- a/drivers/hwmon/Kconfig
>> +++ b/drivers/hwmon/Kconfig
>> @@ -554,6 +554,14 @@ config SENSORS_IBMPEX
>> This driver can also be built as a module. If so, the module
>> will be called ibmpex.
>>
>> +config SENSORS_IBMPOWERNV
>> + tristate "IBM POWERNV platform sensors"
>> + depends on PPC_POWERNV
>> + default y
>> + help
>> + If you say yes here you get support for the temperature/fan/power
>> + sensors on your platform.
>> +
>> config SENSORS_IIO_HWMON
>> tristate "Hwmon driver that uses channels specified via iio maps"
>> depends on IIO
>> diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
>> index c48f987..199c401 100644
>> --- a/drivers/hwmon/Makefile
>> +++ b/drivers/hwmon/Makefile
>> @@ -71,6 +71,7 @@ obj-$(CONFIG_SENSORS_ULTRA45) += ultra45_env.o
>> obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o
>> obj-$(CONFIG_SENSORS_IBMAEM) += ibmaem.o
>> obj-$(CONFIG_SENSORS_IBMPEX) += ibmpex.o
>> +obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
>> obj-$(CONFIG_SENSORS_IIO_HWMON) += iio_hwmon.o
>> obj-$(CONFIG_SENSORS_INA209) += ina209.o
>> obj-$(CONFIG_SENSORS_INA2XX) += ina2xx.o
>> diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
>> new file mode 100644
>> index 0000000..afce620
>> --- /dev/null
>> +++ b/drivers/hwmon/ibmpowernv.c
>> @@ -0,0 +1,368 @@
>> +/*
>> + * IBM PowerNV platform sensors for temperature/fan/power
>> + * Copyright (C) 2014 IBM
>> + *
>> + * 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.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program.
>> + */
>> +
>> +#include <linux/init.h>
>> +#include <linux/module.h>
>> +#include <linux/kernel.h>
>> +#include <linux/hwmon.h>
>> +#include <linux/hwmon-sysfs.h>
>> +#include <linux/of.h>
>> +#include <linux/slab.h>
>> +
>> +#include <linux/platform_device.h>
>> +#include <asm/opal.h>
>> +#include <linux/err.h>
>> +
>> +#define DRVNAME "ibmpowernv"
>> +#define MAX_ATTR_LEN 32
>> +
>> +/* Sensor suffix name from DT */
>> +#define DT_FAULT_ATTR_SUFFIX "faulted"
>> +#define DT_DATA_ATTR_SUFFIX "data"
>> +#define DT_THRESHOLD_ATTR_SUFFIX "thrs"
>> +
>> +/*
>> + * Enumerates all the types of sensors in the POWERNV platform and
>> does index
>> + * into 'struct sensor_group'
>> + */
>> +enum sensors {
>> + FAN,
>> + AMBIENT_TEMP,
>> + POWER_SUPPLY,
>> + POWER_INPUT,
>> + MAX_SENSOR_TYPE,
>> +};
>> +
>> +static struct sensor_group {
>> + const char *name;
>> + const char *compatible;
>> + struct attribute_group group;
>> + u32 attr_count;
>> +} sensor_groups[] = {
>> + {"fan", "ibm,opal-sensor-cooling-fan", {0}, 0},
>> + {"temp", "ibm,opal-sensor-amb-temp", {0}, 0},
>> + {"in", "ibm,opal-sensor-power-supply", {0}, 0},
>> + {"power", "ibm,opal-sensor-power", {0}, 0}
>> +};
>> +
> The '0' initializations should not be necessary.
>
>
>> +struct sensor_data {
>> + u32 id; /* An opaque id of the firmware for each sensor */
>> + enum sensors type;
>> + char name[MAX_ATTR_LEN];
>> + struct device_attribute dev_attr;
>> +};
>> +
>> +struct platform_data {
>> + const struct attribute_group *attr_groups[MAX_SENSOR_TYPE + 1];
>> + u32 sensors_count; /* Total count of sensors from each group */
>> +};
>> +
>> +/* Platform device representing all the ibmpowernv sensors */
>> +static struct platform_device *pdevice;
>> +
>> +static ssize_t show_sensor(struct device *dev, struct
>> device_attribute *devattr,
>> + char *buf)
>> +{
>> + struct sensor_data *sdata = container_of(devattr, struct
>> sensor_data,
>> + dev_attr);
>> + ssize_t ret;
>> + u32 x;
>> +
>> + ret = opal_get_sensor_data(sdata->id, &x);
>> + if (ret) {
>> + pr_err("%s: Failed to get opal sensor data\n", __func__);
>> + return ret;
>> + }
>> +
>> + /* Convert temperature to milli-degrees */
>> + if (sdata->type == AMBIENT_TEMP)
>> + x *= 1000;
>> + /* Convert power to micro-watts */
>> + else if (sdata->type == POWER_INPUT)
>> + x *= 1000000;
>> +
>> + return sprintf(buf, "%d\n", x);
>
> x is unsigned, so %u.
Done.
>
>> +}
>> +
>> +static void __init get_sensor_index_attr(const char *name, u32
>> *index, char *attr)
>> +{
>> + char *hash_pos = strchr(name, '#');
>> + char *dash_pos;
>> + u32 copy_len;
>> + char buf[8];
>> +
>> + memset(buf, 0, sizeof(buf));
>> + *index = 0;
>> + *attr = '\0';
>> +
>> + if (hash_pos) {
>> + dash_pos = strchr(hash_pos, '-');
>> + if (dash_pos) {
>> + copy_len = dash_pos - hash_pos - 1;
>> + if (copy_len < sizeof(buf)) {
>> + strncpy(buf, hash_pos + 1, copy_len);
>> + sscanf(buf, "%d", index);
>
> What if sscanf fails ? Might be an interesting exercise to try and create
> multiple sensors with index 0 (or, for that matter, with the same
> index value).
> Do you have any protection against bad input data ? Guess not; did you
> test
> what happens if you pass bad data to the driver (such as duplicate sensor
> entries) ?
Well, rewriting this function to return the error code if fails.
Next version will cover these test cases covered. Thanks.
>
>> + }
>> +
>> + strncpy(attr, dash_pos + 1, MAX_ATTR_LEN);
>> + }
>> + }
>> +}
>> +
>> +/*
>> + * This function translates the DT node name into the 'hwmon'
>> attribute name.
>> + * IBMPOWERNV device node appear like cooling-fan#2-data,
>> amb-temp#1-thrs etc.
>> + * which need to be mapped as fan2_input, temp1_max respectively before
>> + * populating them inside hwmon device class..
>> + */
>> +static int __init create_hwmon_attr_name(enum sensors type, const
>> char *node_name,
>> + char *hwmon_attr_name)
>> +{
>> + char attr_suffix[MAX_ATTR_LEN];
>> + char *attr_name;
>> + u32 index;
>> +
>> + get_sensor_index_attr(node_name, &index, attr_suffix);
>> + if (!index || !strlen(attr_suffix)) {
>> + pr_info("%s: Sensor device node name is invalid, name: %s\n",
>> + __func__, node_name);
>> + return -EINVAL;
>> + }
>> +
>> + if (!strcmp(attr_suffix, DT_FAULT_ATTR_SUFFIX))
>> + attr_name = "fault";
>> + else if(!strcmp(attr_suffix, DT_DATA_ATTR_SUFFIX))
>> + attr_name = "input";
>> + else if (!strcmp(attr_suffix, DT_THRESHOLD_ATTR_SUFFIX)) {
>> + if (type == AMBIENT_TEMP)
>> + attr_name = "max";
>> + else if (type == FAN)
>> + attr_name = "min";
>> + else
>> + return -ENOENT;
>> + } else
>> + return -ENOENT;
>> +
>> + snprintf(hwmon_attr_name, MAX_ATTR_LEN, "%s%d_%s",
>> + sensor_groups[type].name, index, attr_name);
>> + return 0;
>> +}
>> +
>> +static int __init populate_attr_groups(struct platform_device *pdev)
>> +{
>> + struct platform_data *pdata = platform_get_drvdata(pdev);
>> + const struct attribute_group **pgroups = pdata->attr_groups;
>> + struct device_node *opal, *np;
>> + enum sensors type;
>> + int err = 0;
>> +
>> + opal = of_find_node_by_path("/ibm,opal/sensors");
>> + if (!opal) {
>
> An obvious whitespace error here.
>
>> + pr_err("%s: Opal 'sensors' node not found\n", __func__);
>> + return -ENODEV;
>> + }
>> +
>> + for_each_child_of_node(opal, np) {
>> + if (np->name == NULL)
>> + continue;
>> +
>> + for (type = 0; type < MAX_SENSOR_TYPE; type++)
>> + if (of_device_is_compatible(np,
>> + sensor_groups[type].compatible)) {
>> + sensor_groups[type].attr_count++;
>> + break;
>> + }
>> + }
>
> You should be able to do
> of_node_put(opal);
>
> here. Then you can return immediately on error below.
Done.
>
>> +
>> + for (type = 0; type < MAX_SENSOR_TYPE; type++) {
>> + if (!sensor_groups[type].attr_count)
>> + continue;
>> +
>> + sensor_groups[type].group.attrs = devm_kzalloc(&pdev->dev,
>> + sizeof(struct attribute*) *
>> + (sensor_groups[type].attr_count + 1),
>> + GFP_KERNEL);
>> + if (!sensor_groups[type].group.attrs) {
>> + pr_err("%s: Failed to allocate memory for attribute"
>> + "array\n", __func__);
>
> devm_kzalloc() already dumps an error message. Same for all other
> memory error messages.
>
>> + err = -ENOMEM;
>> + goto exit_put_node;
>> + }
>> +
>> + pgroups[type] = &sensor_groups[type].group;
>> + pdata->sensors_count += sensor_groups[type].attr_count;
>> + sensor_groups[type].attr_count = 0;
>> + }
>> +
>> +exit_put_node:
>> + of_node_put(opal);
>> + return err;
>> +}
>> +
>> +/*
>> + * Iterate through the device tree for each child of sensor node,
>> create
>> + * a sysfs attribute file, the file is named by translating the DT
>> node name
>> + * to the name required by the higher 'hwmon' driver like
>> fan1_input, temp1_max
>> + * etc..
>> + */
>> +static int __init create_device_attrs(struct platform_device *pdev)
>> +{
>> + struct platform_data *pdata = platform_get_drvdata(pdev);
>> + const struct attribute_group **pgroups = pdata->attr_groups;
>> + struct device_node *opal, *np;
>> + struct sensor_data *sdata;
>> + const u32 *sensor_id;
>> + enum sensors type;
>> + u32 count = 0;
>> + int err = 0;
>> +
>> + opal = of_find_node_by_path("/ibm,opal/sensors");
>> + if (!opal) {
>> + pr_err("%s: Opal 'sensors' node not found\n", __func__);
>> + return -ENODEV;
>> + }
>> +
>> + sdata = devm_kzalloc(&pdev->dev, (pdata->sensors_count) *
>> + sizeof(*sdata), GFP_KERNEL);
>> + if (!sdata) {
>> + pr_err("%s: Failed to allocate memory for the sensor_data",
>> + __func__);
>> + err = -ENOMEM;
>> + goto exit_put_node;
>> + }
>> +
>> + for_each_child_of_node(opal, np) {
>> + if (np->name == NULL)
>> + continue;
>> +
>> + for (type = 0; type < MAX_SENSOR_TYPE; type++)
>> + if (of_device_is_compatible(np,
>> + sensor_groups[type].compatible))
>> + break;
>> +
>> + if (type == MAX_SENSOR_TYPE)
>> + continue;
>> +
>> + sensor_id = of_get_property(np, "sensor-id", NULL);
>> + if (!sensor_id) {
>> + pr_info("%s: %s doesn't have sensor-id\n", __func__,
>> + np->name);
>> + continue;
>> + }
>> +
> Consider using of_property_read_u32().
Okay.
>
>> + sdata[count].id = *sensor_id;
>> + sdata[count].type = type;
>> + err = create_hwmon_attr_name(type, np->name,
>> sdata[count].name);
>> + if (err)
>> + goto exit_put_node;
>> +
>> + sysfs_attr_init(&sdata[count].dev_attr.attr);
>> + sdata[count].dev_attr.attr.name = sdata[count].name;
>> + sdata[count].dev_attr.attr.mode = S_IRUGO;
>> + sdata[count].dev_attr.show = show_sensor;
>> +
>> + pgroups[type]->attrs[sensor_groups[type].attr_count++] =
>> + &sdata[count++].dev_attr.attr;
>> + }
>> +
>> +exit_put_node:
>> + of_node_put(opal);
>> + return err;
>> +}
>> +
>> +static int __init ibmpowernv_probe(struct platform_device *pdev)
>> +{
>> + struct platform_data *pdata;
>> + struct device *hwmon_dev;
>> + int err;
>> +
>> + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
>> + if (!pdata)
>> + return -ENOMEM;
>> +
>> + platform_set_drvdata(pdev, pdata);
>> + pdata->sensors_count = 0;
>> + err = populate_attr_groups(pdev);
>> + if (err)
>> + return err;
>> +
>> + /* Create sysfs attribute file for each sensor found in the DT */
>
> Attribute data, not file
>
>> + err = create_device_attrs(pdev);
>> + if (err)
>> + return err;
>> +
>> + /* Finally, register with hwmon */
>> + hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
>> DRVNAME,
>> + pdata,
>> + pdata->attr_groups);
>> +
>> + return PTR_ERR_OR_ZERO(hwmon_dev);
>> +}
>> +
>> +static struct platform_driver ibmpowernv_driver = {
>> + .driver = {
>> + .owner = THIS_MODULE,
>> + .name = DRVNAME,
>> + },
>> +};
>> +
>> +static int __init ibmpowernv_init(void)
>> +{
>> + int err;
>> +
>> + pdevice = platform_device_alloc(DRVNAME, 0);
>> + if (!pdevice) {
>> + pr_err("%s: Device allocation failed\n", __func__);
>> + err = -ENOMEM;
>> + goto exit;
>> + }
>> +
>> + err = platform_device_add(pdevice);
>> + if (err) {
>> + pr_err("%s: Device addition failed (%d)\n", __func__, err);
>> + goto exit_device_put;
>> + }
>> +
>> + err = platform_driver_probe(&ibmpowernv_driver, ibmpowernv_probe);
>> + if (err) {
>> + pr_err("%s: Platfrom driver probe failed\n", __func__);
>> + goto exit_device_del;
>> + }
>> +
>> + return 0;
>> +
>> +exit_device_del:
>> + platform_device_del(pdevice);
>> +exit_device_put:
>> + platform_device_put(pdevice);
>> +exit:
>> + return err;
>> +}
>> +
>> +static void __exit ibmpowernv_exit(void)
>> +{
>> + platform_driver_unregister(&ibmpowernv_driver);
>> + platform_device_unregister(pdevice);
>> +}
>> +
>> +MODULE_AUTHOR("Neelesh Gupta <neelegup@linux.vnet.ibm.com>");
>> +MODULE_DESCRIPTION("IBM POWERNV platform sensors");
>> +MODULE_LICENSE("GPL");
>> +
>> +module_init(ibmpowernv_init);
>> +module_exit(ibmpowernv_exit);
>>
>>
>>
>
^ permalink raw reply
* [PATCH] powerpc/powernv: fix endianness problems in EEH
From: Guo Chao @ 2014-06-09 8:58 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Guo Chao, Gavin Shan
EEH information fetched from OPAL need fix before using in LE environment.
To be included in sparse's endian check, declare them as __beXX and
access them by accessors.
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/opal.h | 102 +++++++++++++++---------------
arch/powerpc/platforms/powernv/eeh-ioda.c | 36 ++++++-----
arch/powerpc/platforms/powernv/pci.c | 81 +++++++++++++++---------
3 files changed, 120 insertions(+), 99 deletions(-)
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 4ccd1d4..a4c0acc 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -599,9 +599,9 @@ enum {
};
struct OpalIoPhbErrorCommon {
- uint32_t version;
- uint32_t ioType;
- uint32_t len;
+ __be32 version;
+ __be32 ioType;
+ __be32 len;
};
struct OpalIoP7IOCPhbErrorData {
@@ -671,64 +671,64 @@ enum {
struct OpalIoPhb3ErrorData {
struct OpalIoPhbErrorCommon common;
- uint32_t brdgCtl;
+ __be32 brdgCtl;
/* PHB3 UTL regs */
- uint32_t portStatusReg;
- uint32_t rootCmplxStatus;
- uint32_t busAgentStatus;
+ __be32 portStatusReg;
+ __be32 rootCmplxStatus;
+ __be32 busAgentStatus;
/* PHB3 cfg regs */
- uint32_t deviceStatus;
- uint32_t slotStatus;
- uint32_t linkStatus;
- uint32_t devCmdStatus;
- uint32_t devSecStatus;
+ __be32 deviceStatus;
+ __be32 slotStatus;
+ __be32 linkStatus;
+ __be32 devCmdStatus;
+ __be32 devSecStatus;
/* cfg AER regs */
- uint32_t rootErrorStatus;
- uint32_t uncorrErrorStatus;
- uint32_t corrErrorStatus;
- uint32_t tlpHdr1;
- uint32_t tlpHdr2;
- uint32_t tlpHdr3;
- uint32_t tlpHdr4;
- uint32_t sourceId;
+ __be32 rootErrorStatus;
+ __be32 uncorrErrorStatus;
+ __be32 corrErrorStatus;
+ __be32 tlpHdr1;
+ __be32 tlpHdr2;
+ __be32 tlpHdr3;
+ __be32 tlpHdr4;
+ __be32 sourceId;
- uint32_t rsv3;
+ __be32 rsv3;
/* Record data about the call to allocate a buffer */
- uint64_t errorClass;
- uint64_t correlator;
+ __be64 errorClass;
+ __be64 correlator;
- uint64_t nFir; /* 000 */
- uint64_t nFirMask; /* 003 */
- uint64_t nFirWOF; /* 008 */
+ __be64 nFir; /* 000 */
+ __be64 nFirMask; /* 003 */
+ __be64 nFirWOF; /* 008 */
/* PHB3 MMIO Error Regs */
- uint64_t phbPlssr; /* 120 */
- uint64_t phbCsr; /* 110 */
- uint64_t lemFir; /* C00 */
- uint64_t lemErrorMask; /* C18 */
- uint64_t lemWOF; /* C40 */
- uint64_t phbErrorStatus; /* C80 */
- uint64_t phbFirstErrorStatus; /* C88 */
- uint64_t phbErrorLog0; /* CC0 */
- uint64_t phbErrorLog1; /* CC8 */
- uint64_t mmioErrorStatus; /* D00 */
- uint64_t mmioFirstErrorStatus; /* D08 */
- uint64_t mmioErrorLog0; /* D40 */
- uint64_t mmioErrorLog1; /* D48 */
- uint64_t dma0ErrorStatus; /* D80 */
- uint64_t dma0FirstErrorStatus; /* D88 */
- uint64_t dma0ErrorLog0; /* DC0 */
- uint64_t dma0ErrorLog1; /* DC8 */
- uint64_t dma1ErrorStatus; /* E00 */
- uint64_t dma1FirstErrorStatus; /* E08 */
- uint64_t dma1ErrorLog0; /* E40 */
- uint64_t dma1ErrorLog1; /* E48 */
- uint64_t pestA[OPAL_PHB3_NUM_PEST_REGS];
- uint64_t pestB[OPAL_PHB3_NUM_PEST_REGS];
+ __be64 phbPlssr; /* 120 */
+ __be64 phbCsr; /* 110 */
+ __be64 lemFir; /* C00 */
+ __be64 lemErrorMask; /* C18 */
+ __be64 lemWOF; /* C40 */
+ __be64 phbErrorStatus; /* C80 */
+ __be64 phbFirstErrorStatus; /* C88 */
+ __be64 phbErrorLog0; /* CC0 */
+ __be64 phbErrorLog1; /* CC8 */
+ __be64 mmioErrorStatus; /* D00 */
+ __be64 mmioFirstErrorStatus; /* D08 */
+ __be64 mmioErrorLog0; /* D40 */
+ __be64 mmioErrorLog1; /* D48 */
+ __be64 dma0ErrorStatus; /* D80 */
+ __be64 dma0FirstErrorStatus; /* D88 */
+ __be64 dma0ErrorLog0; /* DC0 */
+ __be64 dma0ErrorLog1; /* DC8 */
+ __be64 dma1ErrorStatus; /* E00 */
+ __be64 dma1FirstErrorStatus; /* E08 */
+ __be64 dma1ErrorLog0; /* E40 */
+ __be64 dma1ErrorLog1; /* E48 */
+ __be64 pestA[OPAL_PHB3_NUM_PEST_REGS];
+ __be64 pestB[OPAL_PHB3_NUM_PEST_REGS];
};
typedef struct oppanel_line {
@@ -851,8 +851,8 @@ int64_t opal_pci_mask_pe_error(uint64_t phb_id, uint16_t pe_number, uint8_t erro
int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t led_type, uint8_t led_action);
int64_t opal_get_epow_status(__be64 *status);
int64_t opal_set_system_attention_led(uint8_t led_action);
-int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe,
- uint16_t *pci_error_type, uint16_t *severity);
+int64_t opal_pci_next_error(uint64_t phb_id, __be64 *first_frozen_pe,
+ __be16 *pci_error_type, __be16 *severity);
int64_t opal_pci_poll(uint64_t phb_id);
int64_t opal_return_cpu(void);
int64_t opal_reinit_cpus(uint64_t flags);
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c
index 753f08e..e0d6a3a 100644
--- a/arch/powerpc/platforms/powernv/eeh-ioda.c
+++ b/arch/powerpc/platforms/powernv/eeh-ioda.c
@@ -267,7 +267,7 @@ static int ioda_eeh_get_state(struct eeh_pe *pe)
{
s64 ret = 0;
u8 fstate;
- u16 pcierr;
+ __be16 pcierr;
u32 pe_no;
int result;
struct pci_controller *hose = pe->phb;
@@ -316,7 +316,7 @@ static int ioda_eeh_get_state(struct eeh_pe *pe)
result = 0;
result &= ~EEH_STATE_RESET_ACTIVE;
- if (pcierr != OPAL_EEH_PHB_ERROR) {
+ if (be16_to_cpu(pcierr) != OPAL_EEH_PHB_ERROR) {
result |= EEH_STATE_MMIO_ACTIVE;
result |= EEH_STATE_DMA_ACTIVE;
result |= EEH_STATE_MMIO_ENABLED;
@@ -706,8 +706,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
struct pci_controller *hose;
struct pnv_phb *phb;
struct eeh_pe *phb_pe;
- u64 frozen_pe_no;
- u16 err_type, severity;
+ __be64 frozen_pe_no;
+ __be16 err_type, severity;
long rc;
int ret = EEH_NEXT_ERR_NONE;
@@ -742,8 +742,8 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
}
/* If the PHB doesn't have error, stop processing */
- if (err_type == OPAL_EEH_NO_ERROR ||
- severity == OPAL_EEH_SEV_NO_ERROR) {
+ if (be16_to_cpu(err_type) == OPAL_EEH_NO_ERROR ||
+ be16_to_cpu(severity) == OPAL_EEH_SEV_NO_ERROR) {
pr_devel("%s: No error found on PHB#%x\n",
__func__, hose->global_number);
continue;
@@ -755,14 +755,14 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
* specific PHB.
*/
pr_devel("%s: Error (%d, %d, %llu) on PHB#%x\n",
- __func__, err_type, severity,
- frozen_pe_no, hose->global_number);
- switch (err_type) {
+ __func__, be16_to_cpu(err_type), be16_to_cpu(severity),
+ be64_to_cpu(frozen_pe_no), hose->global_number);
+ switch (be16_to_cpu(err_type)) {
case OPAL_EEH_IOC_ERROR:
- if (severity == OPAL_EEH_SEV_IOC_DEAD) {
+ if (be16_to_cpu(severity) == OPAL_EEH_SEV_IOC_DEAD) {
pr_err("EEH: dead IOC detected\n");
ret = EEH_NEXT_ERR_DEAD_IOC;
- } else if (severity == OPAL_EEH_SEV_INF) {
+ } else if (be16_to_cpu(severity) == OPAL_EEH_SEV_INF) {
pr_info("EEH: IOC informative error "
"detected\n");
ioda_eeh_hub_diag(hose);
@@ -771,17 +771,18 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
break;
case OPAL_EEH_PHB_ERROR:
- if (severity == OPAL_EEH_SEV_PHB_DEAD) {
+ if (be16_to_cpu(severity) == OPAL_EEH_SEV_PHB_DEAD) {
*pe = phb_pe;
pr_err("EEH: dead PHB#%x detected\n",
hose->global_number);
ret = EEH_NEXT_ERR_DEAD_PHB;
- } else if (severity == OPAL_EEH_SEV_PHB_FENCED) {
+ } else if (be16_to_cpu(severity) ==
+ OPAL_EEH_SEV_PHB_FENCED) {
*pe = phb_pe;
pr_err("EEH: fenced PHB#%x detected\n",
hose->global_number);
ret = EEH_NEXT_ERR_FENCED_PHB;
- } else if (severity == OPAL_EEH_SEV_INF) {
+ } else if (be16_to_cpu(severity) == OPAL_EEH_SEV_INF) {
pr_info("EEH: PHB#%x informative error "
"detected\n",
hose->global_number);
@@ -801,12 +802,13 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
* progress with recovery. We needn't report
* it again.
*/
- if (ioda_eeh_get_pe(hose, frozen_pe_no, pe)) {
+ if (ioda_eeh_get_pe(hose,
+ be64_to_cpu(frozen_pe_no), pe)) {
*pe = phb_pe;
pr_err("EEH: Escalated fenced PHB#%x "
"detected for PE#%llx\n",
hose->global_number,
- frozen_pe_no);
+ be64_to_cpu(frozen_pe_no));
ret = EEH_NEXT_ERR_FENCED_PHB;
} else if ((*pe)->state & EEH_PE_ISOLATED) {
ret = EEH_NEXT_ERR_NONE;
@@ -819,7 +821,7 @@ static int ioda_eeh_next_error(struct eeh_pe **pe)
break;
default:
pr_warn("%s: Unexpected error type %d\n",
- __func__, err_type);
+ __func__, be16_to_cpu(err_type));
}
/*
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index eefbfcc..f91a4e5 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -206,72 +206,91 @@ static void pnv_pci_dump_phb3_diag_data(struct pci_controller *hose,
data = (struct OpalIoPhb3ErrorData*)common;
pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n",
- hose->global_number, common->version);
+ hose->global_number, be32_to_cpu(common->version));
if (data->brdgCtl)
pr_info("brdgCtl: %08x\n",
- data->brdgCtl);
+ be32_to_cpu(data->brdgCtl));
if (data->portStatusReg || data->rootCmplxStatus ||
data->busAgentStatus)
pr_info("UtlSts: %08x %08x %08x\n",
- data->portStatusReg, data->rootCmplxStatus,
- data->busAgentStatus);
+ be32_to_cpu(data->portStatusReg),
+ be32_to_cpu(data->rootCmplxStatus),
+ be32_to_cpu(data->busAgentStatus));
if (data->deviceStatus || data->slotStatus ||
data->linkStatus || data->devCmdStatus ||
data->devSecStatus)
pr_info("RootSts: %08x %08x %08x %08x %08x\n",
- data->deviceStatus, data->slotStatus,
- data->linkStatus, data->devCmdStatus,
- data->devSecStatus);
+ be32_to_cpu(data->deviceStatus),
+ be32_to_cpu(data->slotStatus),
+ be32_to_cpu(data->linkStatus),
+ be32_to_cpu(data->devCmdStatus),
+ be32_to_cpu(data->devSecStatus));
if (data->rootErrorStatus || data->uncorrErrorStatus ||
data->corrErrorStatus)
pr_info("RootErrSts: %08x %08x %08x\n",
- data->rootErrorStatus, data->uncorrErrorStatus,
- data->corrErrorStatus);
+ be32_to_cpu(data->rootErrorStatus),
+ be32_to_cpu(data->uncorrErrorStatus),
+ be32_to_cpu(data->corrErrorStatus));
if (data->tlpHdr1 || data->tlpHdr2 ||
data->tlpHdr3 || data->tlpHdr4)
pr_info("RootErrLog: %08x %08x %08x %08x\n",
- data->tlpHdr1, data->tlpHdr2,
- data->tlpHdr3, data->tlpHdr4);
+ be32_to_cpu(data->tlpHdr1),
+ be32_to_cpu(data->tlpHdr2),
+ be32_to_cpu(data->tlpHdr3),
+ be32_to_cpu(data->tlpHdr4));
if (data->sourceId || data->errorClass ||
data->correlator)
pr_info("RootErrLog1: %08x %016llx %016llx\n",
- data->sourceId, data->errorClass,
- data->correlator);
+ be32_to_cpu(data->sourceId),
+ be64_to_cpu(data->errorClass),
+ be64_to_cpu(data->correlator));
if (data->nFir)
pr_info("nFir: %016llx %016llx %016llx\n",
- data->nFir, data->nFirMask,
- data->nFirWOF);
+ be64_to_cpu(data->nFir),
+ be64_to_cpu(data->nFirMask),
+ be64_to_cpu(data->nFirWOF));
if (data->phbPlssr || data->phbCsr)
pr_info("PhbSts: %016llx %016llx\n",
- data->phbPlssr, data->phbCsr);
+ be64_to_cpu(data->phbPlssr),
+ be64_to_cpu(data->phbCsr));
if (data->lemFir)
pr_info("Lem: %016llx %016llx %016llx\n",
- data->lemFir, data->lemErrorMask,
- data->lemWOF);
+ be64_to_cpu(data->lemFir),
+ be64_to_cpu(data->lemErrorMask),
+ be64_to_cpu(data->lemWOF));
if (data->phbErrorStatus)
pr_info("PhbErr: %016llx %016llx %016llx %016llx\n",
- data->phbErrorStatus, data->phbFirstErrorStatus,
- data->phbErrorLog0, data->phbErrorLog1);
+ be64_to_cpu(data->phbErrorStatus),
+ be64_to_cpu(data->phbFirstErrorStatus),
+ be64_to_cpu(data->phbErrorLog0),
+ be64_to_cpu(data->phbErrorLog1));
if (data->mmioErrorStatus)
pr_info("OutErr: %016llx %016llx %016llx %016llx\n",
- data->mmioErrorStatus, data->mmioFirstErrorStatus,
- data->mmioErrorLog0, data->mmioErrorLog1);
+ be64_to_cpu(data->mmioErrorStatus),
+ be64_to_cpu(data->mmioFirstErrorStatus),
+ be64_to_cpu(data->mmioErrorLog0),
+ be64_to_cpu(data->mmioErrorLog1));
if (data->dma0ErrorStatus)
pr_info("InAErr: %016llx %016llx %016llx %016llx\n",
- data->dma0ErrorStatus, data->dma0FirstErrorStatus,
- data->dma0ErrorLog0, data->dma0ErrorLog1);
+ be64_to_cpu(data->dma0ErrorStatus),
+ be64_to_cpu(data->dma0FirstErrorStatus),
+ be64_to_cpu(data->dma0ErrorLog0),
+ be64_to_cpu(data->dma0ErrorLog1));
if (data->dma1ErrorStatus)
pr_info("InBErr: %016llx %016llx %016llx %016llx\n",
- data->dma1ErrorStatus, data->dma1FirstErrorStatus,
- data->dma1ErrorLog0, data->dma1ErrorLog1);
+ be64_to_cpu(data->dma1ErrorStatus),
+ be64_to_cpu(data->dma1FirstErrorStatus),
+ be64_to_cpu(data->dma1ErrorLog0),
+ be64_to_cpu(data->dma1ErrorLog1));
for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) {
- if ((data->pestA[i] >> 63) == 0 &&
- (data->pestB[i] >> 63) == 0)
+ if ((be64_to_cpu(data->pestA[i]) >> 63) == 0 &&
+ (be64_to_cpu(data->pestB[i]) >> 63) == 0)
continue;
pr_info("PE[%3d] A/B: %016llx %016llx\n",
- i, data->pestA[i], data->pestB[i]);
+ i, be64_to_cpu(data->pestA[i]),
+ be64_to_cpu(data->pestB[i]));
}
}
@@ -284,7 +303,7 @@ void pnv_pci_dump_phb_diag_data(struct pci_controller *hose,
return;
common = (struct OpalIoPhbErrorCommon *)log_buff;
- switch (common->ioType) {
+ switch (be32_to_cpu(common->ioType)) {
case OPAL_PHB_ERROR_DATA_TYPE_P7IOC:
pnv_pci_dump_p7ioc_diag_data(hose, common);
break;
@@ -293,7 +312,7 @@ void pnv_pci_dump_phb_diag_data(struct pci_controller *hose,
break;
default:
pr_warn("%s: Unrecognized ioType %d\n",
- __func__, common->ioType);
+ __func__, be32_to_cpu(common->ioType));
}
}
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 2/2] gpio: gpiolib: set gpiochip_remove retval to void
From: Lars-Peter Clausen @ 2014-06-09 11:29 UTC (permalink / raw)
To: Ben Dooks
Cc: Linux MIPS Mailing List, m, Linux-sh list, Linus Walleij,
platform-driver-x86, linux-leds@vger.kernel.org, driverdevel,
Alexandre Courbot, patches, linux-samsungsoc, Geert Uytterhoeven,
linux-input@vger.kernel.org, Linux Media Mailing List,
spear-devel, linux-gpio@vger.kernel.org, David Daney,
linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
linux-wireless, linux-kernel@vger.kernel.org, abdoulaye berthe,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20140608231823.GB10112@trinity.fluff.org>
On 06/09/2014 01:18 AM, Ben Dooks wrote:
> On Fri, May 30, 2014 at 08:16:59PM +0200, Lars-Peter Clausen wrote:
>> On 05/30/2014 07:33 PM, David Daney wrote:
>>> On 05/30/2014 04:39 AM, Geert Uytterhoeven wrote:
>>>> On Fri, May 30, 2014 at 1:30 PM, abdoulaye berthe <berthe.ab@gmail.com>
>>>> wrote:
>>>>> --- a/drivers/gpio/gpiolib.c
>>>>> +++ b/drivers/gpio/gpiolib.c
>>>>> @@ -1263,10 +1263,9 @@ static void gpiochip_irqchip_remove(struct
>>>>> gpio_chip *gpiochip);
>>>>> *
>>>>> * A gpio_chip with any GPIOs still requested may not be removed.
>>>>> */
>>>>> -int gpiochip_remove(struct gpio_chip *chip)
>>>>> +void gpiochip_remove(struct gpio_chip *chip)
>>>>> {
>>>>> unsigned long flags;
>>>>> - int status = 0;
>>>>> unsigned id;
>>>>>
>>>>> acpi_gpiochip_remove(chip);
>>>>> @@ -1278,24 +1277,15 @@ int gpiochip_remove(struct gpio_chip *chip)
>>>>> of_gpiochip_remove(chip);
>>>>>
>>>>> for (id = 0; id < chip->ngpio; id++) {
>>>>> - if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) {
>>>>> - status = -EBUSY;
>>>>> - break;
>>>>> - }
>>>>> - }
>>>>> - if (status == 0) {
>>>>> - for (id = 0; id < chip->ngpio; id++)
>>>>> - chip->desc[id].chip = NULL;
>>>>> -
>>>>> - list_del(&chip->list);
>>>>> + if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags))
>>>>> + panic("gpio: removing gpiochip with gpios still
>>>>> requested\n");
>>>>
>>>> panic?
>>>
>>> NACK to the patch for this reason. The strongest thing you should do here
>>> is WARN.
>>>
>>> That said, I am not sure why we need this whole patch set in the first place.
>>
>> Well, what currently happens when you remove a device that is a
>> provider of a gpio_chip which is still in use, is that the kernel
>> crashes. Probably with a rather cryptic error message. So this patch
>> doesn't really change the behavior, but makes it more explicit what
>> is actually wrong. And even if you replace the panic() by a WARN()
>> it will again just crash slightly later.
>>
>> This is a design flaw in the GPIO subsystem that needs to be fixed.
>
> Surely then the best way is to error out to the module unload and
> stop the driver being unloaded?
>
You can't error out on module unload, although that's not really relevant
here. gpiochip_remove() is typically called when the device that registered
the GPIO chip is unbound. And despite some remove() callbacks having a
return type of int you can not abort the removal of a device.
- Lars
^ permalink raw reply
* <fsl,qman-channel-id> in dts file
From: Tony @ 2014-06-09 11:43 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 159 bytes --]
How's the fsl,qman-channel-id value different for different targets ?
Is there any document on how this value is achieved ?
Or can it be any value ???
Alan.
[-- Attachment #2: Type: text/html, Size: 226 bytes --]
^ permalink raw reply
* Re: <fsl,qman-channel-id> in dts file
From: Emil Medve @ 2014-06-09 15:02 UTC (permalink / raw)
To: Tony, linuxppc-dev
In-Reply-To: <CAE1uq6vw0VSDUymckX51FyoJ8NH4Gsj3npfiYeZNff1Vq0cKsQ@mail.gmail.com>
Hello Tony,
On 06/09/2014 06:43 AM, Tony wrote:
> How's the fsl,qman-channel-id value different for different targets ?
Channel ids are assigned in hardware
> Is there any document on how this value is achieved ?
They are described in the RM of each SoC and in the DPAA RM
> Or can it be any value ???
Nope. It must be the right value or frames will end up in the wrong
portal or worse
Cheers,
^ permalink raw reply
* [patch] powerpc/spufs: remove duplicate SPUFS_CNTL_MAP_SIZE define
From: Dan Carpenter @ 2014-06-09 15:19 UTC (permalink / raw)
To: Jeremy Kerr
Cc: cbe-oss-dev, Arnd Bergmann, kernel-janitors, Paul Mackerras,
linuxppc-dev
The SPUFS_CNTL_MAP_SIZE define is cut and pasted twice so we can delete
the second instance.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 0ba3c95..bcfd6f0 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -35,7 +35,6 @@
#define SPUFS_PS_MAP_SIZE 0x20000
#define SPUFS_MFC_MAP_SIZE 0x1000
#define SPUFS_CNTL_MAP_SIZE 0x1000
-#define SPUFS_CNTL_MAP_SIZE 0x1000
#define SPUFS_SIGNAL_MAP_SIZE PAGE_SIZE
#define SPUFS_MSS_MAP_SIZE 0x1000
^ permalink raw reply related
* Re: <fsl,qman-channel-id> in dts file
From: Tony @ 2014-06-09 15:28 UTC (permalink / raw)
To: Emil Medve; +Cc: linuxppc-dev
In-Reply-To: <5395CC7C.4040608@Freescale.com>
[-- Attachment #1: Type: text/plain, Size: 742 bytes --]
Thank Emil.
Where can i find the details about a 'diff' of qman revisions ? The code i
ported doesnt support latest qman revision (REV3). Can i still work on qman
REV1.1 for all the latest targets ? (read t-series)
Regards
On Mon, Jun 9, 2014 at 8:32 PM, Emil Medve <Emilian.Medve@freescale.com>
wrote:
> Hello Tony,
>
>
> On 06/09/2014 06:43 AM, Tony wrote:
> > How's the fsl,qman-channel-id value different for different targets ?
>
> Channel ids are assigned in hardware
>
> > Is there any document on how this value is achieved ?
>
> They are described in the RM of each SoC and in the DPAA RM
>
> > Or can it be any value ???
>
> Nope. It must be the right value or frames will end up in the wrong
> portal or worse
>
>
> Cheers,
>
[-- Attachment #2: Type: text/html, Size: 1247 bytes --]
^ permalink raw reply
* [patch] powerpc/cpm: remove duplicate FCC_GFMR_TTX define
From: Dan Carpenter @ 2014-06-09 15:18 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Paul Mackerras, linuxppc-dev, kernel-janitors
The FCC_GFMR_TTX define is cut and pasted twice so we can remove the
second instance.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/arch/powerpc/include/asm/cpm2.h b/arch/powerpc/include/asm/cpm2.h
index f42e9ba..7c8608b 100644
--- a/arch/powerpc/include/asm/cpm2.h
+++ b/arch/powerpc/include/asm/cpm2.h
@@ -489,7 +489,6 @@ typedef struct scc_trans {
#define FCC_GFMR_TCI ((uint)0x20000000)
#define FCC_GFMR_TRX ((uint)0x10000000)
#define FCC_GFMR_TTX ((uint)0x08000000)
-#define FCC_GFMR_TTX ((uint)0x08000000)
#define FCC_GFMR_CDP ((uint)0x04000000)
#define FCC_GFMR_CTSP ((uint)0x02000000)
#define FCC_GFMR_CDS ((uint)0x01000000)
^ permalink raw reply related
* Re: Build regressions/improvements in v3.15-rc8
From: Geert Uytterhoeven @ 2014-06-09 19:35 UTC (permalink / raw)
To: Linux Kernel Development; +Cc: Linux/PPC Development
In-Reply-To: <alpine.DEB.2.02.1406092134180.21165@ayla.of.borg>
On Mon, 9 Jun 2014, Geert Uytterhoeven wrote:
> JFYI, when comparing v3.15-rc8[1] to v3.15-rc7[3], the summaries are:
> - build errors: +4/-4
+ /scratch/kisskb/src/kernel/bounds.c: error: -mcall-aixdesc must be big endian: => 1:0
+ /scratch/kisskb/src/scripts/mod/devicetable-offsets.c: error: -mcall-aixdesc must be big endian: => 1:0
+ /scratch/kisskb/src/scripts/mod/empty.c: error: -mcall-aixdesc must be big endian: => 1:0
+ <stdin>: error: -mcall-aixdesc must be big endian: => 1:0
powerpc-randconfig
> [1] http://kisskb.ellerman.id.au/kisskb/head/7532/ (all 119 configs)
> [3] http://kisskb.ellerman.id.au/kisskb/head/7506/ (all 119 configs)
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
* Re: NUMA topology question wrt. d4edc5b6
From: David Rientjes @ 2014-06-09 21:38 UTC (permalink / raw)
To: Srivatsa S. Bhat
Cc: Dave Hansen, Srikar Dronamraju, Nishanth Aravamudan,
linuxppc-dev@lists.ozlabs.org list, Linux MM, Aneesh Kumar K.V,
nfont, Cody P Schafer, Anton Blanchard
In-Reply-To: <537E6285.3050000@linux.vnet.ibm.com>
On Fri, 23 May 2014, Srivatsa S. Bhat wrote:
> diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
> index c920215..58e6469 100644
> --- a/arch/powerpc/include/asm/topology.h
> +++ b/arch/powerpc/include/asm/topology.h
> @@ -18,6 +18,7 @@ struct device_node;
> */
> #define RECLAIM_DISTANCE 10
>
> +#include <linux/nodemask.h>
> #include <asm/mmzone.h>
>
> static inline int cpu_to_node(int cpu)
> @@ -30,7 +31,7 @@ static inline int cpu_to_node(int cpu)
> * During early boot, the numa-cpu lookup table might not have been
> * setup for all CPUs yet. In such cases, default to node 0.
> */
> - return (nid < 0) ? 0 : nid;
> + return (nid < 0) ? first_online_node : nid;
> }
>
> #define parent_node(node) (node)
I wonder what would happen on ppc if we just returned NUMA_NO_NODE here
for cpus that have not been mapped (they shouldn't even be possible).
This would at least allow callers that do
kmalloc_node(..., cpu_to_node(cpu)) to be allocated on the local cpu
rather than on a perhaps offline or remote node 0.
It would seem better to catch callers that do
cpu_to_node(<not-possible-cpu>) rather than blindly return an online node.
^ permalink raw reply
* Re: Node 0 not necessary for powerpc?
From: David Rientjes @ 2014-06-09 21:47 UTC (permalink / raw)
To: Nishanth Aravamudan
Cc: Tejun Heo, linux-mm, tony.luck, anton, Christoph Lameter,
linuxppc-dev
In-Reply-To: <20140521195743.GA5755@linux.vnet.ibm.com>
On Wed, 21 May 2014, Nishanth Aravamudan wrote:
> For context: I was looking at why N_ONLINE was statically setting Node 0
> to be online, whether or not the topology is that way -- I've been
> getting several bugs lately where Node 0 is online, but has no CPUs and
> no memory on it, on powerpc.
>
> On powerpc, setup_per_cpu_areas calls into ___alloc_bootmem_node using
> NODE_DATA(cpu_to_node(cpu)).
>
> Currently, cpu_to_node() in arch/powerpc/include/asm/topology.h does:
>
> /*
> * During early boot, the numa-cpu lookup table might not have been
> * setup for all CPUs yet. In such cases, default to node 0.
> */
> return (nid < 0) ? 0 : nid;
>
> And so early at boot, if node 0 is not present, we end up accessing an
> unitialized NODE_DATA(). So this seems buggy (I'll contact the powerpc
> deveopers separately on that).
>
I think what this really wants to do is NODE_DATA(cpu_to_mem(cpu)) and I
thought ppc had the cpu-to-local-memory-node mappings correct?
^ permalink raw reply
* Re: [patch] powerpc/spufs: remove duplicate SPUFS_CNTL_MAP_SIZE define
From: Jeremy Kerr @ 2014-06-09 23:09 UTC (permalink / raw)
To: Dan Carpenter
Cc: cbe-oss-dev, Arnd Bergmann, kernel-janitors, Paul Mackerras,
linuxppc-dev
In-Reply-To: <20140609151917.GM9600@mwanda>
Hi Dan,
> The SPUFS_CNTL_MAP_SIZE define is cut and pasted twice so we can delete
> the second instance.
Looks good to me.
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Cheers,
Jeremy
^ 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