1. 23 Mar, 2015 16 commits
    • Takashi Iwai's avatar
      ALSA: hda - Use regmap for command verb caches, too · a551d914
      Takashi Iwai authored
      Like the previous patches, this patch converts also to the regmap, at
      this time, the cached verb writes are the target.  But this conversion
      needs a bit more caution than before.
      
      - In the old code, we just record any verbs as is, and restore them at
        resume.  For the regmap scheme, this doesn't work, since a few verbs
        like AMP or DIGI_CONVERT are asymmetrical.  Such verbs are converted
        either to the dedicated function (snd_hda_regmap_xxx_amp()) or
        changed to the unified verb.
      
      - Some verbs have to be declared as vendor-specific ones before
        accessing via regmap.
      
      Also, the minor optimization with codec->cached_write flag is dropped
      in a few places, as this would confuse the operation.  Further
      optimizations will be brought in the later patches, if any.
      
      This conversion ends up with a drop of significant amount of codes,
      mostly the helper codes that are no longer used.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      a551d914
    • Takashi Iwai's avatar
      ALSA: hda - Allow driver to add vendor-specific verbs for regmap · 5e56bcea
      Takashi Iwai authored
      Codecs may have own vendor-specific verbs, and we need to allow each
      driver to give such verbs for cached accesses.  Here a verb can be put
      into a single array and looked through it at readable and writeable
      callbacks.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      5e56bcea
    • Takashi Iwai's avatar
      ALSA: hda - Use regmap for parameter caches, too · faa75f8a
      Takashi Iwai authored
      The amp hash table was used for recording the cached reads of some
      capability values like pin caps or amp caps.  Now all these are moved
      to regmap as well.
      
      One addition to the regmap helper is codec->caps_overwriting flag.
      This is set in snd_hdac_override_parm(), and the regmap helper accepts
      any register while this flag is set, so that it can overwrite even the
      read-only verb like AC_VERB_PARAMETERS.  The flag is cleared
      immediately in snd_hdac_override_parm(), as it's a once-off flag.
      
      Along with these changes, the no longer needed amp hash and relevant
      fields are removed from hda_codec struct now.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      faa75f8a
    • Takashi Iwai's avatar
      ALSA: hda - Use regmap for amp accesses · eeecd9d1
      Takashi Iwai authored
      This patch converts the amp access functions to the regmap helpers.
      The amp values were formerly cached in the own hash table.  Now it's
      dropped by the regmap's cache.
      
      The only tricky conversion is snd_hda_codec_amp_init().  This function
      shouldn't do anything if the amp was already initialized.  For
      achieving this behavior, a value is read once at first temporarily in
      the cache-only mode.  Only if it returns an error,  i.e. the item
      still doesn't exist in the cache, it proceeds to the update.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      eeecd9d1
    • Takashi Iwai's avatar
      ALSA: hda - Implement uncached version of parameter reads · 9ba17b4d
      Takashi Iwai authored
      Sometimes we need the uncached reads, e.g. for refreshing the tree.
      This patch provides the helper function for that and uses it for
      refreshing widgets, reading subtrees and the whole proc reads.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      9ba17b4d
    • Takashi Iwai's avatar
      ALSA: hda - Use regmap for codec parameter reads · 01ed3c06
      Takashi Iwai authored
      Let's start converting the access functions to regmap.
      The first one is the simplest, just converting the codec parameter
      read helper function snd_hda_param_read().
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      01ed3c06
    • Takashi Iwai's avatar
      ALSA: hda - Add regmap support · 4d75faa0
      Takashi Iwai authored
      This patch adds an infrastructure to support regmap-based verb
      accesses.  Because o the asymmetric nature of HD-audio verbs,
      especially the amp verbs, we need to translate the verbs as a sort of
      pseudo registers to be mapped uniquely in regmap.
      
      In this patch, a pseudo register is built from the NID, the
      AC_VERB_GET_* and 8bit parameters, i.e. almost in the form to be sent
      to HD-audio bus but without codec address field.  OTOH, for writing,
      the same pseudo register is translated to AC_VERB_SET_* automatically.
      The AC_VERB_SET_AMP_* verb is re-encoded from the corresponding
      AC_VERB_GET_AMP_* verb and parameter at writing.
      
      Some verbs has a single command for read but multiple for writes.  A
      write for such a verb is split automatically to multiple verbs.
      
      The patch provides also a few handy helper functions.  They are
      designed to be accessible even without regmap.  When no regmap is set
      up (e.g. before the codec device instantiation), the direct hardware
      access is used.  Also, it tries to avoid the unnecessary power-up.
      The power up/down sequence is performed only on demand.
      
      The codec driver needs to call snd_hdac_regmap_exit() and
      snd_hdac_regmap_exit() at probe and remove if it wants the regmap
      access.
      
      There is one flag added to hdac_device.  When the flag lazy_cache is
      set, regmap helper ignores a write for a suspended device and returns
      as if it was actually written.  It reduces the hardware access pretty
      much, e.g. when adjusting the mixer volume while in idle.  This
      assumes that the driver will sync the cache later at resume properly,
      so use it carefully.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      4d75faa0
    • Takashi Iwai's avatar
      ALSA: hda - Move generic array helpers to core lib · 71fc4c7e
      Takashi Iwai authored
      This will be used by the regmap support.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      71fc4c7e
    • Takashi Iwai's avatar
      ALSA: hda - Re-add tracepoints to HD-audio core driver · e311782a
      Takashi Iwai authored
      Now let's take the basic tracepoints back to the HD-audio driver.
      The three bus tracepoints, hda_send_cmd, hda_get_response and
      hda_unsol_event are revived but in a slightly different form.
      Since we don't assign the card number there, print the bus device name
      instead.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e311782a
    • Takashi Iwai's avatar
      ALSA: hda - Fix possible runtime PM refcount unbalance · c4c2533f
      Takashi Iwai authored
      When the driver is unloaded before the codec is bound, it still keeps
      the runtime PM refcount up, and results in the unbalance.  This patch
      covers these cases by introducing a flag indicating the runtime PM
      initialization and handling the codec registration procedure more
      properly.  It also fixes the missing input beep device as a gratis,
      too.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      c4c2533f
    • Takashi Iwai's avatar
      ALSA: hda - Support indirect execution of verbs · 05852448
      Takashi Iwai authored
      Add an overriding exec_verb op to struct hdac_device so that the call
      via snd_hdac_exec_verb() can switch to a different route depending on
      the setup.  The codec driver sets this field so that it can handle the
      errors or applying quirks appropriately.  Furthermore, this mechanism
      will be used for smooth transition for the regmap support in later
      patches.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      05852448
    • Takashi Iwai's avatar
      ALSA: hda - Add widget sysfs tree · 3256be65
      Takashi Iwai authored
      This patch changes the sysfs files assigned to the codec device on the
      bus which were formerly identical with hwdep sysfs files.  Now it
      shows only a few core parameter, vendor_id, subsystem_id, revision_id,
      afg, mfg, vendor_name and chip_name.
      
      In addition, now a widget tree is added to the bus device sysfs
      directory for showing the widget topology and attributes.  It's just a
      flat tree consisting of subdirectories named as the widget NID
      including various attributes like widget capability bits.  The AFG
      (usually NID 0x01) is always found there, and it contains always
      amp_in_caps, amp_out_caps and power_caps files.  Each of these
      attributes show a single value.  The rest are the widget nodes
      belonging to that AFG.  Note that the child node might not start from
      0x02 but from another value like 0x0a.
      
      Each child node may contain caps, pin_caps, amp_in_caps, amp_out_caps,
      power_caps and connections files.  The caps (representing the widget
      capability bits) always contain a value.  The rest may contain
      value(s) if the attribute exists on the node.  Only connections file
      show multiple values while other attributes have zero or one single
      value.
      
      An example of ls -R output is like below:
      % ls -R /sys/bus/hdaudio/devices/hdaudioC0D0/
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/:
      01/  04/  07/  0a/  0d/  10/  13/  16/  19/  1c/  1f/  22/
      02/  05/  08/  0b/  0e/  11/  14/  17/  1a/  1d/  20/  23/
      03/  06/  09/  0c/  0f/  12/  15/  18/  1b/  1e/  21/
      
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/01:
      amp_in_caps  amp_out_caps  power_caps
      
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/02:
      amp_in_caps  amp_out_caps  caps  connections  pin_caps  pin_cfg
      power_caps
      
      /sys/bus/hdaudio/devices/hdaudioC0D0/widgets/03:
      .....
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      3256be65
    • Takashi Iwai's avatar
      ALSA: hda - Move a part of hda_codec stuff into hdac_device · 7639a06c
      Takashi Iwai authored
      Now some codes and functionalities of hda_codec struct are moved to
      hdac_device struct.  A few basic attributes like the codec address,
      vendor ID number, FG numbers, etc are moved to hdac_device, and they
      are accessed like codec->core.addr.  The basic verb exec functions are
      moved, too.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7639a06c
    • Takashi Iwai's avatar
      ALSA: hda - Move some codes up to hdac_bus struct · d068ebc2
      Takashi Iwai authored
      A few basic codes for communicating over HD-audio bus are moved to
      struct hdac_bus now.  It has only command and get_response ops in
      addition to the unsolicited event handling.
      
      Note that the codec-side tracing support is disabled temporarily
      during this transition due to the code shuffling.  It will be
      re-enabled later once when all pieces are settled down.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d068ebc2
    • Takashi Iwai's avatar
      ALSA: hda - Make snd_hda_bus_type public · e3d280fc
      Takashi Iwai authored
      Define the common hd-audio driver and device types to bind over
      snd_hda_bus_type publicly.  This allows to implement other type of
      device and driver code over hd-audio bus.
      
      Now both struct hda_codec and struct hda_codec_driver inherit these
      new struct hdac_device and struct hdac_driver, respectively.
      
      The bus registration is done in subsys_initcall() to assure it
      before any other driver registrations.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      e3d280fc
    • Takashi Iwai's avatar
      Merge branch 'for-next' into topic/hda-core · 3372dbdd
      Takashi Iwai authored
      3372dbdd
  2. 22 Mar, 2015 7 commits
  3. 21 Mar, 2015 11 commits
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma · f8975224
      Linus Torvalds authored
      Pull slave dmaengine fixes from Vinod Koul:
       "Four fixes for dw, pl08x, imx-sdma and at_hdmac driver.  Nothing
        unusual here, simple fixes to these drivers"
      
      * 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
        dmaengine: pl08x: Define capabilities for generic capabilities reporting
        dmaengine: dw: append MODULE_ALIAS for platform driver
        dmaengine: imx-sdma: switch to dynamic context mode after script loaded
        dmaengine: at_hdmac: Fix calculation of the residual bytes
      f8975224
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 3d7a6db5
      Linus Torvalds authored
      Pull power management and ACPI fixes from Rafael Wysocki:
       "These are fixes for recent regressions (PCI/ACPI resources and at91
        RTC locking), a stable-candidate powercap RAPL driver fix and two ARM
        cpuidle fixes (one stable-candidate too).
      
        Specifics:
      
         - Revert a recent PCI commit related to IRQ resources management that
           introduced a regression for drivers attempting to bind to devices
           whose previous drivers did not balance pci_enable_device() and
           pci_disable_device() as expected (Rafael J Wysocki).
      
         - Fix a deadlock in at91_rtc_interrupt() introduced by a typo in a
           recent commit related to wakeup interrupt handling (Dan Carpenter).
      
         - Allow the power capping RAPL (Running-Average Power Limit) driver
           to use different energy units for domains within one CPU package
           which is necessary to handle Intel Haswell EP processors correctly
           (Jacob Pan).
      
         - Improve the cpuidle mvebu driver's handling of Armada XP SoCs by
           updating the target residency and exit latency numbers for those
           chips (Sebastien Rannou).
      
         - Prevent the cpuidle mvebu driver from calling cpu_pm_enter() twice
           in a row before cpu_pm_exit() is called on the same CPU which
           breaks the core's assumptions regarding the usage of those
           functions (Gregory Clement)"
      
      * tag 'pm+acpi-4.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "x86/PCI: Refine the way to release PCI IRQ resources"
        rtc: at91rm9200: double locking bug in at91_rtc_interrupt()
        powercap / RAPL: handle domains with different energy units
        cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs
        cpuidle: mvebu: Fix the CPU PM notifier usage
      3d7a6db5
    • Linus Torvalds's avatar
      Merge git://people.freedesktop.org/~airlied/linux · 97448d5b
      Linus Torvalds authored
      Pull drm updates from Dave Airlie:
       "A bunch of fixes across drivers:
      
        radeon:
           disable two ended allocation for now, it breaks some stuff
      
        amdkfd:
           misc fixes
      
        nouveau:
           fix irq loop problem, add basic support for GM206 (new hw)
      
        i915:
           fix some WARNs people were seeing
      
        exynos:
           fix some iommu interactions causing boot failures"
      
      * git://people.freedesktop.org/~airlied/linux:
        drm/radeon: drop ttm two ended allocation
        drm/exynos: fix the initialization order in FIMD
        drm/exynos: fix typo config name correctly.
        drm/exynos: Check for NULL dereference of crtc
        drm/exynos: IS_ERR() vs NULL bug
        drm/exynos: remove unused files
        drm/i915: Make sure the primary plane is enabled before reading out the fb state
        drm/nouveau/bios: fix i2c table parsing for dcb 4.1
        drm/nouveau/device/gm100: Basic GM206 bring up (as copy of GM204)
        drm/nouveau/device: post write to NV_PMC_BOOT_1 when flipping endian switch
        drm/nouveau/gr/gf100: fix some accidental or'ing of buffer addresses
        drm/nouveau/fifo/nv04: remove the loop from the interrupt handler
        drm/radeon: Changing number of compute pipe lines
        drm/amdkfd: Fix SDMA queue init. in non-HWS mode
        drm/amdkfd: destroy mqd when destroying kernel queue
        drm/i915: Ensure plane->state->fb stays in sync with plane->fb
      97448d5b
    • Linus Torvalds's avatar
      Merge tag 'devicetree-fixes-for-4.0-part2' of... · bb8ef2fb
      Linus Torvalds authored
      Merge tag 'devicetree-fixes-for-4.0-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
      
      Pull more DeviceTree fixes vfom Rob Herring:
      
       - revert setting stdout-path as preferred console.  This caused
         regressions in PowerMACs and other systems.
      
       - yet another fix for stdout-path option parsing.
      
       - fix error path handling in of_irq_parse_one
      
      * tag 'devicetree-fixes-for-4.0-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        Revert "of: Fix premature bootconsole disable with 'stdout-path'"
        of: handle both '/' and ':' in path strings
        of: unittest: Add option string test case with longer path
        of/irq: Fix of_irq_parse_one() returned error codes
      bb8ef2fb
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · e477f3e0
      Linus Torvalds authored
      Pull SCSI target fixes from Nicholas Bellinger:
       "Here are current target-pending fixes for v4.0-rc5 code that have made
        their way into the queue over the last weeks.
      
        The fixes this round include:
      
         - Fix long-standing iser-target logout bug related to early
           conn_logout_comp completion, resulting in iscsi_conn use-after-tree
           OOpsen.  (Sagi + nab)
      
         - Fix long-standing tcm_fc bug in ft_invl_hw_context() failure
           handing for DDP hw offload.  (DanC)
      
         - Fix incorrect use of unprotected __transport_register_session() in
           tcm_qla2xxx + other single local se_node_acl fabrics.  (Bart)
      
         - Fix reference leak in target_submit_cmd() -> target_get_sess_cmd()
           for ack_kref=1 failure path.  (Bart)
      
         - Fix pSCSI backend ->get_device_type() statistics OOPs with
           un-configured device.  (Olaf + nab)
      
         - Fix virtual LUN=0 target_configure_device failure OOPs at modprobe
           time.  (Claudio + nab)
      
         - Fix FUA write false positive failure regression in v4.0-rc1 code.
           (Christophe Vu-Brugier + HCH)"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
        target: do not reject FUA CDBs when write cache is enabled but emulate_write_cache is 0
        target: Fix virtual LUN=0 target_configure_device failure OOPs
        target/pscsi: Fix NULL pointer dereference in get_device_type
        tcm_fc: missing curly braces in ft_invl_hw_context()
        target: Fix reference leak in target_get_sess_cmd() error path
        loop/usb/vhost-scsi/xen-scsiback: Fix use of __transport_register_session
        tcm_qla2xxx: Fix incorrect use of __transport_register_session
        iscsi-target: Avoid early conn_logout_comp for iser connections
        Revert "iscsi-target: Avoid IN_LOGOUT failure case for iser-target"
        target: Disallow changing of WRITE cache/FUA attrs after export
      e477f3e0
    • Linus Torvalds's avatar
      Merge tag 'dm-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm · da6b9a20
      Linus Torvalds authored
      Pull devicemapper fixes from Mike Snitzer:
       "A handful of stable fixes for DM:
         - fix thin target to always zero-fill reads to unprovisioned blocks
         - fix to interlock device destruction's suspend from internal
           suspends
         - fix 2 snapshot exception store handover bugs
         - fix dm-io to cope with DISCARD and WRITE_SAME capabilities changing"
      
      * tag 'dm-4.0-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm io: deal with wandering queue limits when handling REQ_DISCARD and REQ_WRITE_SAME
        dm snapshot: suspend merging snapshot when doing exception handover
        dm snapshot: suspend origin when doing exception handover
        dm: hold suspend_lock while suspending device during device deletion
        dm thin: fix to consistently zero-fill reads to unprovisioned blocks
      da6b9a20
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · 521d4746
      Linus Torvalds authored
      Pull btrfs fixes from Chris Mason:
       "Most of these are fixing extent reservation accounting, or corners
        with tree writeback during commit.
      
        Josef's set does add a test, which isn't strictly a fix, but it'll
        keep us from making this same mistake again"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        Btrfs: fix outstanding_extents accounting in DIO
        Btrfs: add sanity test for outstanding_extents accounting
        Btrfs: just free dummy extent buffers
        Btrfs: account merges/splits properly
        Btrfs: prepare block group cache before writing
        Btrfs: fix ASSERT(list_empty(&cur_trans->dirty_bgs_list)
        Btrfs: account for the correct number of extents for delalloc reservations
        Btrfs: fix merge delalloc logic
        Btrfs: fix comp_oper to get right order
        Btrfs: catch transaction abortion after waiting for it
        btrfs: fix sizeof format specifier in btrfs_check_super_valid()
      521d4746
    • Linus Torvalds's avatar
      Merge branch 'for-4.0' of git://linux-nfs.org/~bfields/linux · 0d122f74
      Linus Torvalds authored
      Pull nfsd bufix from Bruce Fields:
       "This is a fix for a crash easily triggered by 4.1 activity to a server
        built with CONFIG_NFSD_PNFS.
      
        There are some more bugfixes queued up that I intend to pass along
        next week, but this is the most critical"
      
      * 'for-4.0' of git://linux-nfs.org/~bfields/linux:
        Subject: nfsd: don't recursively call nfsd4_cb_layout_fail
      0d122f74
    • Linus Torvalds's avatar
      Merge tag 'upstream-4.0-rc5' of git://git.infradead.org/linux-ubifs · c6ef8145
      Linus Torvalds authored
      Pull UBI fix from Artem Bityutskiy:
       "This fixes a bug introduced during the v4.0 merge window where we
        forgot to put braces where they should be"
      
      * tag 'upstream-4.0-rc5' of git://git.infradead.org/linux-ubifs:
        UBI: fix missing brace control flow
      c6ef8145
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 60ed380e
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - mm switching fix where the kernel pgd ends up in the user TTBR0 after
         returning from an EFI run-time services call
      
       - fix __GFP_ZERO handling for atomic pool and CMA DMA allocations (the
         generic code does get the gfp flags, so it's left with the arch code
         to memzero accordingly)
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Honor __GFP_ZERO in dma allocations
        arm64: efi: don't restore TTBR0 if active_mm points at init_mm
      60ed380e
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm · 62a202d7
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Another few ARM fixes.  Fabrice fixed the L2 cache DT parsing to allow
        prefetch configuration to be specified even when the cache size
        parsing fails.
      
        Laura noticed that the setting of page attributes wasn't working for
        modules due to is_module_addr() always returning false.
      
        Marc Gonzalez (aka Mason) noticed a potential latent bug with the way
        we read one of the CPUID registers (where we could attempt to read a
        non-present CPUID register which may fault.)
      
        I've fixed an issue where 32-bit DMA masks were failing with memory
        which extended to the top of physical address space, and I've also
        added debugging output of the page tables when we hit a data access
        exception which we don't specifically handle - prompted by the lack of
        information in a bug report"
      
      * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
        ARM: 8313/1: Use read_cpuid_ext() macro instead of inline asm
        ARM: 8311/1: Don't use is_module_addr in setting page attributes
        ARM: 8310/1: l2c: Fix prefetch settings dt parsing
        ARM: dump pgd, pmd and pte states on unhandled data abort faults
        ARM: dma-api: fix off-by-one error in __dma_supported()
      62a202d7
  4. 20 Mar, 2015 6 commits