1. 17 1月, 2015 2 次提交
  2. 20 10月, 2014 1 次提交
  3. 06 10月, 2014 1 次提交
  4. 30 7月, 2014 5 次提交
  5. 28 5月, 2014 1 次提交
    • L
      ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. · a238317c
      Lv Zheng 提交于
      ACPICA doesn't include protections around address space checking, Linux
      build tests always complain increased sparse warnings around ACPICA
      internal acpi_os_map/unmap_memory() invocations.  This patch tries to fix
      this issue permanently.
      
      There are 2 choices left for us to solve this issue:
       1. Add __iomem address space awareness into ACPICA.
       2. Remove sparse checker of __iomem from ACPICA source code.
      
      This patch chooses solution 2, because:
       1.  Most of the acpi_os_map/unmap_memory() invocations are used for ACPICA.
           table mappings, which in fact are not IO addresses.
       2.  The only IO addresses usage is for "system memory space" mapping code in:
            drivers/acpi/acpica/exregion.c
            drivers/acpi/acpica/evrgnini.c
            drivers/acpi/acpica/exregion.c
          The mapped address is accessed in the handler of "system memory space"
          - acpi_ex_system_memory_space_handler().  This function in fact can be
          changed to invoke acpi_os_read/write_memory() so that __iomem can
          always be type-casted in the OSL layer.
      
      According to the above investigation, we drew the following conclusion:
      It is not a good idea to introduce __iomem address space awareness into
      ACPICA mostly in order to protect non-IO addresses.
      
      We can simply remove __iomem for acpi_os_map/unmap_memory() to remove
      __iomem checker for ACPICA code. Then we need to enforce external usages
      to invoke other APIs that are aware of __iomem address space.
      The external usages are:
       drivers/acpi/apei/einj.c
       drivers/acpi/acpi_extlog.c
       drivers/char/tpm/tpm_acpi.c
       drivers/acpi/nvs.c
      
      This patch thus performs cleanups in this way:
       1. Add acpi_os_map/unmap_iomem() to be invoked by non-ACPICA code.
       2. Remove __iomem from acpi_os_map/unmap_memory().
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a238317c
  6. 12 5月, 2014 1 次提交
    • R
      ACPI / TPM: Fix resume regression on Chromebooks · f7595464
      Rafael J. Wysocki 提交于
      Chromebooks (at least Acer C720 and Pixel) implement an ACPI object
      for TPM, but don't implement the _DSM method to support PPI.  As
      a result, the TPM driver fails to load on those machines after
      commit 1569a4c4 (ACPI / TPM: detect PPI features by checking
      availability of _DSM functions) which causes them to fail to
      resume from system suspend, becuase they require the TPM hardware
      to be put into the right state during resume and the TPM driver
      is necessary for that.
      
      Fix the problem by making tpm_add_ppi() return 0 when tpm_ppi_handle
      is still NULL after walking the ACPI namespace in search for the PPI
      _DSM, which allows the TPM driver to load and operate the hardware
      (during system resume in particular), but avoid creating the PPI
      sysfs group in that case.
      
      This change is based on a prototype patch from Jiang Liu.
      
      Fixes: 1569a4c4 (ACPI / TPM: detect PPI features by checking availability of _DSM functions)
      References: https://bugzilla.kernel.org/show_bug.cgi?id=74021Reported-by: NJames Duley <jagduley@gmail.com>
      Reported-by: NPhillip Dixon <phil@dixon.gen.nz>
      Tested-by: NBrandon Casey <drafnel@gmail.com>
      Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f7595464
  7. 08 4月, 2014 1 次提交
  8. 08 2月, 2014 1 次提交
    • P
      drivers/char: delete non-required instances of include <linux/init.h> · 4c020b03
      Paul Gortmaker 提交于
      None of these files are actually using any __init type directives
      and hence don't need to include <linux/init.h>.  Most are just a
      left over from __devinit and __cpuinit removal, or simply due to
      code getting copied from one driver to the next.
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Peter Huewe <peterhuewe@gmx.de>
      Cc: Ashley Lai <ashley@ashleylai.com>
      Cc: Marcel Selhorst <tpmdd@selhorst.net>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c020b03
  9. 06 1月, 2014 14 次提交
  10. 05 1月, 2014 4 次提交
  11. 04 1月, 2014 1 次提交
    • K
      xen/pvhvm: If xen_platform_pci=0 is set don't blow up (v4). · 51c71a3b
      Konrad Rzeszutek Wilk 提交于
      The user has the option of disabling the platform driver:
      00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
      
      which is used to unplug the emulated drivers (IDE, Realtek 8169, etc)
      and allow the PV drivers to take over. If the user wishes
      to disable that they can set:
      
        xen_platform_pci=0
        (in the guest config file)
      
      or
        xen_emul_unplug=never
        (on the Linux command line)
      
      except it does not work properly. The PV drivers still try to
      load and since the Xen platform driver is not run - and it
      has not initialized the grant tables, most of the PV drivers
      stumble upon:
      
      input: Xen Virtual Keyboard as /devices/virtual/input/input5
      input: Xen Virtual Pointer as /devices/virtual/input/input6M
      ------------[ cut here ]------------
      kernel BUG at /home/konrad/ssd/konrad/linux/drivers/xen/grant-table.c:1206!
      invalid opcode: 0000 [#1] SMP
      Modules linked in: xen_kbdfront(+) xenfs xen_privcmd
      CPU: 6 PID: 1389 Comm: modprobe Not tainted 3.13.0-rc1upstream-00021-ga6c892b-dirty #1
      Hardware name: Xen HVM domU, BIOS 4.4-unstable 11/26/2013
      RIP: 0010:[<ffffffff813ddc40>]  [<ffffffff813ddc40>] get_free_entries+0x2e0/0x300
      Call Trace:
       [<ffffffff8150d9a3>] ? evdev_connect+0x1e3/0x240
       [<ffffffff813ddd0e>] gnttab_grant_foreign_access+0x2e/0x70
       [<ffffffffa0010081>] xenkbd_connect_backend+0x41/0x290 [xen_kbdfront]
       [<ffffffffa0010a12>] xenkbd_probe+0x2f2/0x324 [xen_kbdfront]
       [<ffffffff813e5757>] xenbus_dev_probe+0x77/0x130
       [<ffffffff813e7217>] xenbus_frontend_dev_probe+0x47/0x50
       [<ffffffff8145e9a9>] driver_probe_device+0x89/0x230
       [<ffffffff8145ebeb>] __driver_attach+0x9b/0xa0
       [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
       [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
       [<ffffffff8145cf1c>] bus_for_each_dev+0x8c/0xb0
       [<ffffffff8145e7d9>] driver_attach+0x19/0x20
       [<ffffffff8145e260>] bus_add_driver+0x1a0/0x220
       [<ffffffff8145f1ff>] driver_register+0x5f/0xf0
       [<ffffffff813e55c5>] xenbus_register_driver_common+0x15/0x20
       [<ffffffff813e76b3>] xenbus_register_frontend+0x23/0x40
       [<ffffffffa0015000>] ? 0xffffffffa0014fff
       [<ffffffffa001502b>] xenkbd_init+0x2b/0x1000 [xen_kbdfront]
       [<ffffffff81002049>] do_one_initcall+0x49/0x170
      
      .. snip..
      
      which is hardly nice. This patch fixes this by having each
      PV driver check for:
       - if running in PV, then it is fine to execute (as that is their
         native environment).
       - if running in HVM, check if user wanted 'xen_emul_unplug=never',
         in which case bail out and don't load any PV drivers.
       - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
         does not exist, then bail out and not load PV drivers.
       - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=ide-disks',
         then bail out for all PV devices _except_ the block one.
         Ditto for the network one ('nics').
       - (v2) if running in HVM, and if the user wanted 'xen_emul_unplug=unnecessary'
         then load block PV driver, and also setup the legacy IDE paths.
         In (v3) make it actually load PV drivers.
      
      Reported-by: Sander Eikelenboom <linux@eikelenboom.it
      Reported-by: NAnthony PERARD <anthony.perard@citrix.com>
      Reported-and-Tested-by: NFabio Fantoni <fabio.fantoni@m2r.biz>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      [v2: Add extra logic to handle the myrid ways 'xen_emul_unplug'
      can be used per Ian and Stefano suggestion]
      [v3: Make the unnecessary case work properly]
      [v4: s/disks/ide-disks/ spotted by Fabio]
      Reviewed-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> [for PCI parts]
      CC: stable@vger.kernel.org
      51c71a3b
  12. 07 12月, 2013 1 次提交
    • L
      ACPI: Clean up inclusions of ACPI header files · 8b48463f
      Lv Zheng 提交于
      Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
      <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
      inclusions and remove some inclusions of those files that aren't
      necessary.
      
      First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
      should not be included directly from any files that are built for
      CONFIG_ACPI unset, because that generally leads to build warnings about
      undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
      <linux/acpi.h> includes those files and for CONFIG_ACPI unset it
      provides stub ACPI symbols to be used in that case.
      
      Second, there are ordering dependencies between those files that always
      have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
      prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
      latter depends on are always there.  And <acpi/acpi.h> which provides
      basic ACPICA type declarations should always be included prior to any other
      ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
      <linux/acpi.h> as appropriate.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff)
      Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8b48463f
  13. 23 10月, 2013 7 次提交
    • P
      tpm: use tabs instead of whitespaces in Kconfig · 4ef4c943
      Peter Huewe 提交于
      just like the other entries
      Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
      4ef4c943
    • P
      tpm: Fix module name description in Kconfig for tpm_i2c_infineon · b3f2436a
      Peter Huewe 提交于
      This patch changes the displayed module name from
      tpm_tis_i2c_infineon to its actual name tpm_i2c_infineon.
      Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
      b3f2436a
    • J
      tpm: Add support for Atmel I2C TPMs · a2871c62
      Jason Gunthorpe 提交于
      This is based on the work of Teddy Reed <teddy@prosauce.org> published
      on GitHub:
       https://github.com/theopolis/tpm-i2c-atmel.git
       34894b988b67e0ae55088d6388e77b0dbf10c07d
      
      That driver was never merged, I have taken it as a starting port,
      forward ported, tested and revised the driver:
       - Make it broadly textually similar to the Infineon and Nuvoton I2C
         driver
       - Place everything in a format suitable for mainline inclusion
       - Use high level I2C functions i2c_master_send and
         i2c_master_recv for data xfer
       - Use the timeout system from the core code, by faking out a status
         register
       - Only I2C transfer the number of bytes in the reply, not a fixed
         message size.
       - checkpatch cleanups
       - Testing on ARM Kirkwood, with this device tree, using a
         AT97SC3204T-X1A180
              tpm@29 {
                      compatible = "atmel,at97sc3204t";
                      reg = <0x29>;
              };
      Signed-off-by: NTeddy Reed <teddy@prosauce.org>
      [jgg: revised and tested]
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      [phuewe: minor whitespace changes]
      Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
      a2871c62
    • J
      tpm: Add support for the Nuvoton NPCT501 I2C TPM · 4c336e4b
      Jason Gunthorpe 提交于
      This chip is/was also branded as a Winbond WPCT301.
      
      Originally written by Dan Morav <dmorav@nuvoton.com> and posted to LKML:
      https://lkml.org/lkml/2011/9/7/206
      
      The original posting was not merged, I have taken it as a
      starting point, forward ported, tested and revised the driver:
       - Rework interrupt handling to work properly with level triggered
         interrupts. The old version just locked up.
       - Synchronize various items with Peter Huewe's Infineon driver:
          * Add durations/timeouts sysfs calls
          * Remove I2C device auto-detection
          * Don't fiddle with chip->release
          * Call tpm_dev_vendor_release in the probe error path
          * Use MODULE_DEVICE_TABLE for the I2C ids
          * Provide OF compatible strings for DT support
          * Use SIMPLE_DEV_PM_OPS
          * Use module_i2c_driver
       - checkpatch cleanups
       - Testing on ARM Kirkwood with GPIO interrupts, with this device tree:
      	tpm@57 {
                      compatible = "nuvoton,npct501";
                      reg = <0x57>;
                      interrupt-parent = <&gpio1>;
                      interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
              };
      Signed-off-by: NDan Morav <dmorav@nuvoton.com>
      [jgg: revised and tested]
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      [phuewe: minor whitespace changes, fixed module name in kconfig]
      Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
      4c336e4b
    • J
      tpm: Merge the tpm-bios module with tpm.o · 187eea0c
      Jason Gunthorpe 提交于
      Now that we can have multiple .c files in the tpm module there is
      no reason for tpm-bios.
      
      tpm-bios exported several functions: tpm_bios_log_setup,
      tpm_bios_log_teardown, tpm_add_ppi, and tpm_remove_ppi.
      
      They are only used by tpm, and if tpm-bios is built then
      tpm will unconditionally require them. Further, tpm-bios does
      nothing on its own, it has no module_init function.
      
      Thus we remove the exports and merge the modules to simplify things.
      
      The Makefile conditions are changed slightly to match the code,
      tpm_ppi is always required if CONFIG_ACPI is set.
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      187eea0c
    • J
      tpm: Rename tpm.c to tpm-interface.c · 9deb0eb7
      Jason Gunthorpe 提交于
      This is preparation for making the tpm module multi-file. kbuild does
      not like having a .c file with the same name as a module. We wish to
      keep the tpm module name so that userspace doesn't see this change.
      
      tpm-interface.c is chosen because the next several commits in the series
      migrate items into tpm-sysfs.c, tpm-dev.c and tpm-class.c. All that will
      be left is tpm command processing and interfacing code.
      Signed-off-by: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      9deb0eb7
    • P
      tpm: cleanup checkpatch warnings · 0a418269
      Peter Huewe 提交于
      before we rename the file it might be a good idea to cleanup the long
      persisting checkpatch warnings.
      Since everything is really trivial, splitting the patch up would only
      result in noise.
      
      For the interested reader - here the checkpatch warnings:
      (regrouped for easer readability)
      
      ERROR: trailing whitespace
      + * Specifications at www.trustedcomputinggroup.org^I $
      + * $
      +^I/* $
      +^I   parameters (RSA 12->bytes: keybit, #primes, expbit)  $
      
      WARNING: unnecessary whitespace before a quoted newline
      +			"invalid count value %x %zx \n", count, bufsiz);
      
      ERROR: do not use assignment in if condition
      +	if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) {
      
      ERROR: space required after that ',' (ctx:VxV)
      +	len = tpm_transmit(chip,(u8 *) cmd, len);
       	                       ^
      
      ERROR: "foo * bar" should be "foo *bar"
      +ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
      +ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
      +ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
      +ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
      +ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
      +ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
      +ssize_t tpm_show_temp_deactivated(struct device * dev,
      +				struct device_attribute * attr, char *buf)
      
      WARNING: please, no space before tabs
      + * @chip_num: ^Itpm idx # or ANY$
      + * @res_buf: ^ITPM_PCR value$
      + * ^I^Isize of res_buf is 20 bytes (or NULL if you don't care)$
      + * @chip_num: ^Itpm idx # or AN&$
      + * @hash: ^Ihash value used to extend pcr value$
      
      ERROR: code indent should use tabs where possible
      +^I                                     TPM_ORD_CONTINUE_SELFTEST);$
      
      WARNING: line over 80 characters
      +static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask, bool check_cancel,
      
      ERROR: trailing whitespace
      + * Called from tpm_<specific>.c probe function only for devices $
      
      total: 16 errors, 7 warnings, 1554 lines checked
      Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
      0a418269