* Re: [PATCH v2 13/13] vfio: powerpc/spapr: Enable Dynamic DMA windows
From: Alexey Kardashevskiy @ 2014-10-10 18:33 UTC (permalink / raw)
To: Alex Williamson; +Cc: linuxppc-dev, Gavin Shan, kvm, linux-kernel
In-Reply-To: <1411509370.24563.35.camel@ul30vt.home>
On 09/23/2014 11:56 PM, Alex Williamson wrote:
> On Tue, 2014-09-23 at 13:01 +1000, Alexey Kardashevskiy wrote:
>> This defines and implements VFIO IOMMU API which lets the userspace
>> create and remove DMA windows.
>>
>> This updates VFIO_IOMMU_SPAPR_TCE_GET_INFO to return the number of
>> available windows and page mask.
>>
>> This adds VFIO_IOMMU_SPAPR_TCE_CREATE and VFIO_IOMMU_SPAPR_TCE_REMOVE
>> to allow the user space to create and remove window(s).
>>
>> The VFIO IOMMU driver does basic sanity checks and calls corresponding
>> SPAPR TCE functions. At the moment only IODA2 (POWER8 PCI host bridge)
>> implements them.
>>
>> This advertises VFIO_IOMMU_SPAPR_TCE_FLAG_DDW capability via
>> VFIO_IOMMU_SPAPR_TCE_GET_INFO.
>>
>> This calls platform DDW reset() callback when IOMMU is being disabled
>> to reset the DMA configuration to its original state.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>> drivers/vfio/vfio_iommu_spapr_tce.c | 135 ++++++++++++++++++++++++++++++++++--
>> include/uapi/linux/vfio.h | 25 ++++++-
>> 2 files changed, 153 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c
>> index 0dccbc4..b518891 100644
>> --- a/drivers/vfio/vfio_iommu_spapr_tce.c
>> +++ b/drivers/vfio/vfio_iommu_spapr_tce.c
>> @@ -190,18 +190,25 @@ static void tce_iommu_disable(struct tce_container *container)
>>
>> container->enabled = false;
>>
>> - if (!container->grp || !current->mm)
>> + if (!container->grp)
>> return;
>>
>> data = iommu_group_get_iommudata(container->grp);
>> if (!data || !data->iommu_owner || !data->ops->get_table)
>> return;
>>
>> - tbl = data->ops->get_table(data, 0);
>> - if (!tbl)
>> - return;
>> + if (current->mm) {
>> + tbl = data->ops->get_table(data, 0);
>> + if (tbl)
>> + decrement_locked_vm(tbl);
>>
>> - decrement_locked_vm(tbl);
>> + tbl = data->ops->get_table(data, 1);
>> + if (tbl)
>> + decrement_locked_vm(tbl);
>> + }
>> +
>> + if (data->ops->reset)
>> + data->ops->reset(data);
>> }
>>
>> static void *tce_iommu_open(unsigned long arg)
>> @@ -243,7 +250,7 @@ static long tce_iommu_ioctl(void *iommu_data,
>> unsigned int cmd, unsigned long arg)
>> {
>> struct tce_container *container = iommu_data;
>> - unsigned long minsz;
>> + unsigned long minsz, ddwsz;
>> long ret;
>>
>> switch (cmd) {
>> @@ -288,6 +295,28 @@ static long tce_iommu_ioctl(void *iommu_data,
>> info.dma32_window_size = tbl->it_size << tbl->it_page_shift;
>> info.flags = 0;
>>
>> + ddwsz = offsetofend(struct vfio_iommu_spapr_tce_info,
>> + page_size_mask);
>> +
>> + if (info.argsz == ddwsz) {
>
>> =
>
>> + if (data->ops->query && data->ops->create &&
>> + data->ops->remove) {
>> + info.flags |= VFIO_IOMMU_SPAPR_TCE_FLAG_DDW;
>
> I think you want to set this flag regardless of whether the user has
> provided space for it. A valid use model is to call with the minimum
> size and look at the flags to determine if it needs to be called again
> with a larger size.
>
>> +
>> + ret = data->ops->query(data,
>> + &info.current_windows,
>> + &info.windows_available,
>> + &info.page_size_mask);
>> + if (ret)
>> + return ret;
>> + } else {
>> + info.current_windows = 0;
>> + info.windows_available = 0;
>> + info.page_size_mask = 0;
>> + }
>> + minsz = ddwsz;
>
> It's not really any longer the min size, is it?
>
>> + }
>> +
>> if (copy_to_user((void __user *)arg, &info, minsz))
>> return -EFAULT;
>>
>> @@ -412,12 +441,106 @@ 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->grp)
>> return -ENODEV;
>>
>> return vfio_spapr_iommu_eeh_ioctl(container->grp,
>> cmd, arg);
>> +
>> + case VFIO_IOMMU_SPAPR_TCE_CREATE: {
>> + struct vfio_iommu_spapr_tce_create create;
>> + struct spapr_tce_iommu_group *data;
>> + struct iommu_table *tbl;
>> +
>> + if (WARN_ON(!container->grp))
>
> redux previous comment on this warning
>
>> + return -ENXIO;
>> +
>> + data = iommu_group_get_iommudata(container->grp);
>> +
>> + minsz = offsetofend(struct vfio_iommu_spapr_tce_create,
>> + start_addr);
>> +
>> + if (copy_from_user(&create, (void __user *)arg, minsz))
>> + return -EFAULT;
>> +
>> + if (create.argsz < minsz)
>> + return -EINVAL;
>> +
>> + if (create.flags)
>> + return -EINVAL;
>> +
>> + if (!data->ops->create || !data->iommu_owner)
>> + return -ENOSYS;
>> +
>> + BUG_ON(!data || !data->ops || !data->ops->remove);
>
> Little late for this test since we'll oops on the previous test. Why is
> this a BUG_ON? A user could exploit this on a system with only a
> partial set of callbacks.
>
>> +
>> + ret = data->ops->create(data, create.page_shift,
>> + create.window_shift, &tbl);
>> + if (ret)
>> + return ret;
>> +
>> + ret = try_increment_locked_vm(tbl);
>> + if (ret) {
>> + data->ops->remove(data, tbl);
>> + return ret;
>> + }
>> +
>> + create.start_addr = tbl->it_offset << tbl->it_page_shift;
>> +
>> + if (copy_to_user((void __user *)arg, &create, minsz)) {
>> + data->ops->remove(data, tbl);
>> + decrement_locked_vm(tbl);
>> + return -EFAULT;
>> + }
>> + mutex_lock(&container->lock);
>> + ++container->windows_num;
>> + mutex_unlock(&container->lock);
>> +
>> + return ret;
>> + }
>> + case VFIO_IOMMU_SPAPR_TCE_REMOVE: {
>> + struct vfio_iommu_spapr_tce_remove remove;
>> + struct spapr_tce_iommu_group *data;
>> + struct iommu_table *tbl;
>> +
>> + if (WARN_ON(!container->grp))
>> + return -ENXIO;
>> +
>> + data = iommu_group_get_iommudata(container->grp);
>> +
>> + minsz = offsetofend(struct vfio_iommu_spapr_tce_remove,
>> + start_addr);
>> +
>> + if (copy_from_user(&remove, (void __user *)arg, minsz))
>> + return -EFAULT;
>> +
>> + if (remove.argsz < minsz)
>> + return -EINVAL;
>> +
>> + if (remove.flags)
>> + return -EINVAL;
>> +
>> + if (!data->ops->remove || !data->iommu_owner)
>
> On this one we don't both to get data/data->ops. Is there also an
> exploit where the user can call these CREATE/REMOVE interfaces even
> though INFO doesn't expose them if only a partial set of callbacks are
> present?
if (!data || !data->ops || !data->ops->remove || !data->iommu_owner)
should do it, right?
And I am not going to add create() without remove(), may be it is worth
adding a compile time check for that.
>
>> + return -ENOSYS;
>> +
>> + tbl = spapr_tce_find_table(container, data, remove.start_addr);
>
> What happens if this returns the 0 index rather than the expected 1
> index table? Why doesn't this call ops->find_table()?
Why ops->find_table()? They are different (->find_table() searches for the
window by number, spapr_tce_find_table() searches by address), I do not
understand this comment.
And removing window#0 is supported.
>
>> + if (!tbl)
>> + return -EINVAL;
>> +
>> + ret = data->ops->remove(data, tbl);
>> + if (ret)
>> + return ret;
>> +
>> + decrement_locked_vm(tbl);
>> +
>> + mutex_lock(&container->lock);
>> + --container->windows_num;
>> + mutex_unlock(&container->lock);
>> +
>> + return 0;
>> + }
>> }
>>
>> return -ENOTTY;
>> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
>> index 6612974..e71a6ef 100644
>> --- a/include/uapi/linux/vfio.h
>> +++ b/include/uapi/linux/vfio.h
>> @@ -451,9 +451,13 @@ struct vfio_iommu_type1_dma_unmap {
>> */
>> struct vfio_iommu_spapr_tce_info {
>> __u32 argsz;
>> - __u32 flags; /* reserved for future use */
>> + __u32 flags;
>> +#define VFIO_IOMMU_SPAPR_TCE_FLAG_DDW 1 /* Support dynamic windows */
>> __u32 dma32_window_start; /* 32 bit window start (bytes) */
>> __u32 dma32_window_size; /* 32 bit window size (bytes) */
>> + __u32 current_windows;
>> + __u32 windows_available;
>> + __u32 page_size_mask;
>> };
>>
>> #define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
>> @@ -489,6 +493,25 @@ struct vfio_eeh_pe_op {
>>
>> #define VFIO_EEH_PE_OP _IO(VFIO_TYPE, VFIO_BASE + 21)
>>
>> +struct vfio_iommu_spapr_tce_create {
>> + __u32 argsz;
>> + __u32 flags;
>> + /* in */
>> + __u32 page_shift;
>> + __u32 window_shift;
>> + /* out */
>> + __u64 start_addr;
>> +};
>> +#define VFIO_IOMMU_SPAPR_TCE_CREATE _IO(VFIO_TYPE, VFIO_BASE + 18)
>> +
>> +struct vfio_iommu_spapr_tce_remove {
>> + __u32 argsz;
>> + __u32 flags;
>> + /* in */
>> + __u64 start_addr;
>> +};
>> +#define VFIO_IOMMU_SPAPR_TCE_REMOVE _IO(VFIO_TYPE, VFIO_BASE + 19)
>> +
>
> Zero comments, no good.
Right. I'll fix it. Thanks for the review.
>
>> /* ***************************************************************** */
>>
>> #endif /* _UAPIVFIO_H */
>
>
>
--
Alexey
^ permalink raw reply
* [git pull] Please pull mpe.git for-linus branch (for powerpc)
From: Michael Ellerman @ 2014-10-10 22:46 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev list, Arnd Bergmann, LKML, gregkh
[-- Attachment #1: Type: text/plain, Size: 26335 bytes --]
Hi Linus,
Here's a first pull request for powerpc updates for 3.18.
The bulk of the additions are for the "cxl" driver, for IBM's Coherent
Accelerator Processor Interface (CAPI). Most of it's in drivers/misc, which
Greg & Arnd maintain, Greg said he was happy for us to take it through our
tree. I've CC'ed them in case they have any last minute objections.
There's the usual minor cleanups and fixes, including a bit of noise in drivers
from some of those. A bunch of updates to our EEH code, which has been getting
more testing. Several nice speedups from Anton, including 20% in clear_page().
And a bunch of updates for freescale from Scott.
cheers
The following changes since commit 9e82bf014195d6f0054982c463575cdce24292be:
Linux 3.17-rc5 (2014-09-14 17:50:12 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux.git for-linus
for you to fetch changes up to d53ba6b3bba33432cc37b7101a86f8f3392c46e7:
cxl: Fix afu_read() not doing finish_wait() on signal or non-blocking (2014-10-09 11:29:57 +1100)
----------------------------------------------------------------
Aaron Sierra (2):
fsl_ifc: Fix csor_ext position in fsl_ifc_regs
powerpc: fsl_pci: Add forced PCI Agent enumeration
Alexey Kardashevskiy (1):
powerpc/iommu/ddw: Fix endianness
Andreas Schwab (1):
powerpc: Simplify symbol check in prom_init_check.sh
Anton Blanchard (23):
powerpc: Move adb symbol exports next to function definitions
powerpc: Move via-cuda symbol exports next to function definitions
powerpc: Move more symbol exports next to function definitions
powerpc: Remove unused 32bit symbol exports
powerpc: Move lib symbol exports into arch/powerpc/lib/ppc_ksyms.c
powerpc: Separate ppc32 symbol exports into ppc_ksyms_32.c
powerpc: Make a bunch of things static
powerpc: Ensure global functions include their prototype
powerpc: Remove stale function prototypes
powerpc: Move htab_remove_mapping function prototype into header file
powerpc: Add POWER8 CPU selection
powerpc: Use CONFIG_ARCH_HAS_FAST_MULTIPLIER
powerpc: Implement load_unaligned_zeropad
powerpc: ppc64le optimised word at a time
powerpc: Enable DCACHE_WORD_ACCESS on ppc64le
powerpc: Speed up clear_page by unrolling it
powerpc: Simplify do_sigbus
powerpc: Add VM_FAULT_HWPOISON handling to powerpc page fault handler
powerpc: Fill in si_addr_lsb siginfo field
powerpc: Use pr_fmt in module loader code
powerpc: Remove powerpc specific cmd_line
powerpc: Add printk levels to powernv platform code
powerpc: Add printk levels to powerpc code
Benjamin Herrenschmidt (1):
powerpc/powernv: Fix endian bug in LPC bus debugfs accessors
Cody P Schafer (1):
powerpc/perf/hv-24x7: use kmem_cache instead of aligned stack allocations
Gavin Shan (21):
powerpc/eeh: Drop unused argument in eeh_check_failure()
powerpc/eeh: Add eeh_pe_state sysfs entry
powerpc/eeh: Freeze PE before PE reset
powerpc/eeh: Reenable PCI devices after reset
powerpc/eeh: Clear frozen state on passing device
powerpc/powernv: Sync header with firmware
powerpc/eeh: Introduce eeh_ops::err_inject
powerpc/powernv: Clear PAPR error injection registers
powerpc/eeh: Clear frozen device state in time
powerpc/eeh: Fix improper condition in eeh_pci_enable()
powerpc/eeh: Unfreeze PE on enabling EEH functionality
powerpc/eeh: Use eeh_unfreeze_pe()
powerpc/eeh: Block PCI config access during reset
powerpc/pseries: Decrease message level on EEH initialization
powerpc/powernv: Sync OpalPciResetScope with firmware
powerpc/eeh: Tag reset state for user owned PE
powerpc/eeh: Emulate EEH recovery for VFIO devices
powerpc/eeh: Dump PCI config space for all child devices
powerpc/powernv: Fetch frozen PE on top level
powerpc/powernv: Override dma_get_required_mask()
powerpc/eeh: Show hex prefix for PE state sysfs
Himangi Saraogi (1):
powerpc/pseries: Drop unnecessary continue
Ian Munsie (17):
powerpc/cell: Move spu_handle_mm_fault() out of cell platform
powerpc/cell: Move data segment faulting code out of cell platform
powerpc/cell: Make spu_flush_all_slbs() generic
powerpc/msi: Improve IRQ bitmap allocator
powerpc/mm: Export mmu_kernel_ssize and mmu_linear_psize
powerpc/powernv: Split out set MSI IRQ chip code
cxl: Add new header for call backs and structs
powerpc/powerpc: Add new PCIe functions for allocating cxl interrupts
powerpc/mm: Add new hash_page_mm()
powerpc/opal: Add PHB to cxl mode call
powerpc/mm: Add hooks for cxl
cxl: Add base builtin support
cxl: Driver code for powernv PCIe based cards for userspace access
cxl: Add userspace header file
cxl: Add driver to Kbuild and Makefiles
cxl: Add documentation for userspace APIs
cxl: Fix afu_read() not doing finish_wait() on signal or non-blocking
Joe Perches (2):
powerpc: pci-ioda: Remove unnecessary return value from printk
powerpc: pci-ioda: Use a single function to emit logging messages
LEROY Christophe (7):
powerpc/8xx: Declare SPRG2 as a SCRATCH register
powerpc/8xx: Use SCRATCH0 and SCRATCH1 also for TLB handlers
powerpc/8xx: Remove loading of r10 at end of FixupDAR
powerpc/8xx: Fix comment about DIRTY update
powerpc/8xx: No need to save r10 and r3 when not calling FixupDAR
powerpc/8xx: Optimize verification in FixupDAR
powerpc/8xx: Duplicate two insns instead of branching
Li Zhong (3):
powerpc: Fix warning reported by verify_cpu_node_mapping()
powerpc: Only set numa node information for present cpus at boottime
powerpc: some changes in numa_setup_cpu()
Michael Ellerman (9):
powerpc: Check flat device tree version at boot
powerpc/ppc64: Clean up the boot-time settings display
powerpc/ppc64: Print CPU/MMU/FW features at boot
powerpc/mm: Unindent htab_dt_scan_page_sizes()
selftests/powerpc: Add test of load_unaligned_zero_pad()
powerpc: Don't build powernv for other platform defconfigs
powerpc/kdump: crash_dump.c needs to include io.h
powerpc: Enable CONFIG_CRASH_DUMP=y for ppc64_defconfig
Merge branch 'next' of git://git.kernel.org/.../scottwood/linux.git
Michael Neuling (5):
powerpc/powernv: Add OPAL check token call
powerpc/powernv: Check OPAL RTC calls exists before using
powerpc/powernv: Check OPAL elog calls exist before using
powerpc/powernv: Check OPAL dump calls exist before using
powerpc/pseries: Use new defines when calling H_SET_MODE
Mike Qiu (1):
powerpc/powernv: Add PCI error injection debugfs entry
Nikhil Badola (3):
powerpc: configs: Add VFAT file-system configs
powerpc: dts: t4240: Change T4240 USB controller version
powerpc: dts: t208x: Change T208x USB controller version
Paul Mackerras (4):
powerpc/powernv: Don't call generic code on offline cpus
powerpc: Split out instruction analysis part of emulate_step()
powerpc: Emulate icbi, mcrf and conditional-trap instructions
powerpc: Implement emulation of string loads and stores
Pranith Kumar (4):
powerpc: Fix build error with CONFIG_PCI=n
powerpc: Export dcr_ind_lock to fix build error
powerpc: Fix build failure on 44x
powerpc: Fix build failure when CONFIG_USB=y
Priyanka Jain (2):
powerpc/fsl-booke: Add initial T1040/T1042 RDB board support
powerpc/fsl-booke: Add initial T1042RDB_PI board support
Scott Wood (7):
powerpc: Dynamic DMA zone limits
powerpc/64: Honor swiotlb limit in coherent allocations
powerpc/64: Limit ZONE_DMA32 to 4GiB in swiotlb_detect_4g()
powerpc/fsl-pci: Limit ZONE_DMA32 to 2GiB on 64-bit platforms
powerpc/85xx/defconfig: Remove duplicate CONFIG_RTC_DRV_DS1307
powerpc/mm: Use common paging_init() for NUMA
Revert "powerpc/fsl_msi: spread msi ints across different MSIRs"
Thomas Falcon (2):
pseries: Fix endian issues in onlining cpu threads
pseries: Fix endian issues in cpu hot-removal
Tony Breeds (1):
powerpc/boot: Don't install zImage.* from make install
Tudor Laurentiu (6):
powerpc/fsl_msi: support vmpic msi with mpic 4.3
powerpc/fsl_msi: reorganize structs to improve clarity and flexibility
powerpc/fsl_msi: change the irq handler from chained to normal
powerpc/fsl_msi: show more meaningful names in /proc/interrupts
powerpc/fsl_msi: spread msi ints across different MSIRs
powerpc/fsl-booke64: add missing virtualization options in defconfig
Uwe Kleine-König (1):
powerpc: make of_device_ids const
Vasant Hegde (1):
powerpc/powernv: Improve error messages in dump code
Wei Yang (2):
powerpc/eeh: Fix kernel crash when passing through VF
powerpc/pci: remove duplicate declaration of pci_bus_find_capability
Zhouyi Zhou (1):
powerpc/jump_label: use HAVE_JUMP_LABEL?
sukadev@linux.vnet.ibm.com (2):
powerpc/perf/hv-24x7: Simplify catalog_read()
powerpc: Update contact info in Documentation files
.../testing/sysfs-bus-event_source-devices-hv_24x7 | 6 +-
.../testing/sysfs-bus-event_source-devices-hv_gpci | 12 +-
Documentation/ABI/testing/sysfs-class-cxl | 129 +++
Documentation/devicetree/bindings/pci/fsl,pci.txt | 27 +
Documentation/ioctl/ioctl-number.txt | 1 +
Documentation/powerpc/00-INDEX | 2 +
Documentation/powerpc/cxl.txt | 379 ++++++++
MAINTAINERS | 12 +
arch/powerpc/Kconfig | 11 +-
arch/powerpc/Makefile | 1 +
arch/powerpc/boot/Makefile | 5 +
arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 4 +-
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 4 +-
arch/powerpc/boot/dts/t1040rdb.dts | 48 +
arch/powerpc/boot/dts/t1042rdb.dts | 48 +
arch/powerpc/boot/dts/t1042rdb_pi.dts | 57 ++
arch/powerpc/boot/dts/t104xrdb.dtsi | 156 +++
arch/powerpc/configs/cell_defconfig | 1 +
arch/powerpc/configs/celleb_defconfig | 1 +
arch/powerpc/configs/corenet32_smp_defconfig | 2 +
arch/powerpc/configs/corenet64_smp_defconfig | 46 +-
arch/powerpc/configs/g5_defconfig | 1 +
arch/powerpc/configs/maple_defconfig | 1 +
arch/powerpc/configs/mpc85xx_defconfig | 4 +-
arch/powerpc/configs/mpc85xx_smp_defconfig | 4 +-
arch/powerpc/configs/mpc86xx_defconfig | 3 +
arch/powerpc/configs/pasemi_defconfig | 1 +
arch/powerpc/configs/ppc64_defconfig | 1 +
arch/powerpc/include/asm/bug.h | 1 -
arch/powerpc/include/asm/copro.h | 29 +
arch/powerpc/include/asm/dma-mapping.h | 1 +
arch/powerpc/include/asm/eeh.h | 39 +-
arch/powerpc/include/asm/hydra.h | 1 -
arch/powerpc/include/asm/irq.h | 5 -
arch/powerpc/include/asm/kexec.h | 1 -
arch/powerpc/include/asm/machdep.h | 2 -
arch/powerpc/include/asm/mmu-hash64.h | 10 +
arch/powerpc/include/asm/opal.h | 45 +-
arch/powerpc/include/asm/page_64.h | 43 +-
arch/powerpc/include/asm/pgtable-ppc32.h | 6 +-
arch/powerpc/include/asm/pgtable-ppc64-4k.h | 2 +-
arch/powerpc/include/asm/pgtable-ppc64.h | 6 +-
arch/powerpc/include/asm/pgtable.h | 3 +
arch/powerpc/include/asm/plpar_wrappers.h | 12 +-
arch/powerpc/include/asm/pnv-pci.h | 31 +
arch/powerpc/include/asm/prom.h | 2 -
arch/powerpc/include/asm/reg.h | 3 +-
arch/powerpc/include/asm/rio.h | 1 -
arch/powerpc/include/asm/spu.h | 5 +-
arch/powerpc/include/asm/sstep.h | 62 ++
arch/powerpc/include/asm/tsi108.h | 4 -
arch/powerpc/include/asm/udbg.h | 1 -
arch/powerpc/include/asm/word-at-a-time.h | 112 ++-
arch/powerpc/include/asm/xics.h | 1 +
arch/powerpc/kernel/Makefile | 3 +
arch/powerpc/kernel/crash_dump.c | 1 +
arch/powerpc/kernel/dma-swiotlb.c | 8 +-
arch/powerpc/kernel/dma.c | 47 +-
arch/powerpc/kernel/eeh.c | 269 ++++--
arch/powerpc/kernel/eeh_driver.c | 106 ++-
arch/powerpc/kernel/eeh_pe.c | 23 +-
arch/powerpc/kernel/eeh_sysfs.c | 41 +-
arch/powerpc/kernel/head_8xx.S | 150 ++-
arch/powerpc/kernel/hw_breakpoint.c | 2 +-
arch/powerpc/kernel/ibmebus.c | 2 +-
arch/powerpc/kernel/idle_power7.S | 2 +-
arch/powerpc/kernel/irq.c | 6 +-
arch/powerpc/kernel/legacy_serial.c | 2 +-
arch/powerpc/kernel/module_32.c | 31 +-
arch/powerpc/kernel/module_64.c | 36 +-
arch/powerpc/kernel/nvram_64.c | 2 +-
arch/powerpc/kernel/of_platform.c | 2 +-
arch/powerpc/kernel/pci-common.c | 3 +-
arch/powerpc/kernel/pci_of_scan.c | 2 +-
arch/powerpc/kernel/ppc_ksyms.c | 192 +---
arch/powerpc/kernel/ppc_ksyms_32.c | 61 ++
arch/powerpc/kernel/process.c | 2 +
arch/powerpc/kernel/prom.c | 13 +-
arch/powerpc/kernel/prom_init_check.sh | 22 +-
arch/powerpc/kernel/ptrace.c | 2 +-
arch/powerpc/kernel/rtasd.c | 2 +-
arch/powerpc/kernel/setup-common.c | 7 +-
arch/powerpc/kernel/setup_32.c | 2 +-
arch/powerpc/kernel/setup_64.c | 32 +-
arch/powerpc/kernel/smp.c | 11 +-
arch/powerpc/kernel/time.c | 5 +-
arch/powerpc/lib/Makefile | 2 +-
arch/powerpc/lib/feature-fixups.c | 2 +-
arch/powerpc/lib/ppc_ksyms.c | 39 +
arch/powerpc/lib/sstep.c | 996 ++++++++++++-------
arch/powerpc/mm/Makefile | 1 +
.../cell/spu_fault.c => mm/copro_fault.c} | 69 +-
arch/powerpc/mm/fault.c | 43 +-
arch/powerpc/mm/hash_native_64.c | 6 +-
arch/powerpc/mm/hash_utils_64.c | 160 ++--
arch/powerpc/mm/init_32.c | 4 +-
arch/powerpc/mm/init_64.c | 3 -
arch/powerpc/mm/mem.c | 68 +-
arch/powerpc/mm/numa.c | 27 +-
arch/powerpc/mm/pgtable.c | 2 +-
arch/powerpc/mm/slb.c | 3 -
arch/powerpc/mm/slice.c | 12 +-
arch/powerpc/oprofile/backtrace.c | 1 +
arch/powerpc/perf/core-book3s.c | 18 +-
arch/powerpc/perf/hv-24x7.c | 156 +--
arch/powerpc/platforms/40x/ep405.c | 2 +-
arch/powerpc/platforms/40x/ppc40x_simple.c | 2 +-
arch/powerpc/platforms/40x/virtex.c | 2 +-
arch/powerpc/platforms/40x/walnut.c | 2 +-
arch/powerpc/platforms/44x/Kconfig | 6 +-
arch/powerpc/platforms/44x/canyonlands.c | 2 +-
arch/powerpc/platforms/44x/ebony.c | 2 +-
arch/powerpc/platforms/44x/iss4xx.c | 2 +-
arch/powerpc/platforms/44x/ppc44x_simple.c | 2 +-
arch/powerpc/platforms/44x/ppc476.c | 2 +-
arch/powerpc/platforms/44x/sam440ep.c | 2 +-
arch/powerpc/platforms/44x/virtex.c | 2 +-
arch/powerpc/platforms/44x/warp.c | 2 +-
arch/powerpc/platforms/512x/mpc512x_shared.c | 2 +-
arch/powerpc/platforms/52xx/lite5200.c | 4 +-
arch/powerpc/platforms/52xx/media5200.c | 2 +-
arch/powerpc/platforms/52xx/mpc52xx_common.c | 12 +-
arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c | 2 +-
arch/powerpc/platforms/52xx/mpc52xx_pic.c | 4 +-
arch/powerpc/platforms/82xx/ep8248e.c | 2 +-
arch/powerpc/platforms/82xx/km82xx.c | 2 +-
arch/powerpc/platforms/82xx/mpc8272_ads.c | 2 +-
arch/powerpc/platforms/82xx/pq2fads.c | 2 +-
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 2 +-
arch/powerpc/platforms/83xx/misc.c | 2 +-
arch/powerpc/platforms/83xx/mpc834x_itx.c | 2 +-
arch/powerpc/platforms/83xx/suspend.c | 4 +-
arch/powerpc/platforms/85xx/Kconfig | 2 +-
arch/powerpc/platforms/85xx/common.c | 2 +-
arch/powerpc/platforms/85xx/corenet_generic.c | 14 +
arch/powerpc/platforms/85xx/ppa8548.c | 2 +-
arch/powerpc/platforms/85xx/qemu_e500.c | 10 +
arch/powerpc/platforms/85xx/sgy_cts1000.c | 4 +-
arch/powerpc/platforms/86xx/gef_ppc9a.c | 2 +-
arch/powerpc/platforms/86xx/gef_sbc310.c | 2 +-
arch/powerpc/platforms/86xx/gef_sbc610.c | 2 +-
arch/powerpc/platforms/86xx/mpc8610_hpcd.c | 2 +-
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 2 +-
arch/powerpc/platforms/86xx/sbc8641d.c | 2 +-
arch/powerpc/platforms/8xx/adder875.c | 2 +-
arch/powerpc/platforms/8xx/ep88xc.c | 2 +-
arch/powerpc/platforms/8xx/mpc86xads_setup.c | 2 +-
arch/powerpc/platforms/8xx/mpc885ads_setup.c | 2 +-
arch/powerpc/platforms/8xx/tqm8xx_setup.c | 2 +-
arch/powerpc/platforms/Kconfig.cputype | 6 +
arch/powerpc/platforms/cell/Kconfig | 1 +
arch/powerpc/platforms/cell/Makefile | 2 +-
arch/powerpc/platforms/cell/celleb_pci.c | 2 +-
arch/powerpc/platforms/cell/celleb_setup.c | 2 +-
arch/powerpc/platforms/cell/spu_base.c | 55 +-
arch/powerpc/platforms/cell/spufs/fault.c | 4 +-
arch/powerpc/platforms/chrp/setup.c | 2 +-
arch/powerpc/platforms/embedded6xx/gamecube.c | 2 +-
arch/powerpc/platforms/embedded6xx/linkstation.c | 2 +-
arch/powerpc/platforms/embedded6xx/mvme5100.c | 2 +-
arch/powerpc/platforms/embedded6xx/storcenter.c | 2 +-
arch/powerpc/platforms/embedded6xx/wii.c | 2 +-
arch/powerpc/platforms/pasemi/gpio_mdio.c | 2 +-
arch/powerpc/platforms/pasemi/setup.c | 2 +-
arch/powerpc/platforms/powermac/setup.c | 8 +-
arch/powerpc/platforms/powernv/eeh-ioda.c | 226 ++++-
arch/powerpc/platforms/powernv/eeh-powernv.c | 26 +
arch/powerpc/platforms/powernv/opal-dump.c | 18 +-
arch/powerpc/platforms/powernv/opal-elog.c | 4 +
arch/powerpc/platforms/powernv/opal-lpc.c | 4 +-
arch/powerpc/platforms/powernv/opal-nvram.c | 2 +-
arch/powerpc/platforms/powernv/opal-rtc.c | 15 +-
arch/powerpc/platforms/powernv/opal-tracepoints.c | 2 +-
arch/powerpc/platforms/powernv/opal-wrappers.S | 3 +
arch/powerpc/platforms/powernv/opal.c | 6 +-
arch/powerpc/platforms/powernv/pci-ioda.c | 290 ++++--
arch/powerpc/platforms/powernv/pci.c | 11 +
arch/powerpc/platforms/powernv/pci.h | 4 +
arch/powerpc/platforms/powernv/powernv.h | 6 +
arch/powerpc/platforms/powernv/setup.c | 11 +-
arch/powerpc/platforms/powernv/smp.c | 8 +-
arch/powerpc/platforms/powernv/subcore.c | 1 +
arch/powerpc/platforms/pseries/cmm.c | 1 -
arch/powerpc/platforms/pseries/dlpar.c | 29 +-
arch/powerpc/platforms/pseries/eeh_pseries.c | 40 +-
arch/powerpc/platforms/pseries/hotplug-cpu.c | 10 +-
arch/powerpc/platforms/pseries/hotplug-memory.c | 1 +
arch/powerpc/platforms/pseries/iommu.c | 51 +-
arch/powerpc/platforms/pseries/lpar.c | 4 +-
arch/powerpc/platforms/pseries/nvram.c | 12 +-
arch/powerpc/platforms/pseries/pci.c | 1 +
arch/powerpc/platforms/pseries/ras.c | 2 +-
arch/powerpc/platforms/pseries/setup.c | 2 +-
arch/powerpc/sysdev/axonram.c | 2 +-
arch/powerpc/sysdev/dcr.c | 1 +
arch/powerpc/sysdev/fsl_85xx_l2ctlr.c | 2 +-
arch/powerpc/sysdev/fsl_msi.c | 95 +-
arch/powerpc/sysdev/fsl_msi.h | 4 +-
arch/powerpc/sysdev/fsl_pci.c | 3 +-
arch/powerpc/sysdev/mpic.c | 2 +-
arch/powerpc/sysdev/msi_bitmap.c | 42 +-
arch/powerpc/sysdev/mv64x60_dev.c | 2 +-
arch/powerpc/sysdev/pmi.c | 2 +-
arch/powerpc/sysdev/xics/icp-native.c | 25 +
arch/powerpc/sysdev/xilinx_intc.c | 2 +-
arch/powerpc/sysdev/xilinx_pci.c | 2 +-
drivers/cpufreq/pmac32-cpufreq.c | 2 +-
drivers/macintosh/adb.c | 5 +
drivers/macintosh/via-cuda.c | 2 +
drivers/misc/Kconfig | 1 +
drivers/misc/Makefile | 1 +
drivers/misc/cxl/Kconfig | 25 +
drivers/misc/cxl/Makefile | 3 +
drivers/misc/cxl/base.c | 86 ++
drivers/misc/cxl/context.c | 193 ++++
drivers/misc/cxl/cxl.h | 629 ++++++++++++
drivers/misc/cxl/debugfs.c | 132 +++
drivers/misc/cxl/fault.c | 291 ++++++
drivers/misc/cxl/file.c | 518 ++++++++++
drivers/misc/cxl/irq.c | 402 ++++++++
drivers/misc/cxl/main.c | 230 +++++
drivers/misc/cxl/native.c | 683 +++++++++++++
drivers/misc/cxl/pci.c | 1000 ++++++++++++++++++++
drivers/misc/cxl/sysfs.c | 385 ++++++++
drivers/tty/hvc/hvc_vio.c | 2 +-
include/linux/fsl_ifc.h | 6 +-
include/misc/cxl.h | 48 +
include/uapi/Kbuild | 1 +
include/uapi/misc/Kbuild | 2 +
include/uapi/misc/cxl.h | 88 ++
tools/testing/selftests/powerpc/Makefile | 2 +-
.../testing/selftests/powerpc/primitives/Makefile | 17 +
.../selftests/powerpc/primitives/asm/asm-compat.h | 1 +
.../selftests/powerpc/primitives/asm/ppc-opcode.h | 0
.../powerpc/primitives/load_unaligned_zeropad.c | 147 +++
.../selftests/powerpc/primitives/word-at-a-time.h | 1 +
236 files changed, 8633 insertions(+), 1566 deletions(-)
create mode 100644 Documentation/ABI/testing/sysfs-class-cxl
create mode 100644 Documentation/devicetree/bindings/pci/fsl,pci.txt
create mode 100644 Documentation/powerpc/cxl.txt
create mode 100644 arch/powerpc/boot/dts/t1040rdb.dts
create mode 100644 arch/powerpc/boot/dts/t1042rdb.dts
create mode 100644 arch/powerpc/boot/dts/t1042rdb_pi.dts
create mode 100644 arch/powerpc/boot/dts/t104xrdb.dtsi
create mode 100644 arch/powerpc/include/asm/copro.h
create mode 100644 arch/powerpc/include/asm/pnv-pci.h
create mode 100644 arch/powerpc/kernel/ppc_ksyms_32.c
create mode 100644 arch/powerpc/lib/ppc_ksyms.c
rename arch/powerpc/{platforms/cell/spu_fault.c => mm/copro_fault.c} (56%)
create mode 100644 drivers/misc/cxl/Kconfig
create mode 100644 drivers/misc/cxl/Makefile
create mode 100644 drivers/misc/cxl/base.c
create mode 100644 drivers/misc/cxl/context.c
create mode 100644 drivers/misc/cxl/cxl.h
create mode 100644 drivers/misc/cxl/debugfs.c
create mode 100644 drivers/misc/cxl/fault.c
create mode 100644 drivers/misc/cxl/file.c
create mode 100644 drivers/misc/cxl/irq.c
create mode 100644 drivers/misc/cxl/main.c
create mode 100644 drivers/misc/cxl/native.c
create mode 100644 drivers/misc/cxl/pci.c
create mode 100644 drivers/misc/cxl/sysfs.c
create mode 100644 include/misc/cxl.h
create mode 100644 include/uapi/misc/Kbuild
create mode 100644 include/uapi/misc/cxl.h
create mode 100644 tools/testing/selftests/powerpc/primitives/Makefile
create mode 120000 tools/testing/selftests/powerpc/primitives/asm/asm-compat.h
create mode 100644 tools/testing/selftests/powerpc/primitives/asm/ppc-opcode.h
create mode 100644 tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c
create mode 120000 tools/testing/selftests/powerpc/primitives/word-at-a-time.h
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* RE: [PATCH 2/3] qe: run qe_init and qe_ic_init
From: qiang.zhao @ 2014-10-11 6:22 UTC (permalink / raw)
To: Scott Wood
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Xiaobo Xie
In-Reply-To: <1412962492.13320.587.camel@snotra.buserror.net>
T24gU2F0LCAyMDE0LTEwLTExIGF0IDAxOjM1QU0sIFdvb2QgU2NvdHQgd3JvdGU6DQo+IC0tLS0t
T3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IFdvb2QgU2NvdHQtQjA3NDIxDQo+IFNlbnQ6
IFNhdHVyZGF5LCBPY3RvYmVyIDExLCAyMDE0IDE6MzUgQU0NCj4gVG86IFpoYW8gUWlhbmctQjQ1
NDc1DQo+IENjOiBsaW51eHBwYy1kZXZAbGlzdHMub3psYWJzLm9yZzsgbGludXgta2VybmVsQHZn
ZXIua2VybmVsLm9yZzsgV29vZA0KPiBTY290dC1CMDc0MjE7IFhpZSBYaWFvYm8tUjYzMDYxDQo+
IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMi8zXSBxZTogcnVuIHFlX2luaXQgYW5kIHFlX2ljX2luaXQN
Cj4gDQo+IE9uIEZyaSwgMjAxNC0xMC0xMCBhdCAxNDo0OCArMDgwMCwgWmhhbyBRaWFuZyB3cm90
ZToNCj4gPiBxZSBhbmQgcWVfaWMgbmVlZCB0byBiZSBpbml0aWFsaXplZCBiZWZvcmUgdGhlIHFl
IGFwcCBkcml2ZXJzLCB1c2luZw0KPiA+IHN1YnN5c19pbml0Y2FsbCB0byBydW4gcWVfaW5pdCBh
bmQgcWVfaWNfaW5pdA0KPiA+DQo+ID4gU2lnbmVkLW9mZi1ieTogWmhhbyBRaWFuZyA8QjQ1NDc1
QGZyZWVzY2FsZS5jb20+DQo+ID4gLS0tDQo+ID4gIGRyaXZlcnMvc29jL3FlL3FlLmMgICAgfCAx
NSArKysrKysrKysrKysrKysNCj4gPiAgZHJpdmVycy9zb2MvcWUvcWVfaWMuYyB8IDE1ICsrKysr
KysrKysrKysrKw0KPiA+ICAyIGZpbGVzIGNoYW5nZWQsIDMwIGluc2VydGlvbnMoKykNCj4gPg0K
PiA+IGRpZmYgLS1naXQgYS9kcml2ZXJzL3NvYy9xZS9xZS5jIGIvZHJpdmVycy9zb2MvcWUvcWUu
YyBpbmRleA0KPiA+IDJhYWE1YjIuLmJmZWEwZjggMTAwNjQ0DQo+ID4gLS0tIGEvZHJpdmVycy9z
b2MvcWUvcWUuYw0KPiA+ICsrKyBiL2RyaXZlcnMvc29jL3FlL3FlLmMNCj4gPiBAQCAtNjgzLDYg
KzY4MywyMSBAQCB1bnNpZ25lZCBpbnQgcWVfZ2V0X251bV9vZl9zbnVtcyh2b2lkKSAgfQ0KPiA+
IEVYUE9SVF9TWU1CT0wocWVfZ2V0X251bV9vZl9zbnVtcyk7DQo+ID4NCj4gPiArc3RhdGljIGlu
dCBfX2luaXQgcWVfaW5pdCh2b2lkKQ0KPiA+ICt7DQo+ID4gKwlzdHJ1Y3QgZGV2aWNlX25vZGUg
Km5wOw0KPiA+ICsNCj4gPiArCW5wID0gb2ZfZmluZF9jb21wYXRpYmxlX25vZGUoTlVMTCwgTlVM
TCwgImZzbCxxZSIpOw0KPiA+ICsJaWYgKCFucCkgew0KPiA+ICsJCXByX2VycigiJXM6IENvdWxk
IG5vdCBmaW5kIFF1aWNjIEVuZ2luZSBub2RlXG4iLCBfX2Z1bmNfXyk7DQo+ID4gKwkJcmV0dXJu
IC1FTk9ERVY7DQo+ID4gKwl9DQo+ID4gKwlxZV9yZXNldCgpOw0KPiA+ICsJb2Zfbm9kZV9wdXQo
bnApOw0KPiA+ICsJcmV0dXJuIDA7DQo+ID4gK30NCj4gPiArc3Vic3lzX2luaXRjYWxsKHFlX2lu
aXQpOw0KPiANCj4gSXQgaXMgbm90IGFuIGVycm9yIHRvIGVuYWJsZSBRRSBzdXBwb3J0IG9uIGhh
cmR3YXJlIHRoYXQgZG9lc24ndCBoYXZlIFFFLg0KPiBQbGVhc2UgcmVtb3ZlIHRoZSBwcl9lcnIo
KS4NCk9LLCB3aWxsIGJlIG1vZGlmaWVkIG9uIFYyLg0KPiANCj4gPiArDQo+ID4gICNpZiBkZWZp
bmVkKENPTkZJR19TVVNQRU5EKSAmJiBkZWZpbmVkKENPTkZJR19QUENfODV4eCkgIHN0YXRpYyBp
bnQNCj4gPiBxZV9yZXN1bWUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqb2ZkZXYpICB7IGRpZmYg
LS1naXQNCj4gPiBhL2RyaXZlcnMvc29jL3FlL3FlX2ljLmMgYi9kcml2ZXJzL3NvYy9xZS9xZV9p
Yy5jIGluZGV4DQo+ID4gY2MxYjhkNS4uMTFmZTk4YyAxMDA2NDQNCj4gPiAtLS0gYS9kcml2ZXJz
L3NvYy9xZS9xZV9pYy5jDQo+ID4gKysrIGIvZHJpdmVycy9zb2MvcWUvcWVfaWMuYw0KPiA+IEBA
IC0zNCw2ICszNCw3IEBADQo+ID4gICNpbmNsdWRlIDxsaW51eC9mc2wvcWVfaWMuaD4NCj4gPg0K
PiA+ICAjaW5jbHVkZSAicWVfaWMuaCINCj4gPiArI2luY2x1ZGUgIi4uLy4uL2lycWNoaXAvaXJx
Y2hpcC5oIg0KPiANCj4gV2hhdCBkbyB5b3UgbmVlZCBmcm9tIGhlcmUsIGFuZCBjYW4gaXQgYmUg
bW92ZWQgdG8gaW5jbHVkZS9saW51eC8uLi4/DQo+IA0KPiBUaGUgb25seSB0aGluZyBJIHNlZSBk
ZWZpbmVkIGluIGlycWNoaXAuaCBpcyBJUlFDSElQX0RFQ0xBUkUsIGFuZCB5b3UNCj4gZG9uJ3Qg
dXNlIHRoYXQgaW4gdGhpcyBwYXRjaC4uLg0KT0ssIHdpbGwgYmUgbW9kaWZpZWQgb24gVjIuDQo+
IA0KPiAtU2NvdHQNCj4gDQo+ID4gIHN0YXRpYyBERUZJTkVfUkFXX1NQSU5MT0NLKHFlX2ljX2xv
Y2spOw0KPiA+DQo+ID4gQEAgLTUwMSw0ICs1MDIsMTggQEAgc3RhdGljIGludCBfX2luaXQgaW5p
dF9xZV9pY19zeXNmcyh2b2lkKQ0KPiA+ICAJcmV0dXJuIDA7DQo+ID4gIH0NCj4gPg0KPiA+ICtz
dGF0aWMgaW50IF9faW5pdCBxZWljX29mX2luaXQodm9pZCkNCj4gPiArew0KPiA+ICsJc3RydWN0
IGRldmljZV9ub2RlICpucDsNCj4gPiArDQo+ID4gKwlucCA9IG9mX2ZpbmRfY29tcGF0aWJsZV9u
b2RlKE5VTEwsIE5VTEwsICJmc2wscWUtaWMiKTsNCj4gPiArCWlmIChucCkgew0KPiA+ICsJCXFl
X2ljX2luaXQobnAsIDAsIHFlX2ljX2Nhc2NhZGVfbG93X21waWMsDQo+ID4gKwkJCSAgIHFlX2lj
X2Nhc2NhZGVfaGlnaF9tcGljKTsNCj4gPiArCQlvZl9ub2RlX3B1dChucCk7DQo+ID4gKwl9DQo+
ID4gKwlyZXR1cm4gMDsNCj4gPiArfQ0KPiA+ICtzdWJzeXNfaW5pdGNhbGwocWVpY19vZl9pbml0
KTsNCj4gPiArDQo+ID4gIHN1YnN5c19pbml0Y2FsbChpbml0X3FlX2ljX3N5c2ZzKTsNCj4gDQoN
Cg0KQmVzdCBSZWdhcmRzDQpaaGFvIFFpYW5nDQo=
^ permalink raw reply
* [PATCH 0/6] dmaengine: remove FSLDMA_EXTERNAL_START
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
FSLDMA_EXTERNAL_START is one of the custom methods in device_control. Since
we are planning to deprecate device_control, we should move this to an API.
This serries adds the fsl_dma_external_start() API for users and also
converts the users.
I would like this to be merged thru dmanegine tree due to new dependency.
Vinod Koul (6):
dmaengine: add dmaengine_prep_dma_sg() helper
dmaengine: freescale: add and export fsl_dma_external_start()
carma-fpga: use dmaengine_xxx() API
carma-fpga: move to fsl_dma_external_start()
dmaengine: freescale: remove FSLDMA_EXTERNAL_START control method
dmaengine: remove FSLDMA_EXTERNAL_START
drivers/dma/fsldma.c | 25 +++++++++++++++----------
drivers/misc/carma/carma-fpga-program.c | 12 ++++++------
include/linux/dmaengine.h | 13 ++++++++++---
include/linux/fsldma.h | 13 +++++++++++++
4 files changed, 44 insertions(+), 19 deletions(-)
create mode 100644 include/linux/fsldma.h
^ permalink raw reply
* [PATCH 1/6] dmaengine: add dmaengine_prep_dma_sg() helper
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
In-Reply-To: <1413042408-28491-1-git-send-email-vinod.koul@intel.com>
This was only prep API which didnt have an helper
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
include/linux/dmaengine.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 3d291f5..ce8a08e 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -757,6 +757,16 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
return chan->device->device_prep_interleaved_dma(chan, xt, flags);
}
+static inline struct dma_async_tx_descriptor *dmaengine_prep_dma_sg(
+ struct dma_chan *chan,
+ struct scatterlist *dst_sg, unsigned int dst_nents,
+ struct scatterlist *src_sg, unsigned int src_nents,
+ unsigned long flags)
+{
+ return chan->device->device_prep_dma_sg(chan, dst_sg, dst_nents,
+ src_sg, src_nents, flags);
+}
+
static inline int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
{
if (!chan || !caps)
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/6] dmaengine: freescale: add and export fsl_dma_external_start()
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
In-Reply-To: <1413042408-28491-1-git-send-email-vinod.koul@intel.com>
The freescale driver uses custom device control FSLDMA_EXTERNAL_START to
put the controller in external start mode.
Since we are planning to deprecate the device control, move this to exported
API. Subsequent patches will remove the FSLDMA_EXTERNAL_START
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/dma/fsldma.c | 16 +++++++++++++++-
include/linux/fsldma.h | 13 +++++++++++++
2 files changed, 28 insertions(+), 1 deletions(-)
create mode 100644 include/linux/fsldma.h
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index d5d6885..0cded86 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -36,7 +36,7 @@
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
-
+#include <linux/fsldma.h>
#include "dmaengine.h"
#include "fsldma.h"
@@ -367,6 +367,20 @@ static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable)
chan->feature &= ~FSL_DMA_CHAN_START_EXT;
}
+int fsl_dma_external_start(struct dma_chan *dchan, int enable)
+{
+ struct fsldma_chan *chan;
+
+ if (!dchan)
+ return -EINVAL;
+
+ chan = to_fsl_chan(dchan);
+
+ fsl_chan_toggle_ext_start(chan, enable);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(fsl_dma_external_start);
+
static void append_ld_queue(struct fsldma_chan *chan, struct fsl_desc_sw *desc)
{
struct fsl_desc_sw *tail = to_fsl_desc(chan->ld_pending.prev);
diff --git a/include/linux/fsldma.h b/include/linux/fsldma.h
new file mode 100644
index 0000000..b213c02
--- /dev/null
+++ b/include/linux/fsldma.h
@@ -0,0 +1,13 @@
+/*
+ * This 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.
+ */
+
+#ifndef FSL_DMA_H
+#define FSL_DMA_H
+/* fsl dma API for enxternal start */
+int fsl_dma_external_start(struct dma_chan *dchan, int enable);
+
+#endif
--
1.7.0.4
^ permalink raw reply related
* [PATCH 3/6] carma-fpga: use dmaengine_xxx() API
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
In-Reply-To: <1413042408-28491-1-git-send-email-vinod.koul@intel.com>
The drivers should use dmaengine_slave_config() and dmaengine_prep_dma_sg()
API instead of accessing the device_control which will be deprecated soon
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/misc/carma/carma-fpga-program.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c
index 7be8983..fd0cb8b 100644
--- a/drivers/misc/carma/carma-fpga-program.c
+++ b/drivers/misc/carma/carma-fpga-program.c
@@ -518,8 +518,7 @@ static noinline int fpga_program_dma(struct fpga_dev *priv)
config.direction = DMA_MEM_TO_DEV;
config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
config.dst_maxburst = fpga_fifo_size(priv->regs) / 2 / 4;
- ret = chan->device->device_control(chan, DMA_SLAVE_CONFIG,
- (unsigned long)&config);
+ ret = dmaengine_slave_config(chan, &config);
if (ret) {
dev_err(priv->dev, "DMA slave configuration failed\n");
goto out_dma_unmap;
@@ -532,9 +531,9 @@ static noinline int fpga_program_dma(struct fpga_dev *priv)
}
/* setup and submit the DMA transaction */
- tx = chan->device->device_prep_dma_sg(chan,
- table.sgl, num_pages,
- vb->sglist, vb->sglen, 0);
+
+ tx = dmaengine_prep_dma_sg(chan, table.sgl, num_pages,
+ vb->sglist, vb->sglen, 0);
if (!tx) {
dev_err(priv->dev, "Unable to prep DMA transaction\n");
ret = -ENOMEM;
--
1.7.0.4
^ permalink raw reply related
* [PATCH 4/6] carma-fpga: move to fsl_dma_external_start()
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
In-Reply-To: <1413042408-28491-1-git-send-email-vinod.koul@intel.com>
carma-fpga driver uses device control with custom FSLDMA_EXTERNAL_START
command. Since we wnat to deprecate the device control, move this driver to
use new fsl_dma_external_start() API
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/misc/carma/carma-fpga-program.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/misc/carma/carma-fpga-program.c b/drivers/misc/carma/carma-fpga-program.c
index fd0cb8b..298f912 100644
--- a/drivers/misc/carma/carma-fpga-program.c
+++ b/drivers/misc/carma/carma-fpga-program.c
@@ -16,6 +16,7 @@
#include <linux/completion.h>
#include <linux/miscdevice.h>
#include <linux/dmaengine.h>
+#include <linux/fsldma.h>
#include <linux/interrupt.h>
#include <linux/highmem.h>
#include <linux/kernel.h>
@@ -524,7 +525,7 @@ static noinline int fpga_program_dma(struct fpga_dev *priv)
goto out_dma_unmap;
}
- ret = chan->device->device_control(chan, FSLDMA_EXTERNAL_START, 1);
+ ret = fsl_dma_external_start(chan, 1)
if (ret) {
dev_err(priv->dev, "DMA external control setup failed\n");
goto out_dma_unmap;
--
1.7.0.4
^ permalink raw reply related
* [PATCH 5/6] dmaengine: freescale: remove FSLDMA_EXTERNAL_START control method
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
In-Reply-To: <1413042408-28491-1-git-send-email-vinod.koul@intel.com>
since users have been move to fsl_dma_external_start() API, so remove this
now
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/dma/fsldma.c | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 0cded86..994bcb2 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1012,15 +1012,6 @@ static int fsl_dma_device_control(struct dma_chan *dchan,
chan->set_request_count(chan, size);
return 0;
- case FSLDMA_EXTERNAL_START:
-
- /* make sure the channel supports external start */
- if (!chan->toggle_ext_start)
- return -ENXIO;
-
- chan->toggle_ext_start(chan, arg);
- return 0;
-
default:
return -ENXIO;
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH 6/6] dmaengine: remove FSLDMA_EXTERNAL_START
From: Vinod Koul @ 2014-10-11 15:46 UTC (permalink / raw)
To: dmaengine; +Cc: Vinod Koul, Zhang Wei, linuxppc-dev, linux-kernel
In-Reply-To: <1413042408-28491-1-git-send-email-vinod.koul@intel.com>
as users have been converted, so no need of this custom method
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
include/linux/dmaengine.h | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index ce8a08e..3254a03 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -199,15 +199,12 @@ enum dma_ctrl_flags {
* configuration data in statically from the platform). An additional
* argument of struct dma_slave_config must be passed in with this
* command.
- * @FSLDMA_EXTERNAL_START: this command will put the Freescale DMA controller
- * into external start mode.
*/
enum dma_ctrl_cmd {
DMA_TERMINATE_ALL,
DMA_PAUSE,
DMA_RESUME,
DMA_SLAVE_CONFIG,
- FSLDMA_EXTERNAL_START,
};
/**
--
1.7.0.4
^ permalink raw reply related
* Re: powerpc32: add support for csum_add()
From: Jochen Rollwagen @ 2014-10-12 16:22 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
This patch
https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-September/121144.html
only compiles after putting an #ifndef ARCH_HAS_CSUM_ADD around the
definition in include/net/checksum.h
This is missing from the patch
[-- Attachment #2: Type: text/html, Size: 681 bytes --]
^ permalink raw reply
* Re: [PATCH 1/4] powerpc: Dynamic DMA zone limits
From: Anton Blanchard @ 2014-10-13 7:14 UTC (permalink / raw)
To: Scott Wood, Benjamin Herrenschmidt, Shaohui Xie, Michael Ellerman
Cc: linuxppc-dev
In-Reply-To: <1407541245-27617-1-git-send-email-scottwood@freescale.com>
Hi Scott,
> Platform code can call limit_zone_pfn() to set appropriate limits
> for ZONE_DMA and ZONE_DMA32, and dma_direct_alloc_coherent() will
> select a suitable zone based on a device's mask and the pfn limits
> that platform code has configured.
This patch breaks my POWER8 box:
ipr 0001:08:00.0: Using 64-bit DMA iommu bypass
ipr 0001:08:00.0: dma_direct_alloc_coherent: No suitable zone for pfn 0x10000
ipr 0001:08:00.0: Couldn't allocate enough memory for device driver!
ipr: probe of 0001:08:00.0 failed with error -12
ipr isn't setting a coherent mask, but we shouldn't care on these boxes.
Could we ignore the coherent mask or copy the dma mask to it?
Anton
--
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> arch/powerpc/Kconfig | 4 +++
> arch/powerpc/include/asm/pgtable.h | 3 ++
> arch/powerpc/kernel/dma.c | 20 +++++++++++++
> arch/powerpc/mm/mem.c | 61
> ++++++++++++++++++++++++++++++++++---- 4 files changed, 83
> insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 80b94b0..56dc47a 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -286,6 +286,10 @@ config PPC_EMULATE_SSTEP
> bool
> default y if KPROBES || UPROBES || XMON || HAVE_HW_BREAKPOINT
>
> +config ZONE_DMA32
> + bool
> + default y if PPC64
> +
> source "init/Kconfig"
>
> source "kernel/Kconfig.freezer"
> diff --git a/arch/powerpc/include/asm/pgtable.h
> b/arch/powerpc/include/asm/pgtable.h index d98c1ec..6d74167 100644
> --- a/arch/powerpc/include/asm/pgtable.h
> +++ b/arch/powerpc/include/asm/pgtable.h
> @@ -4,6 +4,7 @@
>
> #ifndef __ASSEMBLY__
> #include <linux/mmdebug.h>
> +#include <linux/mmzone.h>
> #include <asm/processor.h> /* For TASK_SIZE */
> #include <asm/mmu.h>
> #include <asm/page.h>
> @@ -281,6 +282,8 @@ extern unsigned long empty_zero_page[];
>
> extern pgd_t swapper_pg_dir[];
>
> +void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn);
> +int dma_pfn_limit_to_zone(u64 pfn_limit);
> extern void paging_init(void);
>
> /*
> diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
> index ee78f6e..dfd99ef 100644
> --- a/arch/powerpc/kernel/dma.c
> +++ b/arch/powerpc/kernel/dma.c
> @@ -40,6 +40,26 @@ void *dma_direct_alloc_coherent(struct device
> *dev, size_t size, #else
> struct page *page;
> int node = dev_to_node(dev);
> + u64 pfn = (dev->coherent_dma_mask >> PAGE_SHIFT) + 1;
> + int zone;
> +
> + zone = dma_pfn_limit_to_zone(pfn);
> + if (zone < 0) {
> + dev_err(dev, "%s: No suitable zone for pfn %#llx\n",
> + __func__, pfn);
> + return NULL;
> + }
> +
> + switch (zone) {
> + case ZONE_DMA:
> + flag |= GFP_DMA;
> + break;
> +#ifdef CONFIG_ZONE_DMA32
> + case ZONE_DMA32:
> + flag |= GFP_DMA32;
> + break;
> +#endif
> + };
>
> /* ignore region specifiers */
> flag &= ~(__GFP_HIGHMEM);
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index e0f7a18..3b23e17 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -261,6 +261,54 @@ static int __init mark_nonram_nosave(void)
> return 0;
> }
>
> +static bool zone_limits_final;
> +
> +static unsigned long max_zone_pfns[MAX_NR_ZONES] = {
> + [0 ... MAX_NR_ZONES - 1] = ~0UL
> +};
> +
> +/*
> + * Restrict the specified zone and all more restrictive zones
> + * to be below the specified pfn. May not be called after
> + * paging_init().
> + */
> +void __init limit_zone_pfn(enum zone_type zone, unsigned long
> pfn_limit) +{
> + int i;
> +
> + if (WARN_ON(zone_limits_final))
> + return;
> +
> + for (i = zone; i >= 0; i--) {
> + if (max_zone_pfns[i] > pfn_limit)
> + max_zone_pfns[i] = pfn_limit;
> + }
> +}
> +
> +/*
> + * Find the least restrictive zone that is entirely below the
> + * specified pfn limit. Returns < 0 if no suitable zone is found.
> + *
> + * pfn_limit must be u64 because it can exceed 32 bits even on 32-bit
> + * systems -- the DMA limit can be higher than any possible real pfn.
> + */
> +int dma_pfn_limit_to_zone(u64 pfn_limit)
> +{
> + enum zone_type top_zone = ZONE_NORMAL;
> + int i;
> +
> +#ifdef CONFIG_HIGHMEM
> + top_zone = ZONE_HIGHMEM;
> +#endif
> +
> + for (i = top_zone; i >= 0; i--) {
> + if (max_zone_pfns[i] <= pfn_limit)
> + return i;
> + }
> +
> + return -EPERM;
> +}
> +
> /*
> * paging_init() sets up the page tables - in fact we've already
> done this. */
> @@ -268,7 +316,7 @@ void __init paging_init(void)
> {
> unsigned long long total_ram = memblock_phys_mem_size();
> phys_addr_t top_of_ram = memblock_end_of_DRAM();
> - unsigned long max_zone_pfns[MAX_NR_ZONES];
> + enum zone_type top_zone;
>
> #ifdef CONFIG_PPC32
> unsigned long v = __fix_to_virt(__end_of_fixed_addresses -
> 1); @@ -290,13 +338,16 @@ void __init paging_init(void)
> (unsigned long long)top_of_ram, total_ram);
> printk(KERN_DEBUG "Memory hole size: %ldMB\n",
> (long int)((top_of_ram - total_ram) >> 20));
> - memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
> +
> #ifdef CONFIG_HIGHMEM
> - max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
> - max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT;
> + top_zone = ZONE_HIGHMEM;
> + limit_zone_pfn(ZONE_NORMAL, lowmem_end_addr >> PAGE_SHIFT);
> #else
> - max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
> + top_zone = ZONE_NORMAL;
> #endif
> +
> + limit_zone_pfn(top_zone, top_of_ram >> PAGE_SHIFT);
> + zone_limits_final = true;
> free_area_init_nodes(max_zone_pfns);
>
> mark_nonram_nosave();
^ permalink raw reply
* Re: [PATCH 1/4] powerpc: Dynamic DMA zone limits
From: Benjamin Herrenschmidt @ 2014-10-13 7:30 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Scott Wood, linuxppc-dev, Shaohui Xie
In-Reply-To: <20141013181436.300988c8@kryten>
On Mon, 2014-10-13 at 18:14 +1100, Anton Blanchard wrote:
> Hi Scott,
>
> > Platform code can call limit_zone_pfn() to set appropriate limits
> > for ZONE_DMA and ZONE_DMA32, and dma_direct_alloc_coherent() will
> > select a suitable zone based on a device's mask and the pfn limits
> > that platform code has configured.
>
> This patch breaks my POWER8 box:
>
> ipr 0001:08:00.0: Using 64-bit DMA iommu bypass
> ipr 0001:08:00.0: dma_direct_alloc_coherent: No suitable zone for pfn 0x10000
> ipr 0001:08:00.0: Couldn't allocate enough memory for device driver!
> ipr: probe of 0001:08:00.0 failed with error -12
>
> ipr isn't setting a coherent mask, but we shouldn't care on these boxes.
> Could we ignore the coherent mask or copy the dma mask to it?
So this depends what the coherent_mask actually means vs. the dma_mask.
I've always been extremely confused by the distinction. Since the
coherent_mask is set by the driver, I assume it represents a driver
limitation on coherent memory which might be *different* from the
restriction on streaming mappings, in which case we might have to honor
it...
The problem is that our whole mechanism for switching dma_ops is based
on having one mask.
So even if we somewhat "fix" IPR, we still have an issue in that we
don't honor the coherent mask properly in case a driver really wants a
different mask.
If we new have two, I think we need to (in the long run that is, for
3.18 we can probably find an ifdef based band-aid):
- Either have a ppc_md hook for set_coherent_mask along with
dma_set_mask and make the decision to flip based on the AND of both
masks (gross)
- Or, since that's basically what some of our HW can do, basically make
the decision on a per-hook basis. That is, something like powernv would
no longer need to hook dma_set_mask to switch the ops. Instead, it could
permanently set a set of pnv_dma_ops that for each hook chose the
"right" mask and route the mapping toward either the iommu or the bypass
accordingly.
Both seem like quite a bit of refactoring and the latter would be tricky
for some pseries cases where we actually *remove* the 32-bit window to
establish the 64-bit one (DDW cases).
Any better idea ? Are there any drivers that don't actually have the
same mask for both that we care about ?
Ben.
> Anton
> --
>
> > Signed-off-by: Scott Wood <scottwood@freescale.com>
> > Cc: Shaohui Xie <Shaohui.Xie@freescale.com>
> > ---
> > arch/powerpc/Kconfig | 4 +++
> > arch/powerpc/include/asm/pgtable.h | 3 ++
> > arch/powerpc/kernel/dma.c | 20 +++++++++++++
> > arch/powerpc/mm/mem.c | 61
> > ++++++++++++++++++++++++++++++++++---- 4 files changed, 83
> > insertions(+), 5 deletions(-)
> >
> > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> > index 80b94b0..56dc47a 100644
> > --- a/arch/powerpc/Kconfig
> > +++ b/arch/powerpc/Kconfig
> > @@ -286,6 +286,10 @@ config PPC_EMULATE_SSTEP
> > bool
> > default y if KPROBES || UPROBES || XMON || HAVE_HW_BREAKPOINT
> >
> > +config ZONE_DMA32
> > + bool
> > + default y if PPC64
> > +
> > source "init/Kconfig"
> >
> > source "kernel/Kconfig.freezer"
> > diff --git a/arch/powerpc/include/asm/pgtable.h
> > b/arch/powerpc/include/asm/pgtable.h index d98c1ec..6d74167 100644
> > --- a/arch/powerpc/include/asm/pgtable.h
> > +++ b/arch/powerpc/include/asm/pgtable.h
> > @@ -4,6 +4,7 @@
> >
> > #ifndef __ASSEMBLY__
> > #include <linux/mmdebug.h>
> > +#include <linux/mmzone.h>
> > #include <asm/processor.h> /* For TASK_SIZE */
> > #include <asm/mmu.h>
> > #include <asm/page.h>
> > @@ -281,6 +282,8 @@ extern unsigned long empty_zero_page[];
> >
> > extern pgd_t swapper_pg_dir[];
> >
> > +void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn);
> > +int dma_pfn_limit_to_zone(u64 pfn_limit);
> > extern void paging_init(void);
> >
> > /*
> > diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
> > index ee78f6e..dfd99ef 100644
> > --- a/arch/powerpc/kernel/dma.c
> > +++ b/arch/powerpc/kernel/dma.c
> > @@ -40,6 +40,26 @@ void *dma_direct_alloc_coherent(struct device
> > *dev, size_t size, #else
> > struct page *page;
> > int node = dev_to_node(dev);
> > + u64 pfn = (dev->coherent_dma_mask >> PAGE_SHIFT) + 1;
> > + int zone;
> > +
> > + zone = dma_pfn_limit_to_zone(pfn);
> > + if (zone < 0) {
> > + dev_err(dev, "%s: No suitable zone for pfn %#llx\n",
> > + __func__, pfn);
> > + return NULL;
> > + }
> > +
> > + switch (zone) {
> > + case ZONE_DMA:
> > + flag |= GFP_DMA;
> > + break;
> > +#ifdef CONFIG_ZONE_DMA32
> > + case ZONE_DMA32:
> > + flag |= GFP_DMA32;
> > + break;
> > +#endif
> > + };
> >
> > /* ignore region specifiers */
> > flag &= ~(__GFP_HIGHMEM);
> > diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> > index e0f7a18..3b23e17 100644
> > --- a/arch/powerpc/mm/mem.c
> > +++ b/arch/powerpc/mm/mem.c
> > @@ -261,6 +261,54 @@ static int __init mark_nonram_nosave(void)
> > return 0;
> > }
> >
> > +static bool zone_limits_final;
> > +
> > +static unsigned long max_zone_pfns[MAX_NR_ZONES] = {
> > + [0 ... MAX_NR_ZONES - 1] = ~0UL
> > +};
> > +
> > +/*
> > + * Restrict the specified zone and all more restrictive zones
> > + * to be below the specified pfn. May not be called after
> > + * paging_init().
> > + */
> > +void __init limit_zone_pfn(enum zone_type zone, unsigned long
> > pfn_limit) +{
> > + int i;
> > +
> > + if (WARN_ON(zone_limits_final))
> > + return;
> > +
> > + for (i = zone; i >= 0; i--) {
> > + if (max_zone_pfns[i] > pfn_limit)
> > + max_zone_pfns[i] = pfn_limit;
> > + }
> > +}
> > +
> > +/*
> > + * Find the least restrictive zone that is entirely below the
> > + * specified pfn limit. Returns < 0 if no suitable zone is found.
> > + *
> > + * pfn_limit must be u64 because it can exceed 32 bits even on 32-bit
> > + * systems -- the DMA limit can be higher than any possible real pfn.
> > + */
> > +int dma_pfn_limit_to_zone(u64 pfn_limit)
> > +{
> > + enum zone_type top_zone = ZONE_NORMAL;
> > + int i;
> > +
> > +#ifdef CONFIG_HIGHMEM
> > + top_zone = ZONE_HIGHMEM;
> > +#endif
> > +
> > + for (i = top_zone; i >= 0; i--) {
> > + if (max_zone_pfns[i] <= pfn_limit)
> > + return i;
> > + }
> > +
> > + return -EPERM;
> > +}
> > +
> > /*
> > * paging_init() sets up the page tables - in fact we've already
> > done this. */
> > @@ -268,7 +316,7 @@ void __init paging_init(void)
> > {
> > unsigned long long total_ram = memblock_phys_mem_size();
> > phys_addr_t top_of_ram = memblock_end_of_DRAM();
> > - unsigned long max_zone_pfns[MAX_NR_ZONES];
> > + enum zone_type top_zone;
> >
> > #ifdef CONFIG_PPC32
> > unsigned long v = __fix_to_virt(__end_of_fixed_addresses -
> > 1); @@ -290,13 +338,16 @@ void __init paging_init(void)
> > (unsigned long long)top_of_ram, total_ram);
> > printk(KERN_DEBUG "Memory hole size: %ldMB\n",
> > (long int)((top_of_ram - total_ram) >> 20));
> > - memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
> > +
> > #ifdef CONFIG_HIGHMEM
> > - max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
> > - max_zone_pfns[ZONE_HIGHMEM] = top_of_ram >> PAGE_SHIFT;
> > + top_zone = ZONE_HIGHMEM;
> > + limit_zone_pfn(ZONE_NORMAL, lowmem_end_addr >> PAGE_SHIFT);
> > #else
> > - max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
> > + top_zone = ZONE_NORMAL;
> > #endif
> > +
> > + limit_zone_pfn(top_zone, top_of_ram >> PAGE_SHIFT);
> > + zone_limits_final = true;
> > free_area_init_nodes(max_zone_pfns);
> >
> > mark_nonram_nosave();
^ permalink raw reply
* [PATCH 1/3] powerpc: Reimplement __get_SP() as a function not a define
From: Anton Blanchard @ 2014-10-13 8:41 UTC (permalink / raw)
To: benh, paulus, mpe, zhong; +Cc: linuxppc-dev
Li Zhong points out an issue with our current __get_SP()
implementation. If ftrace function tracing is enabled (ie -pg
profiling using _mcount) we spill a stack frame on 64bit all the
time.
If a function calls __get_SP() and later calls a function that is
tail call optimised, we will pop the stack frame and the value
returned by __get_SP() is no longer valid. An example from Li can
be found in save_stack_trace -> save_context_stack:
c0000000000432c0 <.save_stack_trace>:
c0000000000432c0: mflr r0
c0000000000432c4: std r0,16(r1)
c0000000000432c8: stdu r1,-128(r1) <-- stack frame for _mcount
c0000000000432cc: std r3,112(r1)
c0000000000432d0: bl <._mcount>
c0000000000432d4: nop
c0000000000432d8: mr r4,r1 <-- __get_SP()
c0000000000432dc: ld r5,632(r13)
c0000000000432e0: ld r3,112(r1)
c0000000000432e4: li r6,1
c0000000000432e8: addi r1,r1,128 <-- pop stack frame
c0000000000432ec: ld r0,16(r1)
c0000000000432f0: mtlr r0
c0000000000432f4: b <.save_context_stack> <-- tail call optimized
save_context_stack ends up with a stack pointer below the current
one, and it is likely to be scribbled over.
Fix this by making __get_SP() a function which returns the
callers stack frame. Also replace inline assembly which grabs
the stack pointer in save_stack_trace and show_stack with
__get_SP().
This also fixes an issue with perf_arch_fetch_caller_regs().
It currently unwinds the stack once, which will skip a
valid stack frame on a leaf function. With the __get_SP() fixes
in this patch, we never need to unwind the stack frame to get
to the first interesting frame.
We have to export __get_SP() because perf_arch_fetch_caller_regs()
(which is used in modules) calls it from a header file.
Reported-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/perf_event.h | 2 +-
arch/powerpc/include/asm/reg.h | 3 +--
arch/powerpc/kernel/misc.S | 4 ++++
arch/powerpc/kernel/ppc_ksyms.c | 2 ++
arch/powerpc/kernel/process.c | 2 +-
arch/powerpc/kernel/stacktrace.c | 2 +-
6 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h
index 0bb2372..b058568 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -34,7 +34,7 @@
do { \
(regs)->result = 0; \
(regs)->nip = __ip; \
- (regs)->gpr[1] = *(unsigned long *)__get_SP(); \
+ (regs)->gpr[1] = __get_SP(); \
asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
} while (0)
#endif
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index fe3f948..e539d7e 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1265,8 +1265,7 @@ static inline unsigned long mfvtb (void)
#define proc_trap() asm volatile("trap")
-#define __get_SP() ({unsigned long sp; \
- asm volatile("mr %0,1": "=r" (sp)); sp;})
+extern unsigned long __get_SP(void);
extern unsigned long scom970_read(unsigned int address);
extern void scom970_write(unsigned int address, unsigned long value);
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 7ce26d4..120deb7 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -114,3 +114,7 @@ _GLOBAL(longjmp)
mtlr r0
mr r3,r4
blr
+
+_GLOBAL(__get_SP)
+ PPC_LL r3,0(r1)
+ blr
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index c4dfff6..9d84efb 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -41,3 +41,5 @@ EXPORT_SYMBOL(giveup_spe);
#ifdef CONFIG_EPAPR_PARAVIRT
EXPORT_SYMBOL(epapr_hypercall_start);
#endif
+
+EXPORT_SYMBOL(__get_SP);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index aa1df89..3cc6439 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1545,7 +1545,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
tsk = current;
if (sp == 0) {
if (tsk == current)
- asm("mr %0,1" : "=r" (sp));
+ sp = __get_SP();
else
sp = tsk->thread.ksp;
}
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
index 3d30ef1..7f65bae 100644
--- a/arch/powerpc/kernel/stacktrace.c
+++ b/arch/powerpc/kernel/stacktrace.c
@@ -50,7 +50,7 @@ void save_stack_trace(struct stack_trace *trace)
{
unsigned long sp;
- asm("mr %0,1" : "=r" (sp));
+ sp = __get_SP();
save_context_stack(trace, sp, current, 1);
}
--
1.9.1
^ permalink raw reply related
* [PATCH 2/3] powerpc: Rename __get_SP() to current_stack_pointer()
From: Anton Blanchard @ 2014-10-13 8:41 UTC (permalink / raw)
To: benh, paulus, mpe, zhong; +Cc: linuxppc-dev
In-Reply-To: <1413189700-30322-1-git-send-email-anton@samba.org>
Michael points out that __get_SP() is a pretty horrible
function name. Let's give it a better name.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/perf_event.h | 2 +-
arch/powerpc/include/asm/reg.h | 2 +-
arch/powerpc/kernel/irq.c | 2 +-
arch/powerpc/kernel/misc.S | 2 +-
arch/powerpc/kernel/ppc_ksyms.c | 2 +-
arch/powerpc/kernel/process.c | 2 +-
arch/powerpc/kernel/stacktrace.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h
index b058568..8bf1b63 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -34,7 +34,7 @@
do { \
(regs)->result = 0; \
(regs)->nip = __ip; \
- (regs)->gpr[1] = __get_SP(); \
+ (regs)->gpr[1] = current_stack_pointer(); \
asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
} while (0)
#endif
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index e539d7e..c998279 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1265,7 +1265,7 @@ static inline unsigned long mfvtb (void)
#define proc_trap() asm volatile("trap")
-extern unsigned long __get_SP(void);
+extern unsigned long current_stack_pointer(void);
extern unsigned long scom970_read(unsigned int address);
extern void scom970_write(unsigned int address, unsigned long value);
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 8eb857f..c143835 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -466,7 +466,7 @@ static inline void check_stack_overflow(void)
#ifdef CONFIG_DEBUG_STACKOVERFLOW
long sp;
- sp = __get_SP() & (THREAD_SIZE-1);
+ sp = current_stack_pointer() & (THREAD_SIZE-1);
/* check for stack overflow: is there less than 2KB free? */
if (unlikely(sp < (sizeof(struct thread_info) + 2048))) {
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 120deb7..0d43219 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -115,6 +115,6 @@ _GLOBAL(longjmp)
mr r3,r4
blr
-_GLOBAL(__get_SP)
+_GLOBAL(current_stack_pointer)
PPC_LL r3,0(r1)
blr
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 9d84efb..202963e 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -42,4 +42,4 @@ EXPORT_SYMBOL(giveup_spe);
EXPORT_SYMBOL(epapr_hypercall_start);
#endif
-EXPORT_SYMBOL(__get_SP);
+EXPORT_SYMBOL(current_stack_pointer);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 3cc6439..923cd2d 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1545,7 +1545,7 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
tsk = current;
if (sp == 0) {
if (tsk == current)
- sp = __get_SP();
+ sp = current_stack_pointer();
else
sp = tsk->thread.ksp;
}
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
index 7f65bae..ea43a34 100644
--- a/arch/powerpc/kernel/stacktrace.c
+++ b/arch/powerpc/kernel/stacktrace.c
@@ -50,7 +50,7 @@ void save_stack_trace(struct stack_trace *trace)
{
unsigned long sp;
- sp = __get_SP();
+ sp = current_stack_pointer();
save_context_stack(trace, sp, current, 1);
}
--
1.9.1
^ permalink raw reply related
* [PATCH 3/3] powerpc/pseries: Use dump_stack instead of show_stack
From: Anton Blanchard @ 2014-10-13 8:41 UTC (permalink / raw)
To: benh, paulus, mpe, zhong; +Cc: linuxppc-dev
In-Reply-To: <1413189700-30322-1-git-send-email-anton@samba.org>
We can use the simpler dump_stack() instead of
show_stack(current, __get_SP())
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/platforms/pseries/iommu.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index de1ec54..e32e009 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -30,7 +30,6 @@
#include <linux/mm.h>
#include <linux/memblock.h>
#include <linux/spinlock.h>
-#include <linux/sched.h> /* for show_stack */
#include <linux/string.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
@@ -168,7 +167,7 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
printk("\ttcenum = 0x%llx\n", (u64)tcenum);
printk("\ttce val = 0x%llx\n", tce );
- show_stack(current, (unsigned long *)__get_SP());
+ dump_stack();
}
tcenum++;
@@ -257,7 +256,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
printk("\tnpages = 0x%llx\n", (u64)npages);
printk("\ttce[0] val = 0x%llx\n", tcep[0]);
- show_stack(current, (unsigned long *)__get_SP());
+ dump_stack();
}
return ret;
}
@@ -273,7 +272,7 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages
printk("tce_free_pSeriesLP: plpar_tce_put failed. rc=%lld\n", rc);
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
printk("\ttcenum = 0x%llx\n", (u64)tcenum);
- show_stack(current, (unsigned long *)__get_SP());
+ dump_stack();
}
tcenum++;
@@ -292,7 +291,7 @@ static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long n
printk("\trc = %lld\n", rc);
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
printk("\tnpages = 0x%llx\n", (u64)npages);
- show_stack(current, (unsigned long *)__get_SP());
+ dump_stack();
}
}
@@ -307,7 +306,7 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table *tbl, long tcenum)
printk("tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n", rc);
printk("\tindex = 0x%llx\n", (u64)tbl->it_index);
printk("\ttcenum = 0x%llx\n", (u64)tcenum);
- show_stack(current, (unsigned long *)__get_SP());
+ dump_stack();
}
return tce_ret;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/4] powerpc: Dynamic DMA zone limits
From: Michael Ellerman @ 2014-10-13 9:00 UTC (permalink / raw)
To: Anton Blanchard; +Cc: Scott Wood, linuxppc-dev, Shaohui Xie
In-Reply-To: <20141013181436.300988c8@kryten>
On Mon, 2014-10-13 at 18:14 +1100, Anton Blanchard wrote:
> Hi Scott,
>
> > Platform code can call limit_zone_pfn() to set appropriate limits
> > for ZONE_DMA and ZONE_DMA32, and dma_direct_alloc_coherent() will
> > select a suitable zone based on a device's mask and the pfn limits
> > that platform code has configured.
>
> This patch breaks my POWER8 box:
>
> ipr 0001:08:00.0: Using 64-bit DMA iommu bypass
> ipr 0001:08:00.0: dma_direct_alloc_coherent: No suitable zone for pfn 0x10000
> ipr 0001:08:00.0: Couldn't allocate enough memory for device driver!
> ipr: probe of 0001:08:00.0 failed with error -12
>
> ipr isn't setting a coherent mask, but we shouldn't care on these boxes.
> Could we ignore the coherent mask or copy the dma mask to it?
Talking to Ben the answer seems to be "it's complicated".
We shouldn't be ignoring the coherent mask, but we have been, and have been
getting away with it.
The PCI code sets a default 32-bit mask, so we can't even detect when a device
hasn't set it. Though maybe the powernv PCI code could be initialising it to
64-bit ?
For this cycle I'm thinking of the below patch.
Scott & Anton can you test please?
Also the depends on FSL_PCI was totally a guess, so please correct that if it's
wrong Scott.
cheers
[PATCH] powerpc: Only do dynamic DMA zone limits on platforms that need it
Scott's patch 1c98025c6c95 "Dynamic DMA zone limits" changed
dma_direct_alloc_coherent() to start using dev->coherent_dma_mask.
That seems fair enough, but it exposes the fact that some of the drivers
we care about on IBM platforms aren't setting the coherent mask.
The proper fix is to have drivers set the coherent mask and also have
the platform code honor it.
For now, just restrict the dynamic DMA zone limits to the platforms that
need it, which is those using FSL_PCI.
Fixes: 1c98025c6c95 ("powerpc: Dynamic DMA zone limits")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/Kconfig | 2 +-
arch/powerpc/kernel/dma.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 88eace4e28c3..9b9044aec217 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -290,7 +290,7 @@ config PPC_EMULATE_SSTEP
config ZONE_DMA32
bool
- default y if PPC64
+ default y if PPC64 && FSL_PCI
source "init/Kconfig"
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index adac9dc54aee..bd443a2e4426 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -53,6 +53,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
#else
struct page *page;
int node = dev_to_node(dev);
+#ifdef CONFIG_ZONE_DMA32
u64 pfn = get_pfn_limit(dev);
int zone;
@@ -67,12 +68,11 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size,
case ZONE_DMA:
flag |= GFP_DMA;
break;
-#ifdef CONFIG_ZONE_DMA32
case ZONE_DMA32:
flag |= GFP_DMA32;
break;
-#endif
};
+#endif /* CONFIG_ZONE_DMA32 */
/* ignore region specifiers */
flag &= ~(__GFP_HIGHMEM);
--
1.9.1
^ permalink raw reply related
* [PATCH 1/2] ipr: Convert to generic DMA API
From: Anton Blanchard @ 2014-10-13 9:14 UTC (permalink / raw)
To: benh, paulus, mpe, wenxiong, brking, scottwood; +Cc: linuxppc-dev, linux-scsi
Even though the ipr driver is only used on PCI, convert it
to use the generic DMA API.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
drivers/scsi/ipr.c | 101 +++++++++++++++++++++++++++--------------------------
drivers/scsi/ipr.h | 2 +-
2 files changed, 53 insertions(+), 50 deletions(-)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 924b0ba..3aa28bd 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3932,8 +3932,9 @@ static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg,
return -EIO;
}
- sglist->num_dma_sg = pci_map_sg(ioa_cfg->pdev, sglist->scatterlist,
- sglist->num_sg, DMA_TO_DEVICE);
+ sglist->num_dma_sg = dma_map_sg(&ioa_cfg->pdev->dev,
+ sglist->scatterlist, sglist->num_sg,
+ DMA_TO_DEVICE);
if (!sglist->num_dma_sg) {
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
@@ -5575,7 +5576,7 @@ static int ipr_build_ioadl64(struct ipr_ioa_cfg *ioa_cfg,
nseg = scsi_dma_map(scsi_cmd);
if (nseg < 0) {
if (printk_ratelimit())
- dev_err(&ioa_cfg->pdev->dev, "pci_map_sg failed!\n");
+ dev_err(&ioa_cfg->pdev->dev, "scsi_dma_map failed!\n");
return -1;
}
@@ -5626,7 +5627,7 @@ static int ipr_build_ioadl(struct ipr_ioa_cfg *ioa_cfg,
nseg = scsi_dma_map(scsi_cmd);
if (nseg < 0) {
- dev_err(&ioa_cfg->pdev->dev, "pci_map_sg failed!\n");
+ dev_err(&ioa_cfg->pdev->dev, "scsi_dma_map failed!\n");
return -1;
}
@@ -8421,7 +8422,7 @@ static int ipr_reset_ucode_download_done(struct ipr_cmnd *ipr_cmd)
struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
struct ipr_sglist *sglist = ioa_cfg->ucode_sglist;
- pci_unmap_sg(ioa_cfg->pdev, sglist->scatterlist,
+ dma_unmap_sg(&ioa_cfg->pdev->dev, sglist->scatterlist,
sglist->num_sg, DMA_TO_DEVICE);
ipr_cmd->job_step = ipr_reset_alert;
@@ -8861,7 +8862,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
if (ioa_cfg->ipr_cmnd_list[i])
- pci_pool_free(ioa_cfg->ipr_cmd_pool,
+ dma_pool_free(ioa_cfg->ipr_cmd_pool,
ioa_cfg->ipr_cmnd_list[i],
ioa_cfg->ipr_cmnd_list_dma[i]);
@@ -8869,7 +8870,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
}
if (ioa_cfg->ipr_cmd_pool)
- pci_pool_destroy(ioa_cfg->ipr_cmd_pool);
+ dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
kfree(ioa_cfg->ipr_cmnd_list);
kfree(ioa_cfg->ipr_cmnd_list_dma);
@@ -8890,25 +8891,24 @@ static void ipr_free_mem(struct ipr_ioa_cfg *ioa_cfg)
int i;
kfree(ioa_cfg->res_entries);
- pci_free_consistent(ioa_cfg->pdev, sizeof(struct ipr_misc_cbs),
- ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
+ dma_free_coherent(&ioa_cfg->pdev->dev, sizeof(struct ipr_misc_cbs),
+ ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
ipr_free_cmd_blks(ioa_cfg);
for (i = 0; i < ioa_cfg->hrrq_num; i++)
- pci_free_consistent(ioa_cfg->pdev,
- sizeof(u32) * ioa_cfg->hrrq[i].size,
- ioa_cfg->hrrq[i].host_rrq,
- ioa_cfg->hrrq[i].host_rrq_dma);
+ dma_free_coherent(&ioa_cfg->pdev->dev,
+ sizeof(u32) * ioa_cfg->hrrq[i].size,
+ ioa_cfg->hrrq[i].host_rrq,
+ ioa_cfg->hrrq[i].host_rrq_dma);
- pci_free_consistent(ioa_cfg->pdev, ioa_cfg->cfg_table_size,
- ioa_cfg->u.cfg_table,
- ioa_cfg->cfg_table_dma);
+ dma_free_coherent(&ioa_cfg->pdev->dev, ioa_cfg->cfg_table_size,
+ ioa_cfg->u.cfg_table, ioa_cfg->cfg_table_dma);
for (i = 0; i < IPR_NUM_HCAMS; i++) {
- pci_free_consistent(ioa_cfg->pdev,
- sizeof(struct ipr_hostrcb),
- ioa_cfg->hostrcb[i],
- ioa_cfg->hostrcb_dma[i]);
+ dma_free_coherent(&ioa_cfg->pdev->dev,
+ sizeof(struct ipr_hostrcb),
+ ioa_cfg->hostrcb[i],
+ ioa_cfg->hostrcb_dma[i]);
}
ipr_free_dump(ioa_cfg);
@@ -8969,7 +8969,7 @@ static int ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
dma_addr_t dma_addr;
int i, entries_each_hrrq, hrrq_id = 0;
- ioa_cfg->ipr_cmd_pool = pci_pool_create(IPR_NAME, ioa_cfg->pdev,
+ ioa_cfg->ipr_cmd_pool = dma_pool_create(IPR_NAME, &ioa_cfg->pdev->dev,
sizeof(struct ipr_cmnd), 512, 0);
if (!ioa_cfg->ipr_cmd_pool)
@@ -9019,7 +9019,7 @@ static int ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
}
for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
- ipr_cmd = pci_pool_alloc(ioa_cfg->ipr_cmd_pool, GFP_KERNEL, &dma_addr);
+ ipr_cmd = dma_pool_alloc(ioa_cfg->ipr_cmd_pool, GFP_KERNEL, &dma_addr);
if (!ipr_cmd) {
ipr_free_cmd_blks(ioa_cfg);
@@ -9090,9 +9090,10 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
ioa_cfg->res_entries[i].ioa_cfg = ioa_cfg;
}
- ioa_cfg->vpd_cbs = pci_alloc_consistent(ioa_cfg->pdev,
- sizeof(struct ipr_misc_cbs),
- &ioa_cfg->vpd_cbs_dma);
+ ioa_cfg->vpd_cbs = dma_alloc_coherent(&pdev->dev,
+ sizeof(struct ipr_misc_cbs),
+ &ioa_cfg->vpd_cbs_dma,
+ GFP_KERNEL);
if (!ioa_cfg->vpd_cbs)
goto out_free_res_entries;
@@ -9101,13 +9102,14 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
goto out_free_vpd_cbs;
for (i = 0; i < ioa_cfg->hrrq_num; i++) {
- ioa_cfg->hrrq[i].host_rrq = pci_alloc_consistent(ioa_cfg->pdev,
+ ioa_cfg->hrrq[i].host_rrq = dma_alloc_coherent(&pdev->dev,
sizeof(u32) * ioa_cfg->hrrq[i].size,
- &ioa_cfg->hrrq[i].host_rrq_dma);
+ &ioa_cfg->hrrq[i].host_rrq_dma,
+ GFP_KERNEL);
if (!ioa_cfg->hrrq[i].host_rrq) {
while (--i > 0)
- pci_free_consistent(pdev,
+ dma_free_coherent(&pdev->dev,
sizeof(u32) * ioa_cfg->hrrq[i].size,
ioa_cfg->hrrq[i].host_rrq,
ioa_cfg->hrrq[i].host_rrq_dma);
@@ -9116,17 +9118,19 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
ioa_cfg->hrrq[i].ioa_cfg = ioa_cfg;
}
- ioa_cfg->u.cfg_table = pci_alloc_consistent(ioa_cfg->pdev,
- ioa_cfg->cfg_table_size,
- &ioa_cfg->cfg_table_dma);
+ ioa_cfg->u.cfg_table = dma_alloc_coherent(&pdev->dev,
+ ioa_cfg->cfg_table_size,
+ &ioa_cfg->cfg_table_dma,
+ GFP_KERNEL);
if (!ioa_cfg->u.cfg_table)
goto out_free_host_rrq;
for (i = 0; i < IPR_NUM_HCAMS; i++) {
- ioa_cfg->hostrcb[i] = pci_alloc_consistent(ioa_cfg->pdev,
- sizeof(struct ipr_hostrcb),
- &ioa_cfg->hostrcb_dma[i]);
+ ioa_cfg->hostrcb[i] = dma_alloc_coherent(&pdev->dev,
+ sizeof(struct ipr_hostrcb),
+ &ioa_cfg->hostrcb_dma[i],
+ GFP_KERNEL);
if (!ioa_cfg->hostrcb[i])
goto out_free_hostrcb_dma;
@@ -9150,25 +9154,24 @@ out:
out_free_hostrcb_dma:
while (i-- > 0) {
- pci_free_consistent(pdev, sizeof(struct ipr_hostrcb),
- ioa_cfg->hostrcb[i],
- ioa_cfg->hostrcb_dma[i]);
+ dma_free_coherent(&pdev->dev, sizeof(struct ipr_hostrcb),
+ ioa_cfg->hostrcb[i],
+ ioa_cfg->hostrcb_dma[i]);
}
- pci_free_consistent(pdev, ioa_cfg->cfg_table_size,
- ioa_cfg->u.cfg_table,
- ioa_cfg->cfg_table_dma);
+ dma_free_coherent(&pdev->dev, ioa_cfg->cfg_table_size,
+ ioa_cfg->u.cfg_table, ioa_cfg->cfg_table_dma);
out_free_host_rrq:
for (i = 0; i < ioa_cfg->hrrq_num; i++) {
- pci_free_consistent(pdev,
- sizeof(u32) * ioa_cfg->hrrq[i].size,
- ioa_cfg->hrrq[i].host_rrq,
- ioa_cfg->hrrq[i].host_rrq_dma);
+ dma_free_coherent(&pdev->dev,
+ sizeof(u32) * ioa_cfg->hrrq[i].size,
+ ioa_cfg->hrrq[i].host_rrq,
+ ioa_cfg->hrrq[i].host_rrq_dma);
}
out_ipr_free_cmd_blocks:
ipr_free_cmd_blks(ioa_cfg);
out_free_vpd_cbs:
- pci_free_consistent(pdev, sizeof(struct ipr_misc_cbs),
- ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
+ dma_free_coherent(&pdev->dev, sizeof(struct ipr_misc_cbs),
+ ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
out_free_res_entries:
kfree(ioa_cfg->res_entries);
goto out;
@@ -9608,13 +9611,13 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
ipr_init_regs(ioa_cfg);
if (ioa_cfg->sis64) {
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
if (rc < 0) {
dev_dbg(&pdev->dev, "Failed to set 64 bit PCI DMA mask\n");
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
}
} else
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (rc < 0) {
dev_err(&pdev->dev, "Failed to set PCI DMA mask\n");
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 31ed126..14f62c8 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -1548,7 +1548,7 @@ struct ipr_ioa_cfg {
struct ipr_misc_cbs *vpd_cbs;
dma_addr_t vpd_cbs_dma;
- struct pci_pool *ipr_cmd_pool;
+ struct dma_pool *ipr_cmd_pool;
struct ipr_cmnd *reset_cmd;
int (*reset) (struct ipr_cmnd *);
--
1.9.1
^ permalink raw reply related
* [PATCH 2/2] ipr: set coherent DMA mask
From: Anton Blanchard @ 2014-10-13 9:14 UTC (permalink / raw)
To: benh, paulus, mpe, wenxiong, brking, scottwood; +Cc: linuxppc-dev, linux-scsi
In-Reply-To: <1413191676-1663-1-git-send-email-anton@samba.org>
Use dma_set_mask_and_coherent() to set both the DMA and coherent
DMA mask.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
drivers/scsi/ipr.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 3aa28bd..15f4575 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -9611,16 +9611,17 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
ipr_init_regs(ioa_cfg);
if (ioa_cfg->sis64) {
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (rc < 0) {
- dev_dbg(&pdev->dev, "Failed to set 64 bit PCI DMA mask\n");
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ dev_dbg(&pdev->dev, "Failed to set 64 bit DMA mask\n");
+ rc = dma_set_mask_and_coherent(&pdev->dev,
+ DMA_BIT_MASK(32));
}
} else
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (rc < 0) {
- dev_err(&pdev->dev, "Failed to set PCI DMA mask\n");
+ dev_err(&pdev->dev, "Failed to set DMA mask\n");
goto cleanup_nomem;
}
--
1.9.1
^ permalink raw reply related
* [PATCH] powerpc: sync pseries_le_defconfig with pseries_defconfig
From: Anton Blanchard @ 2014-10-13 9:17 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
Now KVM is working on LE, enable it. Also enable transarent
hugepage which has already been enabled on BE.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/configs/pseries_le_defconfig | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/configs/pseries_le_defconfig b/arch/powerpc/configs/pseries_le_defconfig
index 4428ee4..96a230c 100644
--- a/arch/powerpc/configs/pseries_le_defconfig
+++ b/arch/powerpc/configs/pseries_le_defconfig
@@ -48,7 +48,6 @@ CONFIG_KEXEC=y
CONFIG_IRQ_ALL_CPUS=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTREMOVE=y
-CONFIG_CMA=y
CONFIG_PPC_64K_PAGES=y
CONFIG_PPC_SUBPAGE_PROT=y
CONFIG_SCHED_SMT=y
@@ -137,6 +136,7 @@ CONFIG_NETCONSOLE=y
CONFIG_NETPOLL_TRAP=y
CONFIG_TUN=m
CONFIG_VIRTIO_NET=m
+CONFIG_VHOST_NET=m
CONFIG_VORTEX=y
CONFIG_ACENIC=m
CONFIG_ACENIC_OMIT_TIGON_I=y
@@ -302,4 +302,9 @@ CONFIG_CRYPTO_LZO=m
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRYPTO_DEV_NX=y
CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM_BOOK3S_64=m
+CONFIG_KVM_BOOK3S_64_HV=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
--
1.9.1
^ permalink raw reply related
* [PATCH] powerpc: Add printk levels to setup_system output
From: Anton Blanchard @ 2014-10-13 9:21 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/setup_64.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index cd07d79..4f3cfe1 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -522,36 +522,36 @@ void __init setup_system(void)
smp_release_cpus();
#endif
- printk("Starting Linux PPC64 %s\n", init_utsname()->version);
+ pr_info("Starting Linux PPC64 %s\n", init_utsname()->version);
- printk("-----------------------------------------------------\n");
- printk("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
- printk("phys_mem_size = 0x%llx\n", memblock_phys_mem_size());
+ pr_info("-----------------------------------------------------\n");
+ pr_info("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
+ pr_info("phys_mem_size = 0x%llx\n", memblock_phys_mem_size());
if (ppc64_caches.dline_size != 0x80)
- printk("dcache_line_size = 0x%x\n", ppc64_caches.dline_size);
+ pr_info("dcache_line_size = 0x%x\n", ppc64_caches.dline_size);
if (ppc64_caches.iline_size != 0x80)
- printk("icache_line_size = 0x%x\n", ppc64_caches.iline_size);
+ pr_info("icache_line_size = 0x%x\n", ppc64_caches.iline_size);
- printk("cpu_features = 0x%016lx\n", cur_cpu_spec->cpu_features);
- printk(" possible = 0x%016lx\n", CPU_FTRS_POSSIBLE);
- printk(" always = 0x%016lx\n", CPU_FTRS_ALWAYS);
- printk("cpu_user_features = 0x%08x 0x%08x\n", cur_cpu_spec->cpu_user_features,
+ pr_info("cpu_features = 0x%016lx\n", cur_cpu_spec->cpu_features);
+ pr_info(" possible = 0x%016lx\n", CPU_FTRS_POSSIBLE);
+ pr_info(" always = 0x%016lx\n", CPU_FTRS_ALWAYS);
+ pr_info("cpu_user_features = 0x%08x 0x%08x\n", cur_cpu_spec->cpu_user_features,
cur_cpu_spec->cpu_user_features2);
- printk("mmu_features = 0x%08x\n", cur_cpu_spec->mmu_features);
- printk("firmware_features = 0x%016lx\n", powerpc_firmware_features);
+ pr_info("mmu_features = 0x%08x\n", cur_cpu_spec->mmu_features);
+ pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features);
#ifdef CONFIG_PPC_STD_MMU_64
if (htab_address)
- printk("htab_address = 0x%p\n", htab_address);
+ pr_info("htab_address = 0x%p\n", htab_address);
- printk("htab_hash_mask = 0x%lx\n", htab_hash_mask);
+ pr_info("htab_hash_mask = 0x%lx\n", htab_hash_mask);
#endif
if (PHYSICAL_START > 0)
- printk("physical_start = 0x%llx\n",
+ pr_info("physical_start = 0x%llx\n",
(unsigned long long)PHYSICAL_START);
- printk("-----------------------------------------------------\n");
+ pr_info("-----------------------------------------------------\n");
DBG(" <- setup_system()\n");
}
--
1.9.1
^ permalink raw reply related
* [PATCH] powerpc: Use probe_kernel_address in show_instructions
From: Anton Blanchard @ 2014-10-13 9:27 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
We really don't want to take a pagefault in show_instructions,
so use probe_kernel_address instead of __get_user.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/process.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 923cd2d..e5698f1 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -37,9 +37,9 @@
#include <linux/personality.h>
#include <linux/random.h>
#include <linux/hw_breakpoint.h>
+#include <linux/uaccess.h>
#include <asm/pgtable.h>
-#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/mmu.h>
@@ -921,12 +921,8 @@ static void show_instructions(struct pt_regs *regs)
pc = (unsigned long)phys_to_virt(pc);
#endif
- /* We use __get_user here *only* to avoid an OOPS on a
- * bad address because the pc *should* only be a
- * kernel address.
- */
if (!__kernel_text_address(pc) ||
- __get_user(instr, (unsigned int __user *)pc)) {
+ probe_kernel_address((unsigned int __user *)pc, instr)) {
printk(KERN_CONT "XXXXXXXX ");
} else {
if (regs->nip == pc)
--
1.9.1
^ permalink raw reply related
* Re: powerpc32: add support for csum_add()
From: leroy christophe @ 2014-10-13 11:17 UTC (permalink / raw)
To: Jochen Rollwagen; +Cc: linuxppc-dev
In-Reply-To: <543AAADB.1070304@t-online.de>
[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]
Le 12/10/2014 18:22, Jochen Rollwagen a écrit :
> This patch
>
> https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-September/121144.html
>
> only compiles after putting an #ifndef ARCH_HAS_CSUM_ADD around the
> definition in include/net/checksum.h
>
> This is missing from the patch
>
>
This is already included upstream since May 2014, see patch below
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=07064c6e022ba8dc0c86ce12f7851a1de24e04fc
From 07064c6e022ba8dc0c86ce12f7851a1de24e04fc Mon Sep 17 00:00:00 2001
From: Tom Herbert <therbert@google.com>
Date: Fri, 2 May 2014 16:28:03 -0700
Subject: net: Allow csum_add to be provided in arch
csum_add is really nothing more then add-with-carry which
can be implemented efficiently in some architectures.
Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/include/net/checksum.h b/include/net/checksum.h
index a28f4e0..87cb190 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
}
#endif
+#ifndef HAVE_ARCH_CSUM_ADD
static inline __wsum csum_add(__wsum csum, __wsum addend)
{
u32 res = (__force u32)csum;
res += (__force u32)addend;
return (__force __wsum)(res + (res < (__force u32)addend));
}
+#endif
static inline __wsum csum_sub(__wsum csum, __wsum addend)
{
--
cgit v0.10.1
[-- Attachment #2: Type: text/html, Size: 3020 bytes --]
^ permalink raw reply related
* [PATCH v2 04/20] powerpc/52xx/efika: Use pm_power_off rather than ppc_md.power_off
From: Alexander Graf @ 2014-10-13 14:01 UTC (permalink / raw)
To: linuxppc-dev; +Cc: arnd, geoff, alistair, scottwood, agust, linux
In-Reply-To: <1413208888-49211-1-git-send-email-agraf@suse.de>
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
v1 -> v2:
- write pm_power_off in probe function
---
arch/powerpc/platforms/52xx/efika.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 3feffde..6af651e 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -212,6 +212,8 @@ static int __init efika_probe(void)
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;
+ pm_power_off = rtas_power_off;
+
return 1;
}
@@ -225,7 +227,6 @@ define_machine(efika)
.init_IRQ = mpc52xx_init_irq,
.get_irq = mpc52xx_get_irq,
.restart = rtas_restart,
- .power_off = rtas_power_off,
.halt = rtas_halt,
.set_rtc_time = rtas_set_rtc_time,
.get_rtc_time = rtas_get_rtc_time,
--
1.8.1.4
^ permalink raw reply related
* [PATCH v2 02/20] powerpc/xmon: Support either ppc_md.power_off or pm_power_off
From: Alexander Graf @ 2014-10-13 14:01 UTC (permalink / raw)
To: linuxppc-dev; +Cc: arnd, geoff, alistair, scottwood, agust, linux
In-Reply-To: <1413208888-49211-1-git-send-email-agraf@suse.de>
Xmon can manually turn off the machine. We now have 2 code paths for this:
1) ppc_md.power_off
2) pm_power_off
This patch allows xmon to support both and makes sure it graciously allows
a path to not be implemented.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/xmon/xmon.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index b988b5a..531f649 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -981,7 +981,10 @@ static void bootcmds(void)
else if (cmd == 'h')
ppc_md.halt();
else if (cmd == 'p')
- ppc_md.power_off();
+ if (ppc_md.power_off)
+ ppc_md.power_off();
+ if (pm_power_off)
+ pm_power_off();
}
static int cpu_cmd(void)
--
1.8.1.4
^ permalink raw reply related
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