11 Feb, 2015

9 commits


23 Jan, 2015

1 commit

  • This patch add a support for second version of the virtio-mmio device,
    which follows OASIS "Virtual I/O Device (VIRTIO) Version 1.0"
    specification.

    Main changes:

    1. The control register symbolic names use the new device/driver
    nomenclature rather than the old guest/host one.

    2. The driver detect the device version (version 1 is the pre-OASIS
    spec, version 2 is compatible with fist revision of the OASIS spec)
    and drives the device accordingly.

    3. New version uses direct addressing (64 bit address split into two
    low/high register) instead of the guest page size based one,
    and addresses each part of the queue (descriptors, available, used)
    separately.

    4. The device activity is now explicitly triggered by writing to the
    "queue ready" register.

    5. Whole 64 bit features are properly handled now (both ways).

    Signed-off-by: Pawel Moll
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Pawel Moll
     

21 Jan, 2015

28 commits

  • release function in modern driver is unused:
    it's a left-over from when each driver had
    to have its own release.

    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • If set, try legacy interface first, modern one if that fails. Useful to
    work around device/driver bugs, and for compatibility testing.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Useful for testing device virtio 1 compatibility.
    Based on patch by Rusty - couldn't resist putting
    that flying car joke in there!

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • The ABI *is* stable, and has been for a while now.
    Drop Kconfig warning saying that it's not guaranteed
    to work.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • This drivers -> this driver.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • makes code look a bit prettier.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Most of our code has
    struct foo {
    }

    Fix one instances where ring is inconsistent.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Most of our code has
    struct foo {
    }

    Fix two instances where blk is inconsistent.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Most of our code has
    struct foo {
    }

    Fix two instances where balloon is inconsistent.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Virtio 1.0 spec lists device config as optional.
    Set get/set callbacks to NULL. Drivers can check that
    and fail gracefully.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • We don't know the # of VQs that drivers are going to use so it's hard to
    predict how much memory we'll need to map. However, the relevant
    capability does give us an upper limit.
    If that's below a page, we can reduce the number of required
    mappings by mapping it all once ahead of the time.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • QEMU wants it, so why not? Trust, but verify.

    Signed-off-by: Rusty Russell
    Signed-off-by: Michael S. Tsirkin

    Rusty Russell
     
  • Lightly tested against qemu.

    One thing *not* implemented here is separate mappings
    for descriptor/avail/used rings. That's nice to have,
    will be done later after we have core support.

    This also exposes the PCI layout to userspace, and
    adds macros for PCI layout offsets:

    QEMU wants it, so why not? Trust, but verify.

    Signed-off-by: Rusty Russell
    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     
  • Based on patches by Michael S. Tsirkin , but I found it
    hard to follow so changed to use structures which are more
    self-documenting.

    Signed-off-by: Rusty Russell
    Signed-off-by: Michael S. Tsirkin

    Rusty Russell
     
  • Most of initialization is device-independent.
    Let's move it to common.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Device VQs were getting freed twice: once in every device's removal
    functions, and then again in virtio_pci_legacy_remove(). The ones in
    devices are called first, so drop the useless second call.

    Signed-off-by: Sasha Levin
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Sasha Levin
     
  • Virtio drivers should map the part of the range they need, not
    necessarily all of it.
    To this end, support mapping ranges within BAR on s390.
    Since multiple ranges can now be mapped within a BAR, we keep track of
    the number of mappings created, and only clear out the mapping for a BAR
    when this number reaches 0.

    Cc: Bjorn Helgaas
    Cc: linux-pci@vger.kernel.org
    Tested-by: Sebastian Ott
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Virtio drivers should map the part of the BAR they need, not necessarily
    all of it.

    Cc: Bjorn Helgaas
    Cc: linux-pci@vger.kernel.org
    Acked-by: Arnd Bergmann
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • pci-iomap.c was (apparently, mistakenly) reintroduced as part of
    commit 83c2dc15ce824450e7044b9f90cd529c25747ae0
    MN10300: Handle cacheable PCI regions in pci_iomap()
    probably as side-effect of forward-porting the patch
    from an old kernel.

    It's not really needed: the generic pci_iomap does the right thing here.

    The new file isn't compiled so it's safe to drop.

    Cc: Bjorn Helgaas
    Cc: linux-pci@vger.kernel.org
    Cc: trivial@kernel.org
    Cc: David Howells
    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Some devices might not implement config space access
    (e.g. remoteproc used not to - before 3.9).
    virtio/balloon needs config space access so make it
    fail gracefully if not there.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Some devices might not implement config space access
    (e.g. remoteproc used not to - before 3.9).
    virtio/scsi needs config space access so make it
    fail gracefully if not there.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Some devices might not implement config space access
    (e.g. remoteproc used not to - before 3.9).
    virtio/net needs config space access so make it
    fail gracefully if not there.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Some devices might not implement config space access
    (e.g. remoteproc used not to - before 3.9).
    virtio/console needs config space access so make it
    fail gracefully if not there.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Some devices might not implement config space access
    (e.g. remoteproc used not to - before 3.9).
    virtio/blk needs config space access so make it
    fail gracefully if not there.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Some devices might not implement config space access
    (e.g. remoteproc used not to - before 3.9).
    virtio/9p needs config space access so make it
    fail gracefully if not there.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • virtio_pci does not depend on virtio_config:
    let's not include it, users can pull it in as necessary.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Pull libata fixes from Tejun Heo:

    - Bartlomiej will be co-maintaining PATA portion of libata. git
    workflow will stay the same.

    - sata_sil24 wasn't happy with tag ordered submission. An option to
    restore the old tag allocation behavior is implemented for sil24.

    - a very old race condition in PIO host state machine which can trigger
    BUG fixed.

    - other driver-specific changes

    * 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    libata: prevent HSM state change race between ISR and PIO
    libata: allow sata_sil24 to opt-out of tag ordered submission
    ata: pata_at91: depend on !ARCH_MULTIPLATFORM
    ahci: Remove Device ID for Intel Sunrise Point PCH
    ahci: Use dev_info() to inform about the lack of Device Sleep support
    libata: Whitelist SSDs that are known to properly return zeroes after TRIM
    sata_dwc_460ex: fix resource leak on error path
    ata: add MAINTAINERS entry for libata PATA drivers
    libata: clean up MAINTAINERS entries
    libata: export ata_get_cmd_descript()
    ahci_xgene: Fix the DMA state machine lockup for the ATA_CMD_PACKET PIO mode command.
    ahci_xgene: Fix the endianess issue in APM X-Gene SoC AHCI SATA controller driver.

    Linus Torvalds
     
  • Pull workqueue fix from Tejun Heo:
    "The xfs folks have been running into weird and very rare lockups for
    some time now. I didn't think this could have been from workqueue
    side because no one else was reporting it. This time, Eric had a
    kdump which we looked into and it turned out this actually was a
    workqueue bug and the bug has been there since the beginning of
    concurrency managed workqueue.

    A worker pool ensures forward progress of the workqueues associated
    with it by always having at least one worker reserved from executing
    work items. When the pool is under contention, the idle one tries to
    create more workers for the pool and if that doesn't succeed quickly
    enough, it calls the rescuers to the pool.

    This logic had a subtle race condition in an early exit path. When a
    worker invokes this manager function, the function may return %false
    indicating that the caller may proceed to executing work items either
    because another worker is already performing the role or conditions
    have changed and the pool is no longer under contention.

    The latter part depended on the assumption that whether more workers
    are necessary or not remains stable while the pool is locked; however,
    pool->nr_running (concurrency count) may change asynchronously and it
    getting bumped from zero asynchronously could send off the last idle
    worker to execute work items.

    The race window is fairly narrow, and, even when it gets triggered,
    the pool deadlocks iff if all work items get blocked on pending work
    items of the pool, which is highly unlikely but can be triggered by
    xfs.

    The patch removes the race window by removing the early exit path,
    which doesn't server any purpose anymore anyway"

    * 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
    workqueue: fix subtle pool management issue which can stall whole worker_pool

    Linus Torvalds
     

20 Jan, 2015

2 commits

  • Pull pin control fixes from Linus Walleij:
    "Here is a (hopefully final) slew of pin control fixes for the v3.19
    series. The deadlock fix is kind of serious and tagged for stable,
    the rest is business as usual.

    - Fix two deadlocks around the pin control mutexes, a long-standing
    issue that manifest itself in plug/unplug of pin controllers.
    (Tagged for stable.)

    - Handle an error path with zero functions in the Qualcomm pin
    controller.

    - Drop a bogus second GPIO chip added in the Lantiq driver.

    - Fix sudden IRQ loss on Rockchip pin controllers.

    - Register the GIT tree in MAINTAINERS"

    * tag 'pinctrl-v3.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    pinctrl: MAINTAINERS: add git tree reference
    pinctrl: qcom: Don't iterate past end of function array
    pinctrl: lantiq: remove bogus of_gpio_chip_add
    pinctrl: Fix two deadlocks
    pinctrl: rockchip: Avoid losing interrupts when supporting both edges

    Linus Torvalds
     
  • Pull networking fixes from David Miller:

    1) Socket addresses returned in the error queue need to be fully
    initialized before being passed on to userspace, fix from Willem de
    Bruijn.

    2) Interrupt handling fixes to davinci_emac driver from Tony Lindgren.

    3) Fix races between receive packet steering and cpu hotplug, from Eric
    Dumazet.

    4) Allowing netlink sockets to subscribe to unknown multicast groups
    leads to crashes, don't allow it. From Johannes Berg.

    5) One to many socket races in SCTP fixed by Daniel Borkmann.

    6) Put in a guard against the mis-use of ipv6 atomic fragments, from
    Hagen Paul Pfeifer.

    7) Fix promisc mode and ethtool crashes in sh_eth driver, from Ben
    Hutchings.

    8) NULL deref and double kfree fix in sxgbe driver from Girish K.S and
    Byungho An.

    9) cfg80211 deadlock fix from Arik Nemtsov.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (36 commits)
    s2io: use snprintf() as a safety feature
    r8152: remove sram_read
    r8152: remove generic_ocp_read before writing
    bgmac: activate irqs only if there is nothing to poll
    bgmac: register napi before the device
    sh_eth: Fix ethtool operation crash when net device is down
    sh_eth: Fix promiscuous mode on chips without TSU
    ipv6: stop sending PTB packets for MTU < 1280
    net: sctp: fix race for one-to-many sockets in sendmsg's auto associate
    genetlink: synchronize socket closing and family removal
    genetlink: disallow subscribing to unknown mcast groups
    genetlink: document parallel_ops
    net: rps: fix cpu unplug
    net: davinci_emac: Add support for emac on dm816x
    net: davinci_emac: Fix ioremap for devices with MDIO within the EMAC address space
    net: davinci_emac: Fix incomplete code for getting the phy from device tree
    net: davinci_emac: Free clock after checking the frequency
    net: davinci_emac: Fix runtime pm calls for davinci_emac
    net: davinci_emac: Fix hangs with interrupts
    ip: zero sockaddr returned on error queue
    ...

    Linus Torvalds