1. 23 10月, 2013 7 次提交
  2. 13 9月, 2013 1 次提交
  3. 12 9月, 2013 1 次提交
    • S
      tpm: convert tpm_tis driver to use dev_pm_ops from legacy pm_ops · a2fa3fb0
      Shuah Khan 提交于
      Convert drivers/char/tpm/tpm_tis.c to use dev_pm_ops instead of legacy
      pm_ops.  This patch depends on pnp driver bus ops change to invoke
      pnp_driver dev_pm_ops.
      Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
      Cc: Matthew Garrett <matthew.garrett@nebula.com>
      Cc: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
      Cc: Ashley Lai <ashley@ashleylai.com>
      Cc: Rajiv Andrade <mail@srajiv.net>
      Cc: Marcel Selhorst <tpmdd@selhorst.net>
      Cc: Sirrix AG <tpmdd@sirrix.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Peter Hüwe <PeterHuewe@gmx.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a2fa3fb0
  4. 05 9月, 2013 4 次提交
  5. 02 9月, 2013 1 次提交
  6. 31 8月, 2013 1 次提交
  7. 21 8月, 2013 1 次提交
    • O
      hwrng: omap - reorder OMAP TRNG driver code · a246968e
      Olof Johansson 提交于
      The newly added omap4 support in the driver was added without
      consideration for building older configs. When building omap1_defconfig,
      it resulted in:
      
      drivers/char/hw_random/omap-rng.c:190:12: warning: 'omap4_rng_init' defined but not used [-Wunused-function]
      drivers/char/hw_random/omap-rng.c:215:13: warning: 'omap4_rng_cleanup' defined but not used [-Wunused-function]
      drivers/char/hw_random/omap-rng.c:251:20: warning: 'omap4_rng_irq' defined but not used [-Wunused-function]
      
      Move the code around so it is grouped with its operations struct, which
      for the omap4 case means also under the #ifdef CONFIG_OF, where it needs
      to be.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Reviewed-by: NLokesh Vutla <lokeshvutla@ti.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      a246968e
  8. 14 8月, 2013 1 次提交
    • J
      hwrng: tx4939 - simplify use of devm_ioremap_resource · 9dc48034
      Julia Lawall 提交于
      Remove unneeded error handling on the result of a call to
      platform_get_resource when the value is passed to devm_ioremap_resource.
      
      Move the call to platform_get_resource adjacent to the call to
      devm_ioremap_resource to make the connection between them more clear.
      
      A simplified version of the semantic patch that makes this change is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression pdev,res,n,e,e1;
      expression ret != 0;
      identifier l;
      @@
      
      - res = platform_get_resource(pdev, IORESOURCE_MEM, n);
        ... when != res
      - if (res == NULL) { ... \(goto l;\|return ret;\) }
        ... when != res
      + res = platform_get_resource(pdev, IORESOURCE_MEM, n);
        e = devm_ioremap_resource(e1, res);
      // </smpl>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      9dc48034
  9. 09 8月, 2013 8 次提交
  10. 01 8月, 2013 2 次提交
  11. 30 7月, 2013 1 次提交
  12. 29 7月, 2013 8 次提交
    • A
      virtio: console: fix locking around send_sigio_to_port() · 314081f1
      Amit Shah 提交于
      send_sigio_to_port() checks the value of guest_connected, which we
      always modify under the inbuf_lock; make sure invocations of
      send_sigio_to_port() have take the inbuf_lock around the call.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      314081f1
    • A
      virtio: console: add locking in port unplug path · 5549fb25
      Amit Shah 提交于
      Port unplug can race with close() in port_fops_release().
      port_fops_release() already takes the necessary locks, ensure
      unplug_port() does that too.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      5549fb25
    • A
      virtio: console: add locks around buffer removal in port unplug path · c6017e79
      Amit Shah 提交于
      The removal functions act on the vqs, and the vq operations need to be
      locked.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      c6017e79
    • A
      virtio: console: return -ENODEV on all read operations after unplug · 96f97a83
      Amit Shah 提交于
      If a port gets unplugged while a user is blocked on read(), -ENODEV is
      returned.  However, subsequent read()s returned 0, indicating there's no
      host-side connection (but not indicating the device went away).
      
      This also happened when a port was unplugged and the user didn't have
      any blocking operation pending.  If the user didn't monitor the SIGIO
      signal, they won't have a chance to find out if the port went away.
      
      Fix by returning -ENODEV on all read()s after the port gets unplugged.
      write() already behaves this way.
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      96f97a83
    • A
      virtio: console: fix raising SIGIO after port unplug · 92d34538
      Amit Shah 提交于
      SIGIO should be sent when a port gets unplugged.  It should only be sent
      to prcesses that have the port opened, and have asked for SIGIO to be
      delivered.  We were clearing out guest_connected before calling
      send_sigio_to_port(), resulting in a sigio not getting sent to
      processes.
      
      Fix by setting guest_connected to false after invoking the sigio
      function.
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      92d34538
    • A
      virtio: console: clean up port data immediately at time of unplug · ea3768b4
      Amit Shah 提交于
      We used to keep the port's char device structs and the /sys entries
      around till the last reference to the port was dropped.  This is
      actually unnecessary, and resulted in buggy behaviour:
      
      1. Open port in guest
      2. Hot-unplug port
      3. Hot-plug a port with the same 'name' property as the unplugged one
      
      This resulted in hot-plug being unsuccessful, as a port with the same
      name already exists (even though it was unplugged).
      
      This behaviour resulted in a warning message like this one:
      
      -------------------8<---------------------------------------
      WARNING: at fs/sysfs/dir.c:512 sysfs_add_one+0xc9/0x130() (Not tainted)
      Hardware name: KVM
      sysfs: cannot create duplicate filename
      '/devices/pci0000:00/0000:00:04.0/virtio0/virtio-ports/vport0p1'
      
      Call Trace:
       [<ffffffff8106b607>] ? warn_slowpath_common+0x87/0xc0
       [<ffffffff8106b6f6>] ? warn_slowpath_fmt+0x46/0x50
       [<ffffffff811f2319>] ? sysfs_add_one+0xc9/0x130
       [<ffffffff811f23e8>] ? create_dir+0x68/0xb0
       [<ffffffff811f2469>] ? sysfs_create_dir+0x39/0x50
       [<ffffffff81273129>] ? kobject_add_internal+0xb9/0x260
       [<ffffffff812733d8>] ? kobject_add_varg+0x38/0x60
       [<ffffffff812734b4>] ? kobject_add+0x44/0x70
       [<ffffffff81349de4>] ? get_device_parent+0xf4/0x1d0
       [<ffffffff8134b389>] ? device_add+0xc9/0x650
      
      -------------------8<---------------------------------------
      
      Instead of relying on guest applications to release all references to
      the ports, we should go ahead and unregister the port from all the core
      layers.  Any open/read calls on the port will then just return errors,
      and an unplug/plug operation on the host will succeed as expected.
      
      This also caused buggy behaviour in case of the device removal (not just
      a port): when the device was removed (which means all ports on that
      device are removed automatically as well), the ports with active
      users would clean up only when the last references were dropped -- and
      it would be too late then to be referencing char device pointers,
      resulting in oopses:
      
      -------------------8<---------------------------------------
      PID: 6162   TASK: ffff8801147ad500  CPU: 0   COMMAND: "cat"
       #0 [ffff88011b9d5a90] machine_kexec at ffffffff8103232b
       #1 [ffff88011b9d5af0] crash_kexec at ffffffff810b9322
       #2 [ffff88011b9d5bc0] oops_end at ffffffff814f4a50
       #3 [ffff88011b9d5bf0] die at ffffffff8100f26b
       #4 [ffff88011b9d5c20] do_general_protection at ffffffff814f45e2
       #5 [ffff88011b9d5c50] general_protection at ffffffff814f3db5
          [exception RIP: strlen+2]
          RIP: ffffffff81272ae2  RSP: ffff88011b9d5d00  RFLAGS: 00010246
          RAX: 0000000000000000  RBX: ffff880118901c18  RCX: 0000000000000000
          RDX: ffff88011799982c  RSI: 00000000000000d0  RDI: 3a303030302f3030
          RBP: ffff88011b9d5d38   R8: 0000000000000006   R9: ffffffffa0134500
          R10: 0000000000001000  R11: 0000000000001000  R12: ffff880117a1cc10
          R13: 00000000000000d0  R14: 0000000000000017  R15: ffffffff81aff700
          ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
       #6 [ffff88011b9d5d00] kobject_get_path at ffffffff8126dc5d
       #7 [ffff88011b9d5d40] kobject_uevent_env at ffffffff8126e551
       #8 [ffff88011b9d5dd0] kobject_uevent at ffffffff8126e9eb
       #9 [ffff88011b9d5de0] device_del at ffffffff813440c7
      
      -------------------8<---------------------------------------
      
      So clean up when we have all the context, and all that's left to do when
      the references to the port have dropped is to free up the port struct
      itself.
      
      CC: <stable@vger.kernel.org>
      Reported-by: Nchayang <chayang@redhat.com>
      Reported-by: NYOGANANTH SUBRAMANIAN <anantyog@in.ibm.com>
      Reported-by: NFuXiangChun <xfu@redhat.com>
      Reported-by: NQunfang Zhang <qzhang@redhat.com>
      Reported-by: NSibiao Luo <sluo@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      ea3768b4
    • A
      virtio: console: fix race in port_fops_open() and port unplug · 671bdea2
      Amit Shah 提交于
      Between open() being called and processed, the port can be unplugged.
      Check if this happened, and bail out.
      
      A simple test script to reproduce this is:
      
      while true; do for i in $(seq 1 100); do echo $i > /dev/vport0p3; done; done;
      
      This opens and closes the port a lot of times; unplugging the port while
      this is happening triggers the bug.
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      671bdea2
    • A
      virtio: console: fix race with port unplug and open/close · 057b82be
      Amit Shah 提交于
      There's a window between find_port_by_devt() returning a port and us
      taking a kref on the port, where the port could get unplugged.  Fix it
      by taking the reference in find_port_by_devt() itself.
      
      Problem reported and analyzed by Mateusz Guzik.
      
      CC: <stable@vger.kernel.org>
      Reported-by: NMateusz Guzik <mguzik@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      057b82be
  13. 27 7月, 2013 1 次提交
  14. 26 7月, 2013 1 次提交
  15. 25 7月, 2013 2 次提交