1. 30 Jan, 2015 5 commits
    • Felipe Balbi's avatar
      mfd: tps65218: Make INT[12] and STATUS registers volatile · fc904760
      Felipe Balbi authored
      commit 773328da upstream.
      
      STATUS register can be modified by the HW, so we
      should bypass cache because of that.
      
      In the case of INT[12] registers, they are the ones
      that actually clear the IRQ source at the time they
      are read. If we rely on the cache for them, we will
      never be able to clear the interrupt, which will cause
      our IRQ line to be disabled due to IRQ throttling.
      
      Fixes: 44b4dc61 mfd: tps65218: Add driver for the TPS65218 PMIC
      Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fc904760
    • Jim Lin's avatar
      pinctrl: Fix two deadlocks · 515939f3
      Jim Lin authored
      commit db93facf upstream.
      
      This patch is to fix two deadlock cases.
      Deadlock 1:
      CPU #1
       pinctrl_register-> pinctrl_get ->
       create_pinctrl
       (Holding lock pinctrl_maps_mutex)
       -> get_pinctrl_dev_from_devname
       (Trying to acquire lock pinctrldev_list_mutex)
      CPU #0
       pinctrl_unregister
       (Holding lock pinctrldev_list_mutex)
       -> pinctrl_put ->> pinctrl_free ->
       pinctrl_dt_free_maps -> pinctrl_unregister_map
       (Trying to acquire lock pinctrl_maps_mutex)
      
      Simply to say
      CPU#1 is holding lock A and trying to acquire lock B,
      CPU#0 is holding lock B and trying to acquire lock A.
      
      Deadlock 2:
      CPU #3
       pinctrl_register-> pinctrl_get ->
       create_pinctrl
       (Holding lock pinctrl_maps_mutex)
       -> get_pinctrl_dev_from_devname
       (Trying to acquire lock pinctrldev_list_mutex)
      CPU #2
       pinctrl_unregister
       (Holding lock pctldev->mutex)
       -> pinctrl_put ->> pinctrl_free ->
       pinctrl_dt_free_maps -> pinctrl_unregister_map
       (Trying to acquire lock pinctrl_maps_mutex)
      CPU #0
       tegra_gpio_request
       (Holding lock pinctrldev_list_mutex)
       -> pinctrl_get_device_gpio_range
       (Trying to acquire lock pctldev->mutex)
      
      Simply to say
      CPU#3 is holding lock A and trying to acquire lock D,
      CPU#2 is holding lock B and trying to acquire lock A,
      CPU#0 is holding lock D and trying to acquire lock B.
      Signed-off-by: default avatarJim Lin <jilin@nvidia.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      515939f3
    • Stephen Boyd's avatar
      pinctrl: qcom: Don't iterate past end of function array · ce441cb4
      Stephen Boyd authored
      commit bcd53f85 upstream.
      
      Timur reports that this code crashes if nfunctions is 0. Fix the
      loop iteration to only consider valid elements of the functions
      array.
      Reported-by: default avatarTimur Tabi <timur@codeaurora.org>
      Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
      Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
      Cc: Ivan T. Ivanov <iivanov@mm-sol.com>
      Cc: Andy Gross <agross@codeaurora.org>
      Fixes: 32745581 "pinctrl: qcom: Add support for reset for apq8064"
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ce441cb4
    • Oliver Hartkopp's avatar
      can: m_can: tag current CAN FD controllers as non-ISO · b47d1db6
      Oliver Hartkopp authored
      commit 6cfda7fb upstream.
      
      During the CAN FD standardization process within the ISO it turned out that
      the failure detection capability has to be improved.
      
      The CAN in Automation organization (CiA) defined the already implemented CAN
      FD controllers as 'non-ISO' and the upcoming improved CAN FD controllers as
      'ISO' compliant. See at http://www.can-cia.com/index.php?id=1937
      
      Finally there will be three types of CAN FD controllers in the future:
      
      1. ISO compliant (fixed)
      2. non-ISO compliant (fixed, like the M_CAN IP v3.0.1 in m_can.c)
      3. ISO/non-ISO CAN FD controllers (switchable, like the PEAK USB FD)
      
      So the current M_CAN driver for the M_CAN IP v3.0.1 has to expose its non-ISO
      implementation by setting the CAN_CTRLMODE_FD_NON_ISO ctrlmode at startup.
      As this bit cannot be switched at configuration time CAN_CTRLMODE_FD_NON_ISO
      must not be set in ctrlmode_supported of the current M_CAN driver.
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b47d1db6
    • Oliver Hartkopp's avatar
      can: dev: fix crtlmode_supported check · 96bfa385
      Oliver Hartkopp authored
      commit 9b1087aa upstream.
      
      When changing flags in the CAN drivers ctrlmode the provided new content has to
      be checked whether the bits are allowed to be changed. The bits that are to be
      changed are given as a bitfield in cm->mask. Therefore checking against
      cm->flags is wrong as the content can hold any kind of values.
      
      The iproute2 tool sets the bits in cm->mask and cm->flags depending on the
      detected command line options. To be robust against bogus user space
      applications additionally sanitize the provided flags with the provided mask.
      
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      96bfa385
  2. 27 Jan, 2015 35 commits