05 Jun, 2018

2 commits

  • Pull dma-mapping updates from Christoph Hellwig:

    - replace the force_dma flag with a dma_configure bus method. (Nipun
    Gupta, although one patch is іncorrectly attributed to me due to a
    git rebase bug)

    - use GFP_DMA32 more agressively in dma-direct. (Takashi Iwai)

    - remove PCI_DMA_BUS_IS_PHYS and rely on the dma-mapping API to do the
    right thing for bounce buffering.

    - move dma-debug initialization to common code, and apply a few
    cleanups to the dma-debug code.

    - cleanup the Kconfig mess around swiotlb selection

    - swiotlb comment fixup (Yisheng Xie)

    - a trivial swiotlb fix. (Dan Carpenter)

    - support swiotlb on RISC-V. (based on a patch from Palmer Dabbelt)

    - add a new generic dma-noncoherent dma_map_ops implementation and use
    it for arc, c6x and nds32.

    - improve scatterlist validity checking in dma-debug. (Robin Murphy)

    - add a struct device quirk to limit the dma-mask to 32-bit due to
    bridge/system issues, and switch x86 to use it instead of a local
    hack for VIA bridges.

    - handle devices without a dma_mask more gracefully in the dma-direct
    code.

    * tag 'dma-mapping-4.18' of git://git.infradead.org/users/hch/dma-mapping: (48 commits)
    dma-direct: don't crash on device without dma_mask
    nds32: use generic dma_noncoherent_ops
    nds32: implement the unmap_sg DMA operation
    nds32: consolidate DMA cache maintainance routines
    x86/pci-dma: switch the VIA 32-bit DMA quirk to use the struct device flag
    x86/pci-dma: remove the explicit nodac and allowdac option
    x86/pci-dma: remove the experimental forcesac boot option
    Documentation/x86: remove a stray reference to pci-nommu.c
    core, dma-direct: add a flag 32-bit dma limits
    dma-mapping: remove unused gfp_t parameter to arch_dma_alloc_attrs
    dma-debug: check scatterlist segments
    c6x: use generic dma_noncoherent_ops
    arc: use generic dma_noncoherent_ops
    arc: fix arc_dma_{map,unmap}_page
    arc: fix arc_dma_sync_sg_for_{cpu,device}
    arc: simplify arc_dma_sync_single_for_{cpu,device}
    dma-mapping: provide a generic dma-noncoherent implementation
    dma-mapping: simplify Kconfig dependencies
    riscv: add swiotlb support
    riscv: only enable ZONE_DMA32 for 64-bit
    ...

    Linus Torvalds
     
  • Pull procfs updates from Al Viro:
    "Christoph's proc_create_... cleanups series"

    * 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits)
    xfs, proc: hide unused xfs procfs helpers
    isdn/gigaset: add back gigaset_procinfo assignment
    proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields
    tty: replace ->proc_fops with ->proc_show
    ide: replace ->proc_fops with ->proc_show
    ide: remove ide_driver_proc_write
    isdn: replace ->proc_fops with ->proc_show
    atm: switch to proc_create_seq_private
    atm: simplify procfs code
    bluetooth: switch to proc_create_seq_data
    netfilter/x_tables: switch to proc_create_seq_private
    netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data
    neigh: switch to proc_create_seq_data
    hostap: switch to proc_create_{seq,single}_data
    bonding: switch to proc_create_seq_data
    rtc/proc: switch to proc_create_single_data
    drbd: switch to proc_create_single
    resource: switch to proc_create_seq_data
    staging/rtl8192u: simplify procfs code
    jfs: simplify procfs code
    ...

    Linus Torvalds
     

18 May, 2018

1 commit


16 May, 2018

1 commit


09 May, 2018

1 commit


07 May, 2018

1 commit

  • This was used by the ide, scsi and networking code in the past to
    determine if they should bounce payloads. Now that the dma mapping
    always have to support dma to all physical memory (thanks to swiotlb
    for non-iommu systems) there is no need to this crude hack any more.

    Signed-off-by: Christoph Hellwig
    Acked-by: Palmer Dabbelt (for riscv)
    Reviewed-by: Jens Axboe

    Christoph Hellwig
     

03 May, 2018

1 commit

  • Fix three section mismatches:
    1) Section mismatch in reference from the function ioread8() to the
    function .init.text:pcibios_init_bridge()
    2) Section mismatch in reference from the function free_initmem() to the
    function .init.text:map_pages()
    3) Section mismatch in reference from the function ccio_ioc_init() to
    the function .init.text:count_parisc_driver()

    Signed-off-by: Helge Deller

    Helge Deller
     

28 Mar, 2018

3 commits


03 Jan, 2018

2 commits


18 Dec, 2017

1 commit


02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

25 Aug, 2017

1 commit

  • A MegaRAID PCI card in my rp5470 acts as PCI-PCI bridge.
    Resource allocation for PCI devices behind such a bridge is quite incomplete,
    so that syslog reports those warnings:

    LBA 0:10: PCI host bridge to bus 0000:50
    pci_bus 0000:50: root bus resource [io 0x80000-0x8ffff] (bus address [0x0000-0xffff])
    pci_bus 0000:50: root bus resource [mem 0xffffffff94000000-0xffffffff95ffffff] (bus address [0x94000000-0x95ffffff])
    pci_bus 0000:50: root bus resource [bus 50-57]
    pci 0000:50:00.0: [8086:0964] type 01 class 0x060400
    pci 0000:50:00.1: [8086:1960] type 00 class 0x0e0001
    pci 0000:50:00.1: reg 0x10: [mem 0x00000000-0x003fffff pref]
    pci 0000:50:00.1: reg 0x30: [mem 0x00000000-0x00007fff pref]
    pci 0000:50:00.0: Changing bridge control from 0x00000000 to 0x00000023
    pci_bus 0000:51: busn_res: can not insert [bus 51-ff] under [bus 50-57] (conflicts with (null) [bus 50-57])
    pci 0000:50:00.0: PCI bridge to [bus 51-ff]
    pci 0000:50:00.0: bridge window [io 0x80000-0x80fff]
    pci 0000:50:00.0: bridge window [mem 0x00000000-0x000fffff]
    pci 0000:50:00.0: bridge window [mem 0x00000000-0x000fffff pref]
    pci 0000:50:00.0: can't claim BAR 14 [mem 0x00000000-0x000fffff]: no compatible bridge window
    pci 0000:50:00.0: can't claim BAR 15 [mem 0x00000000-0x000fffff pref]: no compatible bridge window
    pci 0000:50:00.0: can't claim BAR 16 [??? 0x00000000 flags 0x0]: no compatible bridge window
    pci_bus 0000:51: busn_res: [bus 51-ff] end is updated to 51
    pci 0000:50:00.0: BAR 16: [??? 0x00000000 flags 0x20000000] has bogus alignment
    pci 0000:50:00.1: BAR 0: assigned [mem 0xffffffff94000000-0xffffffff943fffff pref]
    pci 0000:50:00.0: BAR 14: assigned [mem 0xffffffff94400000-0xffffffff944fffff]
    pci 0000:50:00.0: BAR 15: assigned [mem 0xffffffff94500000-0xffffffff945fffff pref]
    pci 0000:50:00.1: BAR 6: assigned [mem 0xffffffff94600000-0xffffffff94607fff pref]
    pci 0000:50:00.0: PCI bridge to [bus 51]
    pci 0000:50:00.0: bridge window [io 0x80000-0x80fff]
    pci 0000:50:00.0: bridge window [mem 0xffffffff94400000-0xffffffff944fffff]
    pci 0000:50:00.0: bridge window [mem 0xffffffff94500000-0xffffffff945fffff pref]

    The patch below tries to improve the resource allocation.
    Output is now:

    LBA 0:10: PCI host bridge to bus 0000:50
    pci_bus 0000:50: root bus resource [io 0x80000-0x8ffff] (bus address [0x0000-0xffff])
    pci_bus 0000:50: root bus resource [mem 0xffffffff94000000-0xffffffff95ffffff] (bus address [0x94000000-0x95ffffff])
    pci_bus 0000:50: root bus resource [bus 50-57]
    pci 0000:50:00.0: Changing bridge control from 0x00000000 to 0x00000023
    pci 0000:50:00.0: PCI bridge to [bus 51-ff]
    pci 0000:50:00.1: BAR 0: assigned [mem 0xffffffff94000000-0xffffffff943fffff pref]
    pci 0000:50:00.1: BAR 6: assigned [mem 0xffffffff94400000-0xffffffff94407fff pref]
    pci 0000:50:00.0: PCI bridge to [bus 51]
    pci 0000:50:00.0: bridge window [io 0x80000-0x80fff]

    Signed-off-by: Helge Deller

    Helge Deller
     

22 Aug, 2017

1 commit


16 Aug, 2017

1 commit


31 Jul, 2017

1 commit

  • There's no need to take the write lock when creating sysfs links.

    This patch fixes the following BUG:
    BUG: sleeping function called from invalid context at mm/slab.h:416
    in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
    CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc2-00110-g0b5477d9dabd #111
    Backtrace:
    [] show_stack+0x20/0x38
    [] dump_stack+0xb0/0x128
    [] ___might_sleep+0x180/0x1b8
    [] __might_sleep+0x7c/0xe8
    [] kmem_cache_alloc+0x14c/0x1e0
    [] __kernfs_new_node+0x84/0x1b8
    [] kernfs_new_node+0x3c/0x78
    [] kernfs_create_link+0x40/0xd8
    [] sysfs_do_create_link_sd.isra.0+0xb0/0x130
    [] sysfs_create_link+0x34/0x58
    [] pdc_stable_init+0x2c4/0x458
    [] do_one_initcall+0x70/0x1d8
    [] kernel_init_freeable+0x27c/0x390
    [] kernel_init+0x24/0x1c0

    Signed-off-by: James Bottomley
    Reported-by: Meelis Roos
    Signed-off-by: Helge Deller

    James Bottomley
     

24 Jul, 2017

1 commit


06 Jul, 2017

1 commit

  • DMA_ERROR_CODE already went away in linux-next, but parisc unfortunately
    added a new instance of it without any review as far as I can tell.

    Move the two iommu drivers to report errors through ->mapping_error.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Helge Deller

    Christoph Hellwig
     

03 Jul, 2017

1 commit

  • Enabling parport pc driver on a B2600 (and probably other 64bit PARISC
    systems) produced following BUG:

    CPU: 0 PID: 1 Comm: swapper Not tainted 4.12.0-rc5-30198-g1132d5e #156
    task: 000000009e050000 task.stack: 000000009e04c000

    YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
    PSW: 00001000000001101111111100001111 Not tainted
    r00-03 000000ff0806ff0f 000000009e04c990 0000000040871b78 000000009e04cac0
    r04-07 0000000040c14de0 ffffffffffffffff 000000009e07f098 000000009d82d200
    r08-11 000000009d82d210 0000000000000378 0000000000000000 0000000040c345e0
    r12-15 0000000000000005 0000000040c345e0 0000000000000000 0000000040c9d5e0
    r16-19 0000000040c345e0 00000000f00001c4 00000000f00001bc 0000000000000061
    r20-23 000000009e04ce28 0000000000000010 0000000000000010 0000000040b89e40
    r24-27 0000000000000003 0000000000ffffff 000000009d82d210 0000000040c14de0
    r28-31 0000000000000000 000000009e04ca90 000000009e04cb40 0000000000000000
    sr00-03 0000000000000000 0000000000000000 0000000000000000 0000000000000000
    sr04-07 0000000000000000 0000000000000000 0000000000000000 0000000000000000

    IASQ: 0000000000000000 0000000000000000 IAOQ: 00000000404aece0 00000000404aece4
    IIR: 03ffe01f ISR: 0000000010340000 IOR: 000001781304cac8
    CPU: 0 CR30: 000000009e04c000 CR31: 00000000e2976de2
    ORIG_R28: 0000000000000200
    IAOQ[0]: sba_dma_supported+0x80/0xd0
    IAOQ[1]: sba_dma_supported+0x84/0xd0
    RP(r2): parport_pc_probe_port+0x178/0x1200

    Cause is a call to dma_coerce_mask_and_coherenet in parport_pc_probe_port,
    which PARISC DMA API doesn't handle very nicely. This commit gives back
    DMA_ERROR_CODE for DMA API calls, if device isn't capable of DMA
    transaction.

    Cc: # v3.13+
    Signed-off-by: Thomas Bogendoerfer
    Signed-off-by: Helge Deller

    Thomas Bogendoerfer
     

04 Mar, 2017

1 commit

  • Pull parisc fixes and cleanups from Helge Deller:
    "Nothing really important in this patchset: fix resource leaks in error
    paths, coding style cleanups and code removal"

    * 'parisc-4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
    parisc: Remove flush_user_dcache_range and flush_user_icache_range
    parisc: fix a printk
    parisc: ccio-dma: Handle return NULL error from ioremap_nocache
    parisc: Define access_ok() as macro
    parisc: eisa: Fix resource leaks in error paths
    parisc: eisa: Remove coding style errors

    Linus Torvalds
     

02 Mar, 2017

1 commit


26 Feb, 2017

3 commits


25 Jan, 2017

1 commit

  • Most dma_map_ops structures are never modified. Constify these
    structures such that these can be write-protected. This patch
    has been generated as follows:

    git grep -l 'struct dma_map_ops' |
    xargs -d\\n sed -i \
    -e 's/struct dma_map_ops/const struct dma_map_ops/g' \
    -e 's/const struct dma_map_ops {/struct dma_map_ops {/g' \
    -e 's/^const struct dma_map_ops;$/struct dma_map_ops;/' \
    -e 's/const const struct dma_map_ops /const struct dma_map_ops /g';
    sed -i -e 's/const \(struct dma_map_ops intel_dma_ops\)/\1/' \
    $(git grep -l 'struct dma_map_ops intel_dma_ops');
    sed -i -e 's/const \(struct dma_map_ops dma_iommu_ops\)/\1/' \
    $(git grep -l 'struct dma_map_ops' | grep ^arch/powerpc);
    sed -i -e '/^struct vmd_dev {$/,/^};$/ s/const \(struct dma_map_ops[[:blank:]]dma_ops;\)/\1/' \
    -e '/^static void vmd_setup_dma_ops/,/^}$/ s/const \(struct dma_map_ops \*dest\)/\1/' \
    -e 's/const \(struct dma_map_ops \*dest = \&vmd->dma_ops\)/\1/' \
    drivers/pci/host/*.c
    sed -i -e '/^void __init pci_iommu_alloc(void)$/,/^}$/ s/dma_ops->/intel_dma_ops./' arch/ia64/kernel/pci-dma.c
    sed -i -e 's/static const struct dma_map_ops sn_dma_ops/static struct dma_map_ops sn_dma_ops/' arch/ia64/sn/pci/pci_dma.c
    sed -i -e 's/(const struct dma_map_ops \*)//' drivers/misc/mic/bus/vop_bus.c

    Signed-off-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Cc: Benjamin Herrenschmidt
    Cc: Boris Ostrovsky
    Cc: David Woodhouse
    Cc: Juergen Gross
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Russell King
    Cc: x86@kernel.org
    Signed-off-by: Doug Ledford

    Bart Van Assche
     

25 Dec, 2016

1 commit


04 Aug, 2016

1 commit

  • The dma-mapping core and the implementations do not change the DMA
    attributes passed by pointer. Thus the pointer can point to const data.
    However the attributes do not have to be a bitfield. Instead unsigned
    long will do fine:

    1. This is just simpler. Both in terms of reading the code and setting
    attributes. Instead of initializing local attributes on the stack
    and passing pointer to it to dma_set_attr(), just set the bits.

    2. It brings safeness and checking for const correctness because the
    attributes are passed by value.

    Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
    Signed-off-by: Krzysztof Kozlowski
    Acked-by: Vineet Gupta
    Acked-by: Robin Murphy
    Acked-by: Hans-Christian Noren Egtvedt
    Acked-by: Mark Salter [c6x]
    Acked-by: Jesper Nilsson [cris]
    Acked-by: Daniel Vetter [drm]
    Reviewed-by: Bart Van Assche
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Fabien Dessenne [bdisp]
    Reviewed-by: Marek Szyprowski [vb2-core]
    Acked-by: David Vrabel [xen]
    Acked-by: Konrad Rzeszutek Wilk [xen swiotlb]
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Richard Kuo [hexagon]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Gerald Schaefer [s390]
    Acked-by: Bjorn Andersson
    Acked-by: Hans-Christian Noren Egtvedt [avr32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Robin Murphy [arm64 and dma-iommu]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     

17 Mar, 2016

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "PCI changes for v4.6:

    Enumeration:
    - Disable IO/MEM decoding for devices with non-compliant BARs (Bjorn Helgaas)
    - Mark Broadwell-EP Home Agent & PCU as having non-compliant BARs (Bjorn Helgaas

    Resource management:
    - Mark shadow copy of VGA ROM as IORESOURCE_PCI_FIXED (Bjorn Helgaas)
    - Don't assign or reassign immutable resources (Bjorn Helgaas)
    - Don't enable/disable ROM BAR if we're using a RAM shadow copy (Bjorn Helgaas)
    - Set ROM shadow location in arch code, not in PCI core (Bjorn Helgaas)
    - Remove arch-specific IORESOURCE_ROM_SHADOW size from sysfs (Bjorn Helgaas)
    - ia64: Use ioremap() instead of open-coded equivalent (Bjorn Helgaas)
    - ia64: Keep CPU physical (not virtual) addresses in shadow ROM resource (Bjorn Helgaas)
    - MIPS: Keep CPU physical (not virtual) addresses in shadow ROM resource (Bjorn Helgaas)
    - Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY (Bjorn Helgaas)
    - Don't leak memory if sysfs_create_bin_file() fails (Bjorn Helgaas)
    - rcar: Remove PCI_PROBE_ONLY handling (Lorenzo Pieralisi)
    - designware: Remove PCI_PROBE_ONLY handling (Lorenzo Pieralisi)

    Virtualization:
    - Wait for up to 1000ms after FLR reset (Alex Williamson)
    - Support SR-IOV on any function type (Kelly Zytaruk)
    - Add ACS quirk for all Cavium devices (Manish Jaggi)

    AER:
    - Rename pci_ops_aer to aer_inj_pci_ops (Bjorn Helgaas)
    - Restore pci_ops pointer while calling original pci_ops (David Daney)
    - Fix aer_inject error codes (Jean Delvare)
    - Use dev_warn() in aer_inject (Jean Delvare)
    - Log actual error causes in aer_inject (Jean Delvare)
    - Log aer_inject error injections (Jean Delvare)

    VPD:
    - Prevent VPD access for buggy devices (Babu Moger)
    - Move pci_read_vpd() and pci_write_vpd() close to other VPD code (Bjorn Helgaas)
    - Move pci_vpd_release() from header file to pci/access.c (Bjorn Helgaas)
    - Remove struct pci_vpd_ops.release function pointer (Bjorn Helgaas)
    - Rename VPD symbols to remove unnecessary "pci22" (Bjorn Helgaas)
    - Fold struct pci_vpd_pci22 into struct pci_vpd (Bjorn Helgaas)
    - Sleep rather than busy-wait for VPD access completion (Bjorn Helgaas)
    - Update VPD definitions (Hannes Reinecke)
    - Allow access to VPD attributes with size 0 (Hannes Reinecke)
    - Determine actual VPD size on first access (Hannes Reinecke)

    Generic host bridge driver:
    - Move structure definitions to separate header file (David Daney)
    - Add pci_host_common_probe(), based on gen_pci_probe() (David Daney)
    - Expose pci_host_common_probe() for use by other drivers (David Daney)

    Altera host bridge driver:
    - Fix altera_pcie_link_is_up() (Ley Foon Tan)

    Cavium ThunderX host bridge driver:
    - Add PCIe host driver for ThunderX processors (David Daney)
    - Add driver for ThunderX-pass{1,2} on-chip devices (David Daney)

    Freescale i.MX6 host bridge driver:
    - Add DT bindings to configure PHY Tx driver settings (Justin Waters)
    - Move imx6_pcie_reset_phy() near other PHY handling functions (Lucas Stach)
    - Move PHY reset into imx6_pcie_establish_link() (Lucas Stach)
    - Remove broken Gen2 workaround (Lucas Stach)
    - Move link up check into imx6_pcie_wait_for_link() (Lucas Stach)

    Freescale Layerscape host bridge driver:
    - Add "fsl,ls2085a-pcie" compatible ID (Yang Shi)

    Intel VMD host bridge driver:
    - Attach VMD resources to parent domain's resource tree (Jon Derrick)
    - Set bus resource start to 0 (Keith Busch)

    Microsoft Hyper-V host bridge driver:
    - Add fwnode_handle to x86 pci_sysdata (Jake Oshins)
    - Look up IRQ domain by fwnode_handle (Jake Oshins)
    - Add paravirtual PCI front-end for Microsoft Hyper-V VMs (Jake Oshins)

    NVIDIA Tegra host bridge driver:
    - Add pci_ops.{add,remove}_bus() callbacks (Thierry Reding)
    - Implement ->{add,remove}_bus() callbacks (Thierry Reding)
    - Remove unused struct tegra_pcie.num_ports field (Thierry Reding)
    - Track bus -> CPU mapping (Thierry Reding)
    - Remove misleading PHYS_OFFSET (Thierry Reding)

    Renesas R-Car host bridge driver:
    - Depend on ARCH_RENESAS, not ARCH_SHMOBILE (Simon Horman)

    Synopsys DesignWare host bridge driver:
    - ARC: Add PCI support (Joao Pinto)
    - Add generic dw_pcie_wait_for_link() (Joao Pinto)
    - Add default link up check if sub-driver doesn't override (Joao Pinto)
    - Add driver for prototyping kits based on ARC SDP (Joao Pinto)

    TI Keystone host bridge driver:
    - Defer probing if devm_phy_get() returns -EPROBE_DEFER (Shawn Lin)

    Xilinx AXI host bridge driver:
    - Use of_pci_get_host_bridge_resources() to parse DT (Bharat Kumar Gogada)
    - Remove dependency on ARM-specific struct hw_pci (Bharat Kumar Gogada)
    - Don't call pci_fixup_irqs() on Microblaze (Bharat Kumar Gogada)
    - Update Zynq binding with Microblaze node (Bharat Kumar Gogada)
    - microblaze: Support generic Xilinx AXI PCIe Host Bridge IP driver (Bharat Kumar Gogada)

    Xilinx NWL host bridge driver:
    - Add support for Xilinx NWL PCIe Host Controller (Bharat Kumar Gogada)

    Miscellaneous:
    - Check device_attach() return value always (Bjorn Helgaas)
    - Move pci_set_flags() from asm-generic/pci-bridge.h to linux/pci.h (Bjorn Helgaas)
    - Remove includes of empty asm-generic/pci-bridge.h (Bjorn Helgaas)
    - ARM64: Remove generated include of asm-generic/pci-bridge.h (Bjorn Helgaas)
    - Remove empty asm-generic/pci-bridge.h (Bjorn Helgaas)
    - Remove includes of asm/pci-bridge.h (Bjorn Helgaas)
    - Consolidate PCI DMA constants and interfaces in linux/pci-dma-compat.h (Bjorn Helgaas)
    - unicore32: Remove unused HAVE_ARCH_PCI_SET_DMA_MASK definition (Bjorn Helgaas)
    - Cleanup pci/pcie/Kconfig whitespace (Andreas Ziegler)
    - Include pci/hotplug Kconfig directly from pci/Kconfig (Bjorn Helgaas)
    - Include pci/pcie/Kconfig directly from pci/Kconfig (Bogicevic Sasa)
    - frv: Remove stray pci_{alloc,free}_consistent() declaration (Christoph Hellwig)
    - Move pci_dma_* helpers to common code (Christoph Hellwig)
    - Add PCI_CLASS_SERIAL_USB_DEVICE definition (Heikki Krogerus)
    - Add QEMU top-level IDs for (sub)vendor & device (Robin H. Johnson)
    - Fix broken URL for Dell biosdevname (Naga Venkata Sai Indubhaskar Jupudi)"

    * tag 'pci-v4.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (94 commits)
    PCI: Add PCI_CLASS_SERIAL_USB_DEVICE definition
    PCI: designware: Add driver for prototyping kits based on ARC SDP
    PCI: designware: Add default link up check if sub-driver doesn't override
    PCI: designware: Add generic dw_pcie_wait_for_link()
    PCI: Cleanup pci/pcie/Kconfig whitespace
    PCI: Simplify pci_create_attr() control flow
    PCI: Don't leak memory if sysfs_create_bin_file() fails
    PCI: Simplify sysfs ROM cleanup
    PCI: Remove unused IORESOURCE_ROM_COPY and IORESOURCE_ROM_BIOS_COPY
    MIPS: Loongson 3: Keep CPU physical (not virtual) addresses in shadow ROM resource
    MIPS: Loongson 3: Use temporary struct resource * to avoid repetition
    ia64/PCI: Keep CPU physical (not virtual) addresses in shadow ROM resource
    ia64/PCI: Use ioremap() instead of open-coded equivalent
    ia64/PCI: Use temporary struct resource * to avoid repetition
    PCI: Clean up pci_map_rom() whitespace
    PCI: Remove arch-specific IORESOURCE_ROM_SHADOW size from sysfs
    PCI: thunder: Add driver for ThunderX-pass{1,2} on-chip devices
    PCI: thunder: Add PCIe host driver for ThunderX processors
    PCI: generic: Expose pci_host_common_probe() for use by other drivers
    PCI: generic: Add pci_host_common_probe(), based on gen_pci_probe()
    ...

    Linus Torvalds
     

09 Mar, 2016

1 commit

  • Include pci/hotplug/Kconfig directly from pci/Kconfig, so arches don't
    have to source both pci/Kconfig and pci/hotplug/Kconfig.

    Note that this effectively adds pci/hotplug/Kconfig to the following
    arches, because they already sourced drivers/pci/Kconfig but they
    previously did not source drivers/pci/hotplug/Kconfig:

    alpha
    arm
    avr32
    frv
    m68k
    microblaze
    mn10300
    sparc
    unicore32

    Inspired-by-patch-from: Bogicevic Sasa
    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

30 Jan, 2016

1 commit

  • I/O resource descriptor, 'desc' in struct resource, needs to be
    initialized to zero by default. Some drivers call kmalloc() to
    allocate a resource entry, but do not initialize it to zero by
    memset(). Change these drivers to call kzalloc(), instead.

    Signed-off-by: Toshi Kani
    Signed-off-by: Borislav Petkov
    Acked-by: Alexandre Bounine
    Acked-by: Helge Deller
    Acked-by: Rafael J. Wysocki
    Acked-by: Simon Horman
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Luis R. Rodriguez
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-mm
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-renesas-soc@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Link: http://lkml.kernel.org/r/1453841853-11383-10-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Toshi Kani
     

21 Jan, 2016

1 commit


13 Jan, 2016

1 commit


12 Dec, 2015

1 commit

  • When using the Promise TX2+ SATA controller on PA-RISC, the system often
    crashes with kernel panic, for example just writing data with the dd
    utility will make it crash.

    Kernel panic - not syncing: drivers/parisc/sba_iommu.c: I/O MMU @ 000000000000a000 is out of mapping resources

    CPU: 0 PID: 18442 Comm: mkspadfs Not tainted 4.4.0-rc2 #2
    Backtrace:
    [] show_stack+0x14/0x20
    [] dump_stack+0x88/0x100
    [] panic+0x124/0x360
    [] sba_alloc_range+0x698/0x6a0
    [] sba_map_sg+0x260/0x5b8
    [] ata_qc_issue+0x264/0x4a8 [libata]
    [] ata_scsi_translate+0xe4/0x220 [libata]
    [] ata_scsi_queuecmd+0xbc/0x320 [libata]
    [] scsi_dispatch_cmd+0xfc/0x130
    [] scsi_request_fn+0x6e4/0x970
    [] __blk_run_queue+0x40/0x60
    [] blk_run_queue+0x3c/0x68
    [] scsi_run_queue+0x2a4/0x360
    [] scsi_end_request+0x1a8/0x238
    [] scsi_io_completion+0xfc/0x688
    [] scsi_finish_command+0x17c/0x1d0

    The cause of the crash is not exhaustion of the IOMMU space, there is
    plenty of free pages. The function sba_alloc_range is called with size
    0x11000, thus the pages_needed variable is 0x11. The function
    sba_search_bitmap is called with bits_wanted 0x11 and boundary size is
    0x10 (because dma_get_seg_boundary(dev) returns 0xffff).

    The function sba_search_bitmap attempts to allocate 17 pages that must not
    cross 16-page boundary - it can't satisfy this requirement
    (iommu_is_span_boundary always returns true) and fails even if there are
    many free entries in the IOMMU space.

    How did it happen that we try to allocate 17 pages that don't cross
    16-page boundary? The cause is in the function iommu_coalesce_chunks. This
    function tries to coalesce adjacent entries in the scatterlist. The
    function does several checks if it may coalesce one entry with the next,
    one of those checks is this:

    if (startsg->length + dma_len > max_seg_size)
    break;

    When it finishes coalescing adjacent entries, it allocates the mapping:

    sg_dma_len(contig_sg) = dma_len;
    dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE);
    sg_dma_address(contig_sg) =
    PIDE_FLAG
    | (iommu_alloc_range(ioc, dev, dma_len) << IOVP_SHIFT)
    | dma_offset;

    It is possible that (startsg->length + dma_len > max_seg_size) is false
    (we are just near the 0x10000 max_seg_size boundary), so the funcion
    decides to coalesce this entry with the next entry. When the coalescing
    succeeds, the function performs
    dma_len = ALIGN(dma_len + dma_offset, IOVP_SIZE);
    And now, because of non-zero dma_offset, dma_len is greater than 0x10000.
    iommu_alloc_range (a pointer to sba_alloc_range) is called and it attempts
    to allocate 17 pages for a device that must not cross 16-page boundary.

    To fix the bug, we must make sure that dma_len after addition of
    dma_offset and alignment doesn't cross the segment boundary. I.e. change
    if (startsg->length + dma_len > max_seg_size)
    break;
    to
    if (ALIGN(dma_len + dma_offset + startsg->length, IOVP_SIZE) > max_seg_size)
    break;

    This patch makes this change (it precalculates max_seg_boundary at the
    beginning of the function iommu_coalesce_chunks). I also added a check
    that the mapping length doesn't exceed dma_get_seg_boundary(dev) (it is
    not needed for Promise TX2+ SATA, but it may be needed for other devices
    that have dma_get_seg_boundary lower than dma_get_max_seg_size).

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org
    Signed-off-by: Helge Deller

    Mikulas Patocka
     

11 Nov, 2015

1 commit


22 Oct, 2015

1 commit


16 Sep, 2015

1 commit

  • Revert dff22d2054b5 ("PCI: Call pci_read_bridge_bases() from core instead
    of arch code").

    Reading PCI bridge windows is not arch-specific in itself, but there is PCI
    core code that doesn't work correctly if we read them too early. For
    example, Hannes found this case on an ARM Freescale i.mx6 board:

    pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
    pci 0000:00:00.0: PCI bridge to [bus 01-ff]
    pci 0000:00:00.0: BAR 8: no space for [mem size 0x01000000] (mem window)
    pci 0000:01:00.0: BAR 2: failed to assign [mem size 0x00200000]
    pci 0000:01:00.0: BAR 1: failed to assign [mem size 0x00004000]
    pci 0000:01:00.0: BAR 0: failed to assign [mem size 0x00000100]

    The 00:00.0 mem window needs to be at least 3MB: the 01:00.0 device needs
    0x204100 of space, and mem windows are megabyte-aligned.

    Bus sizing can increase a bridge window size, but never *decrease* it (see
    d65245c3297a ("PCI: don't shrink bridge resources")). Prior to
    dff22d2054b5, ARM didn't read bridge windows at all, so the "original size"
    was zero, and we assigned a 3MB window.

    After dff22d2054b5, we read the bridge windows before sizing the bus. The
    firmware programmed a 16MB window (size 0x01000000) in 00:00.0, and since
    we never decrease the size, we kept 16MB even though we only needed 3MB.
    But 16MB doesn't fit in the host bridge aperture, so we failed to assign
    space for the window and the downstream devices.

    I think this is a defect in the PCI core: we shouldn't rely on the firmware
    to assign sensible windows.

    Ray reported a similar problem, also on ARM, with Broadcom iProc.

    Issues like this are too hard to fix right now, so revert dff22d2054b5.

    Reported-by: Hannes
    Reported-by: Ray Jui
    Link: http://lkml.kernel.org/r/CAAa04yFQEUJm7Jj1qMT57-LG7ZGtnhNDBe=PpSRa70Mj+XhW-A@mail.gmail.com
    Link: http://lkml.kernel.org/r/55F75BB8.4070405@broadcom.com
    Signed-off-by: Bjorn Helgaas
    Acked-by: Yinghai Lu
    Acked-by: Lorenzo Pieralisi

    Bjorn Helgaas
     

11 Sep, 2015

1 commit

  • Instead of custom approach let's use recently introduced seq_hex_dump()
    helper.

    In one case it changes the output from
    1111111122222222333333334444444455555555666666667777777788888888
    to
    11111111 22222222 33333333 44444444 55555555 66666666 77777777 88888888

    though it seems it prints same data (by meaning) in both cases. I decide
    to choose to use the space divided one.

    Signed-off-by: Andy Shevchenko
    Acked-by: Helge Deller
    Cc: Alexander Viro
    Cc: Joe Perches
    Cc: Tadeusz Struk
    Cc: Ingo Tuchscherer
    Cc: Catalin Marinas
    Cc: Vladimir Kondratiev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     

08 Sep, 2015

1 commit

  • Commit 3a9ad0b ("PCI: Add pci_bus_addr_t") unconditionally introduced usage of
    64-bit PCI bus addresses on all 64-bit platforms which broke PA-RISC.

    It turned out that due to enabling the 64-bit addresses, the PCI logic decided
    to use the GMMIO instead of the LMMIO region. This commit simply disables
    registering the GMMIO and thus we fall back to use the LMMIO region as before.

    Reverts commit 45ea2a5fed6dacb9bb0558d8b21eacc1c45d5bb4
    ("PCI: Don't use 64-bit bus addresses on PA-RISC")

    To: linux-parisc@vger.kernel.org
    Cc: linux-pci@vger.kernel.org
    Cc: Bjorn Helgaas
    Cc: Meelis Roos
    Cc: stable@vger.kernel.org # v3.19+
    Signed-off-by: Helge Deller

    Helge Deller