Skip to content
Snippets Groups Projects
  1. Nov 10, 2020
  2. Nov 09, 2020
  3. Nov 08, 2020
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.10-rc3' of... · 15f5d201
      Linus Torvalds authored
      Merge tag 'driver-core-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core documentation fixes from Greg KH:
       "Some small Documentation fixes that were fallout from the larger
        documentation update we did in 5.10-rc2.
      
        Nothing major here at all, but all of these have been in linux-next
        and resolve build warnings when building the documentation files"
      
      * tag 'driver-core-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        Documentation: remove mic/index from misc-devices/index.rst
        scripts: get_api.pl: Add sub-titles to ABI output
        scripts: get_abi.pl: Don't let ABI files to create subtitles
        docs: leds: index.rst: add a missing file
        docs: ABI: sysfs-class-net: fix a typo
        docs: ABI: sysfs-driver-dma-ioatdma: what starts with /sys
      15f5d201
    • Linus Torvalds's avatar
      Merge tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · bbc82184
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are a small number of small tty and serial fixes for some
        reported problems for the tty core, vt code, and some serial drivers.
      
        They include fixes for:
      
         - a buggy and obsolete vt font ioctl removal
      
         - 8250_mtk serial baudrate runtime warnings
      
         - imx serial earlycon build configuration fix
      
         - txx9 serial driver error path cleanup issues
      
         - tty core fix in release_tty that can be triggered by trying to bind
           an invalid serial port name to a speakup console device
      
        Almost all of these have been in linux-next without any problems, the
        only one that hasn't, just deletes code :)"
      
      * tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        vt: Disable KD_FONT_OP_COPY
        tty: fix crash in release_tty if tty->port is not set
        serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
        tty: serial: imx: enable earlycon by default if IMX_SERIAL_CONSOLE is enabled
        serial: 8250_mtk: Fix uart_get_baud_rate warning
      bbc82184
    • Linus Torvalds's avatar
      Merge tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · df53b815
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes and new device ids:
      
         - USB gadget fixes for some reported issues
      
         - Fixes for the ever-troublesome apple fastcharge driver, hopefully
           we finally have it right.
      
         - More USB core quirks for odd devices
      
         - USB serial driver fixes for some long-standing issues that were
           recently found
      
         - some new USB serial driver device ids
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property
        usb: mtu3: fix panic in mtu3_gadget_stop()
        USB: serial: option: add Telit FN980 composition 0x1055
        USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231
        USB: serial: cyberjack: fix write-URB completion race
        USB: Add NO_LPM quirk for Kingston flash drive
        USB: serial: option: add Quectel EC200T module support
        usb: raw-gadget: fix memory leak in gadget_setup
        usb: dwc2: Avoid leaving the error_debugfs label unused
        usb: dwc3: ep0: Fix delay status handling
        usb: gadget: fsl: fix null pointer checking
        usb: gadget: goku_udc: fix potential crashes in probe
        usb: dwc3: pci: add support for the Intel Alder Lake-S
      df53b815
    • Eddy Wu's avatar
      fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent · b4e00444
      Eddy Wu authored
      
      current->group_leader->exit_signal may change during copy_process() if
      current->real_parent exits.
      
      Move the assignment inside tasklist_lock to avoid the race.
      
      Signed-off-by: default avatarEddy Wu <eddy_wu@trendmicro.com>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b4e00444
    • Daniel Vetter's avatar
      vt: Disable KD_FONT_OP_COPY · 3c4e0dff
      Daniel Vetter authored
      It's buggy:
      
      On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
      > We recently discovered a slab-out-of-bounds read in fbcon in the latest
      > kernel ( v5.10-rc2 for now ).  The root cause of this vulnerability is that
      > "fbcon_do_set_font" did not handle "vc->vc_font.data" and
      > "vc->vc_font.height" correctly, and the patch
      > <https://lkml.org/lkml/2020/9/27/223> for VT_RESIZEX can't handle this
      > issue.
      >
      > Specifically, we use KD_FONT_OP_SET to set a small font.data for tty6, and
      > use  KD_FONT_OP_SET again to set a large font.height for tty1. After that,
      > we use KD_FONT_OP_COPY to assign tty6's vc_font.data to tty1's vc_font.data
      > in "fbcon_do_set_font", while tty1 retains the original larger
      > height. Obviously, this will cause an out-of-bounds read, because we can
      > access a smaller vc_font.data with a larger vc_font.height.
      
      Further there was only one user ever.
      - Android's loadfont, busybox and console-tools only ever use OP_GET
        and OP_SET
      - fbset documentation only mentions the kernel cmdline font: option,
        not anything else.
      - systemd used OP_COPY before release 232 published in Nov 2016
      
      Now unfortunately the crucial report seems to have gone down with
      gmane, and the commit message doesn't say much. But the pull request
      hints at OP_COPY being broken
      
      https://github.com/systemd/systemd/pull/3651
      
      
      
      So in other words, this never worked, and the only project which
      foolishly every tried to use it, realized that rather quickly too.
      
      Instead of trying to fix security issues here on dead code by adding
      missing checks, fix the entire thing by removing the functionality.
      
      Note that systemd code using the OP_COPY function ignored the return
      value, so it doesn't matter what we're doing here really - just in
      case a lone server somewhere happens to be extremely unlucky and
      running an affected old version of systemd. The relevant code from
      font_copy_to_all_vcs() in systemd was:
      
      	/* copy font from active VT, where the font was uploaded to */
      	cfo.op = KD_FONT_OP_COPY;
      	cfo.height = vcs.v_active-1; /* tty1 == index 0 */
      	(void) ioctl(vcfd, KDFONTOP, &cfo);
      
      Note this just disables the ioctl, garbage collecting the now unused
      callbacks is left for -next.
      
      v2: Tetsuo found the old mail, which allowed me to find it on another
      archive. Add the link too.
      
      Acked-by: default avatarPeilin Ye <yepeilin.cs@gmail.com>
      Reported-by: default avatarMinh Yuan <yuanmingbuaa@gmail.com>
      References: https://lists.freedesktop.org/archives/systemd-devel/2016-June/036935.html
      References: https://github.com/systemd/systemd/pull/3651
      
      
      Cc: Greg KH <greg@kroah.com>
      Cc: Peilin Ye <yepeilin.cs@gmail.com>
      Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://lore.kernel.org/r/20201108153806.3140315-1-daniel.vetter@ffwll.ch
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3c4e0dff
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 9dbc1c03
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
      
       - Fix an uninitialized struct problem
      
       - Fix an iomap problem zeroing unwritten EOF blocks
      
       - Fix some clumsy error handling when writeback fails on filesystems
         with blocksize < pagesize
      
       - Fix a retry loop not resetting loop variables properly
      
       - Fix scrub flagging rtinherit inodes on a non-rt fs, since the kernel
         actually does permit that combination
      
       - Fix excessive page cache flushing when unsharing part of a file
      
      * tag 'xfs-5.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: only flush the unshared range in xfs_reflink_unshare
        xfs: fix scrub flagging rtinherit even if there is no rt device
        xfs: fix missing CoW blocks writeback conversion retry
        iomap: clean up writeback state logic on writepage error
        iomap: support partial page discard on writeback block mapping failure
        xfs: flush new eof page on truncate to avoid post-eof corruption
        xfs: set xefi_discard when creating a deferred agfl free log intent item
      9dbc1c03
    • Linus Torvalds's avatar
      Merge branch 'hch' (patches from Christoph) · 6b2c4d52
      Linus Torvalds authored
      Merge procfs splice read fixes from Christoph Hellwig:
       "Greg reported a problem due to the fact that Android tests use procfs
        files to test splice, which stopped working with the changes for
        set_fs() removal.
      
        This series adds read_iter support for seq_file, and uses those for
        various proc files using seq_file to restore splice read support"
      
      [ Side note: Christoph initially had a scripted "move everything over"
        patch, which looks fine, but I personally would prefer us to actively
        discourage splice() on random files.  So this does just the minimal
        basic core set of proc file op conversions.
      
        For completeness, and in case people care, that script was
      
           sed -i -e 's/\.proc_read\(\s*=\s*\)seq_read/\.proc_read_iter\1seq_read_iter/g'
      
        but I'll wait and see if somebody has a strong argument for using
        splice on random small /proc files before I'd run it on the whole
        kernel.   - Linus ]
      
      * emailed patches from Christoph Hellwig <hch@lst.de>:
        proc "seq files": switch to ->read_iter
        proc "single files": switch to ->read_iter
        proc/stat: switch to ->read_iter
        proc/cpuinfo: switch to ->read_iter
        proc: wire up generic_file_splice_read for iter ops
        seq_file: add seq_read_iter
      6b2c4d52
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 40be821d
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of x86 fixes:
      
         - Use SYM_FUNC_START_WEAK in the mem* ASM functions instead of a
           combination of .weak and SYM_FUNC_START_LOCAL which makes LLVMs
           integrated assembler upset
      
         - Correct the mitigation selection logic which prevented the related
           prctl to work correctly
      
         - Make the UV5 hubless system work correctly by fixing up the
           malformed table entries and adding the missing ones"
      
      * tag 'x86-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/platform/uv: Recognize UV5 hubless system identifier
        x86/platform/uv: Remove spaces from OEM IDs
        x86/platform/uv: Fix missing OEM_TABLE_ID
        x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
        x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S
      40be821d
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 100e3891
      Linus Torvalds authored
      Pull perf fix from Thomas Gleixner:
       "A single fix for the perf core plugging a memory leak in the address
        filter parser"
      
      * tag 'perf-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Fix a memory leak in perf_event_parse_addr_filter()
      100e3891
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · aaaaa7ec
      Linus Torvalds authored
      Pull futex fix from Thomas Gleixner:
       "A single fix for the futex code where an intermediate state in the
        underlying RT mutex was not handled correctly and triggering a BUG()
        instead of treating it as another variant of retry condition"
      
      * tag 'locking-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        futex: Handle transient "ownerless" rtmutex state correctly
      aaaaa7ec
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 15a98444
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of fixes for interrupt chip drivers:
      
         - Fix the fallout of the IPI as interrupt conversion in Kconfig and
           the BCM2836 interrupt chip driver
      
         - Fixes for interrupt affinity setting and the handling of
           hierarchical irq domains in the SiFive PLIC driver
      
         - Make the unmapped event handling in the TI SCI driver work
           correctly
      
         - A few minor fixes and cleanups in various chip drivers and Kconfig"
      
      * tag 'irq-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        dt-bindings: irqchip: ti, sci-inta: Fix diagram indentation for unmapped events
        irqchip/ti-sci-inta: Add support for unmapped event handling
        dt-bindings: irqchip: ti, sci-inta: Update for unmapped event handling
        irqchip/renesas-intc-irqpin: Merge irlm_bit and needs_irlm
        irqchip/sifive-plic: Fix chip_data access within a hierarchy
        irqchip/sifive-plic: Fix broken irq_set_affinity() callback
        irqchip/stm32-exti: Add all LP timer exti direct events support
        irqchip/bcm2836: Fix missing __init annotation
        irqchip/mips: Drop selection of IRQ_DOMAIN_HIERARCHY
        irqchip/mst: Make mst_intc_of_init static
        irqchip/mst: MST_IRQ should depend on ARCH_MEDIATEK or ARCH_MSTARV7
        genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY
      15a98444
    • Linus Torvalds's avatar
      Merge tag 'core-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6a8d0d28
      Linus Torvalds authored
      Pull entry code fix from Thomas Gleixner:
       "A single fix for the generic entry code to correct the wrong
        assumption that the lockdep interrupt state needs not to be
        established before calling the RCU check"
      
      * tag 'core-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        entry: Fix the incorrect ordering of lockdep and RCU check
      6a8d0d28
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · e942d752
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - fix miscompilation with GCC 4.9 by using asm_goto_volatile for put_user()
      
       - fix for an RCU splat at boot caused by a recent lockdep change
      
       - fix for a possible deadlock in our EEH debugfs code
      
       - several fixes for handling of _PAGE_ACCESSED on 32-bit platforms
      
       - build fix when CONFIG_NUMA=n
      
      Thanks to Andreas Schwab, Christophe Leroy, Oliver O'Halloran, Qian Cai,
      and Scott Cheloha.
      
      * tag 'powerpc-5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/numa: Fix build when CONFIG_NUMA=n
        powerpc/8xx: Manage _PAGE_ACCESSED through APG bits in L1 entry
        powerpc/8xx: Always fault when _PAGE_ACCESSED is not set
        powerpc/40x: Always fault when _PAGE_ACCESSED is not set
        powerpc/603: Always fault when _PAGE_ACCESSED is not set
        powerpc: Use asm_goto_volatile for put_user()
        powerpc/smp: Call rcu_cpu_starting() earlier
        powerpc/eeh_cache: Fix a possible debugfs deadlock
      e942d752
    • Voon Weifeng's avatar
      stmmac: intel: change all EHL/TGL to auto detect phy addr · bff6f1db
      Voon Weifeng authored
      
      Set all EHL/TGL phy_addr to -1 so that the driver will automatically
      detect it at run-time by probing all the possible 32 addresses.
      
      Signed-off-by: default avatarVoon Weifeng <weifeng.voon@intel.com>
      Signed-off-by: default avatarWong Vee Khee <vee.khee.wong@intel.com>
      Link: https://lore.kernel.org/r/20201106094341.4241-1-vee.khee.wong@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      bff6f1db
  4. Nov 07, 2020
    • Wang Qing's avatar
      ef9ac209
    • Wang Qing's avatar
    • Jakub Kicinski's avatar
      Merge branch 'net-ipa-constrain-gsi-interrupts' · 2d152760
      Jakub Kicinski authored
      Alex Elder says:
      
      ====================
      net: ipa: constrain GSI interrupts
      
      The goal of this series is to more tightly control when GSI
      interrupts are enabled.  This is a long-ish series, so I'll
      describe it in parts.
      
      The first patch is actually unrelated...  I forgot to include
      it in my previous series (which exposed the GSI layer to the
      IPA version).  It is a trivial comments-only update patch.
      
      The second patch defers registering the GSI interrupt handler
      until *after* all of the resources that handler touches have
      been initialized.  In practice, we don't see this interrupt
      that early, but this precludes an obvious problem.
      
      The next two patches are simple changes.  The first just
      trivially renames a field.  The second switches from using
      constant mask values to using an enumerated type of bit
      positions to represent each GSI interrupt type.
      
      The rest implement the "real work."  First, all interrupts
      are disabled at initialization time.  Next, we keep track of
      a bitmask of enabled GSI interrupt types, updating it each
      time we enable or disable one of them.  From there we have
      a set of patches that one-by-one enable each interrupt type
      only during the period it is required.  This includes allowing
      a channel to generate IEOB interrupts only when it has been
      enabled.  And finally, the last patch simplifies some code
      now that all GSI interrupt types are handled uniformly.
      ====================
      
      Link: https://lore.kernel.org/r/20201105181407.8006-1-elder@linaro.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2d152760
    • Alex Elder's avatar
      net: ipa: pass a value to gsi_irq_type_update() · 8194be79
      Alex Elder authored
      
      Now that all of the GSI interrupts are handled uniformly,
      change gsi_irq_type_update() so it takes a value.  Have the
      function assign that value to the cached mask of enabled GSI
      IRQ types before writing it to hardware.
      
      Note that gsi_irq_teardown() will only be called after
      gsi_irq_disable(), so it's not necessary for the former
      to disable all IRQ types.  Get rid of that.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8194be79
    • Alex Elder's avatar
      net: ipa: only enable GSI general IRQs when needed · 352f26a8
      Alex Elder authored
      
      Most GSI general errors are unrecoverable without a full reset.
      Despite that, we want to receive these errors so we can at least
      report what happened before whatever undefined behavior ensues.
      
      Explicitly disable all such interrupts in gsi_irq_setup(), then
      enable those we want in gsi_irq_enable().  List the interrupt types
      we are interested in (everything but breakpoint) explicitly rather
      than using GSI_CNTXT_GSI_IRQ_ALL, and remove that symbol's
      definition.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      352f26a8
    • Alex Elder's avatar
      net: ipa: explicitly disallow inter-EE interrupts · 46f748cc
      Alex Elder authored
      
      It is possible for other execution environments (EEs, like the modem)
      to request changes to local (AP) channel or event ring state.  We do
      not support this feature.
      
      In gsi_irq_setup(), explicitly zero the mask that defines which
      channels are permitted to generate inter-EE channel state change
      interrupts.  Do the same for the event ring mask.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      46f748cc
    • Alex Elder's avatar
      net: ipa: only enable GSI IEOB IRQs when needed · 06c86328
      Alex Elder authored
      
      A GSI channel must be started in order to use it to perform a
      transfer data (or command) transaction.  And the only time we'll see
      an IEOB interrupt is if we send a transaction to a started channel.
      Therefore we do not need to have the IEOB interrupt type enabled
      until at least one channel has been started.  And once the last
      started channel has been stopped, we can disable the IEOB interrupt
      type again.
      
      We already enable the IEOB interrupt for a particular channel only
      when it is started.  Extend that by having the IEOB interrupt *type*
      be enabled only when at least one channel is in STARTED state.
      
      Disallow all channels from triggering the IEOB interrupt in
      gsi_irq_setup().  We only enable an channel's interrupt when
      needed, so there is no longer any need to zero the channel mask
      in gsi_irq_disable().
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      06c86328
    • Alex Elder's avatar
      net: ipa: only enable generic command completion IRQ when needed · d6c9e3f5
      Alex Elder authored
      
      The completion of a generic EE GSI command is signaled by a global
      interrupt of type GP_INT1.  The only other used type for a global
      interrupt is a hardware error report.
      
      First, disallow all global interrupt types in gsi_irq_setup().  We
      want to know about hardware errors, so re-enable the interrupt type
      in gsi_irq_enable(), to allow hardware errors to be reported.
      Disable that interrupt type again in gsi_irq_disable().
      
      We only issue generic EE commands one at a time, and there's no
      reason to keep the completion interrupt enabled when no generic
      EE command is pending.  We furthermore have no need to enable the
      GP_INT2 or GP_INT3 interrupt types (which aren't used).
      
      The change in gsi_irq_enable() makes GSI_CNTXT_GLOB_IRQ_ALL unused,
      so get rid of it.  Have gsi_generic_command() enable the GP_INT1
      interrupt type (in addition to the ERROR_INT type) only while a
      generic command is pending.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d6c9e3f5
    • Alex Elder's avatar
      net: ipa: only enable GSI event control IRQs when needed · b4175f87
      Alex Elder authored
      
      A GSI event ring causes an event control interrupt to fire whenever
      its state changes (between NOT_ALLOCATED and ALLOCATED).  No event
      ring should ever change state except when we request it to.
      
      Currently, we permit *all* events rings to generate event control
      interrupts--even those that are never used.  And we enable event
      control interrupts essentially at all times, from setup to teardown.
      
      Instead, only enable the event control interrupt type for the
      duration of an event ring command, and when doing so, only allow
      the event ring being operated upon to cause the interrupt to fire.
      Disallow all event rings from issuing the event control interrupt
      in gsi_irq_setup().
      
      Because an event ring's interrupt is only enabled when needed,
      there is no longer any need to zero the event channel mask in
      gsi_irq_disable().
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b4175f87
    • Alex Elder's avatar
      net: ipa: only enable GSI channel control IRQs when needed · b054d4f9
      Alex Elder authored
      
      A GSI channel causes a channel control interrupt to fire whenever
      its state changes (between NOT_ALLOCATED, ALLOCATED, STARTED, etc.).
      We do not support inter-EE channel commands (initiated by other EEs),
      so no channel should ever change state except when we request it to.
      
      Currently, we permit *all* channels to generate channel control
      interrupts--even those that are never used.  And we enable channel
      control interrupts essentially at all times, from setup to teardown.
      
      Instead, disable all channel control interrupts initially in
      gsi_irq_setup(), and only enable the channel control interrupt
      type for the duration of a channel command.  When doing so, only
      allow the channel being operated upon to cause the interrupt to
      fire.
      
      Because a channel's interrupt is now enabled only when needed (one
      channel at a time), there is no longer any need to zero the channel
      mask in gsi_irq_disable().
      
      Add new gsi_irq_type_enable() and gsi_irq_type_disable() as helper
      functions to control whether a given GSI interrupt type is enabled.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b054d4f9
    • Alex Elder's avatar
      net: ipa: cache last-saved GSI IRQ enabled type · 3ca97ffd
      Alex Elder authored
      
      Keep track of the set of GSI interrupt types that are currently
      enabled by recording the mask value to write (or last written) to
      the TYPE_IRQ_MSK register.
      
      Create a new helper function gsi_irq_type_update() to handle
      actually writing the register.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3ca97ffd
    • Alex Elder's avatar
      net: ipa: disable all GSI interrupt types initially · 97eb94c8
      Alex Elder authored
      
      Introduce gsi_irq_setup() and gsi_irq_teardown() to disable all
      GSI interrupts when first setting up GSI hardware, and to clean
      things up when we're done.
      
      Re-enable all GSI interrupt types in gsi_irq_enable(), but do
      so only after each of the type-specific interrupt masks has
      been configured.  Similarly, disable all interrupt types in
      gsi_irq_disable()--first--before zeroing out the type-specific
      masks.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      97eb94c8
    • Alex Elder's avatar
      net: ipa: define GSI interrupt types with an enum · f9b28804
      Alex Elder authored
      
      Define the GSI interrupt types with an enumerated type whose values
      are the bit positions representing each interrupt type.  Include a
      short comment describing how each interrupt type is used.
      
      Build up the enabled interrupt mask explicitly in gsi_irq_enable(),
      and get rid of the definition of GSI_CNTXT_TYPE_IRQ_MSK_ALL.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f9b28804
    • Alex Elder's avatar
      net: ipa: rename gsi->event_enable_bitmap · a054539d
      Alex Elder authored
      
      Rename the "event_enable_bitmap" field of the GSI structure to be
      "ieob_enabled_bitmap".  An upcoming patch will cache the last value
      stored for another interrupt mask and this is a more direct naming
      convention to follow.
      
      Add a few comments to explain the bitmap fields in the GSI structure.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a054539d
    • Alex Elder's avatar
      net: ipa: request GSI IRQ later · 0b8d6761
      Alex Elder authored
      
      Introduce gsi_irq_init() and gsi_irq_exit(), to encapsulate looking
      up the GSI IRQ and registering its handler.  Call gsi_irq_init() a
      little later in gsi_init(), and initialize the completion earlier.
      The IRQ handler accesses both the GSI virtual memory pointer and the
      completion, and this way these things will have been initialized
      before the gsi_irq() can ever be called.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0b8d6761
    • Alex Elder's avatar
      net: ipa: refer to IPA versions, not GSI · 4a04d65c
      Alex Elder authored
      
      The GSI code is now exposed to IPA version numbers, and we handle
      version-specific behavior based on the IPA version.
      
      Modify some comments that talk about GSI versions so they reference
      IPA versions instead.  Correct version number errors in a couple of
      these comments.
      
      The (comment) mapping between IPA and GSI versions in the definition
      of the ipa_version enumerated type remains.
      
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4a04d65c
Loading