1. 12 4月, 2016 26 次提交
  2. 09 4月, 2016 3 次提交
  3. 08 4月, 2016 11 次提交
    • Y
      gpio: pca953x: Use correct u16 value for register word write · 9b8e3ec3
      Yong Li 提交于
      The current implementation only uses the first byte in val,
      the second byte is always 0. Change it to use cpu_to_le16
      to write the two bytes into the register
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NYong Li <sdliyong@gmail.com>
      Reviewed-by: NPhil Reid <preid@electromag.com.au>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      9b8e3ec3
    • G
      gpiolib: Defer gpio device setup until after gpiolib initialization · 159f3cd9
      Guenter Roeck 提交于
      Since commit ff2b1359 ("gpio: make the gpiochip a real device"),
      attempts to add a gpio chip prior to gpiolib initialization cause
      the system to crash. This happens because gpio_bus_type has not been
      registered yet. Defer creating gpio devices until after gpiolib has
      been initialized to fix the problem.
      
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Fixes: ff2b1359 ("gpio: make the gpiochip a real device")
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      159f3cd9
    • G
      gpiolib: Do not use devm functions when registering gpio chip · 476e2fc5
      Guenter Roeck 提交于
      It is possible that a gpio chip is registered before the gpiolib
      initialization code has run. This means we can not use devm_ functions
      to allocate memory at that time. Do it the old fashioned way.
      
      Cc: Alexandre Courbot <gnurou@gmail.com>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      476e2fc5
    • R
      gpio: pxa: fix legacy non pinctrl aware builds · c4e5ffb6
      Robert Jarzmik 提交于
      In legacy pxa builds, ie. non device-tree and platform-data only builds,
      pinctrl is not yet available. As a consequence, the pinctrl gpio
      direction change function is a stub, returning always success.
      
      In the current state, the gpio driver direction function believes the
      pinctrl direction change was successful, and exits without actually
      changing the gpio direction.
      
      This patch changes the logic :
       - if the pinctrl direction function fails, gpio direction will report
         that failure
       - if the pinctrl direction function succeeds, gpio direction is changed
         by the gpio driver anyway.
         This is sub optimal in the pinctrl aware case, as the gpio direction
         will be changed twice: once by pinctrl function and another time by
         the gpio direction function.
      
      Yet it should be acceptable in this form, as this is functional for all
      pxa platforms (device-tree and platform-data), and moreover changing a
      gpio direction is very very seldom, usually in machine initialization,
      seldom in drivers probe, and an exception for ac97 reset bug.
      
      Fixes: a770d946 ("gpio: pxa: add pin control gpio direction and request")
      Reported-by: NGuenter Roeck <guenter@roeck-us.net>
      Tested-by: NGuenter Roeck <guenter@roeck-us.net>
      Signed-off-by: NRobert Jarzmik <robert.jarzmik@free.fr>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c4e5ffb6
    • D
      gpio / ACPI: ignore GpioInt() GPIOs when requesting GPIO_OUT_* · 25487533
      Dmitry Torokhov 提交于
      When firmware does not use _DSD properties that allow properly name GPIO
      resources, the kernel falls back on parsing _CRS resources, and will
      return entries described as GpioInt() as general purpose GPIOs even
      though they are meant to be used simply as interrupt sources for the
      device:
      
      Device (ETSA)
      {
      	Name (_HID, "ELAN0001")
      	...
      
      	Method(_CRS, 0x0, NotSerialized)
      	{
      		Name(BUF0,ResourceTemplate ()
      		{
      			I2CSerialBus(
      				0x10,                     /* SlaveAddress */
      				ControllerInitiated,      /* SlaveMode */
      				400000,                   /* ConnectionSpeed */
      				AddressingMode7Bit,       /* AddressingMode */
      				"\\_SB.I2C1",             /* ResourceSource */
      			)
      			GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,
      				 "\\_SB.GPSW") { BOARD_TOUCH_GPIO_INDEX }
      		} )
      		Return (BUF0)
      	}
      ...
      }
      
      This gives troubles with drivers such as Elan Touchscreen driver
      (elants_i2c) that uses devm_gpiod_get to look up "reset" GPIO line and
      decide whether the driver is responsible for powering up and resetting
      the device, or firmware is. In the above case the lookup succeeds, we
      map GPIO as output and later fail to request client->irq interrupt that
      is mapped to the same GPIO.
      
      Let's ignore resources described as GpioInt() while parsing _CRS when
      requesting output GPIOs (but allow them when requesting GPIOD_ASIS or
      GPIOD_IN as some drivers, such as i2c-hid, do request GPIO as input and
      then map it to interrupt with gpiod_to_irq).
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NDmitry Torokhov <dtor@chromium.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      25487533
    • D
      libnvdimm, pfn: fix nvdimm_namespace_add_poison() vs section alignment · a3901802
      Dan Williams 提交于
      When section alignment padding is in effect we need to shift / truncate
      the range that is queried for poison by the 'start_pad' or 'end_trunc'
      reservations.
      
      It's easiest if we just pass in an adjusted resource range rather than
      deriving it from the passed in namespace.  With the resource range
      resolution pushed out to the caller we can also push the
      namespace-to-region lookup to the caller and drop the implicit pmem-type
      assumption about the passed in namespace object.
      
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      a3901802
    • D
      libnvdimm, pfn: fix uuid validation · e5670563
      Dan Williams 提交于
      If we detect a namespace has a stale info block in the init path, we
      should overwrite with the latest configuration.  In fact, we already
      return -ENODEV when the parent uuid is invalid, the same should be done
      for the 'self' uuid.  Otherwise we can get into a condition where
      userspace is unable to reconfigure the pfn-device without directly /
      manually invalidating the info block.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      e5670563
    • D
      libnvdimm: fix smart data retrieval · 21129112
      Dan Williams 提交于
      It appears that smart data retrieval has been broken the since the
      initial implementation.  Fix the payload size to be 128-bytes per the
      specification.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      21129112
    • B
      Revert "ib_srpt: Convert to percpu_ida tag allocation" · 3c968887
      Bart Van Assche 提交于
      This reverts commit 0fd10721.
      
      That patch causes the ib_srpt driver to crash as soon as the first SCSI
      command is received:
      
        kernel BUG at drivers/infiniband/ulp/srpt/ib_srpt.c:1439!
        invalid opcode: 0000 [#1] SMP
        Workqueue: target_completion target_complete_ok_work [target_core_mod]
        RIP: srpt_queue_response+0x437/0x4a0 [ib_srpt]
        Call Trace:
          srpt_queue_data_in+0x9/0x10 [ib_srpt]
          target_complete_ok_work+0x152/0x2b0 [target_core_mod]
          process_one_work+0x197/0x480
          worker_thread+0x49/0x490
          kthread+0xea/0x100
          ret_from_fork+0x22/0x40
      
      Aside from the crash, the shortcomings of that patch are as follows:
      
       - It makes the ib_srpt driver use I/O contexts allocated by
         transport_alloc_session_tags() but it does not initialize these I/O
         contexts properly.  All the initializations performed by
         srpt_alloc_ioctx() are skipped.
      
       - It swaps the order of the send ioctx allocation and the transition to
         RTR mode which is wrong.
      
       - The amount of memory that is needed for I/O contexts is doubled.
      
       - srpt_rdma_ch.free_list is no longer used but is not removed.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3c968887
    • S
      PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs · 16669bef
      Strashko, Grygorii 提交于
      Now wakeirq stops working for device if wakeup option for
      this device will be reconfigured through sysfs, like:
      
      echo disabled > /sys/devices/platform/extcon_usb1/power/wakeup
      echo enabled > /sys/devices/platform/extcon_usb1/power/wakeup
      
      Once above set of commands is executed the device's wakeup_source
      opject will be recreated and dev->power.wakeup->wakeirq field will
      contain NULL. As result, device_wakeup_arm_wake_irqs() will not arm
      wakeirq for the affected device.
      
      Hece, lets try to fix it in the following way:
        check for dev->wakeirq field when device_wakeup_attach() is called
        and if !NULL re-attach wakeirq to the device
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      16669bef
    • L
      intel_idle: Add KBL support · 3ce093d4
      Len Brown 提交于
      KBL is similar to SKL
      Signed-off-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3ce093d4