Skip to content
Snippets Groups Projects
  1. Jul 01, 2021
  2. Jun 14, 2021
  3. May 21, 2021
  4. May 13, 2021
    • Cheng Du's avatar
      net: caif: remove BUG_ON(dev == NULL) in caif_xmit · 65a67792
      Cheng Du authored
      
      The condition of dev == NULL is impossible in caif_xmit(), hence it is
      for the removal.
      
      Explanation:
      The static caif_xmit() is only called upon via a function pointer
      `ndo_start_xmit` defined in include/linux/netdevice.h:
      ```
      struct net_device_ops {
          ...
          netdev_tx_t     (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev);
          ...
      }
      ```
      
      The exhausive list of call points are:
      ```
      drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
          dev->netdev_ops->ndo_start_xmit(skb, dev);
          ^                                    ^
      
      drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c
          struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev);
      			     ^                       ^
          return adapter->rn_ops->ndo_start_xmit(skb, netdev); // adapter would crash first
      	   ^                                    ^
      
      drivers/usb/gadget/function/f_ncm.c
          ncm->netdev->netdev_ops->ndo_start_xmit(NULL, ncm->netdev);
      	      ^                                   ^
      
      include/linux/netdevice.h
      static inline netdev_tx_t __netdev_start_xmit(...
      {
          return ops->ndo_start_xmit(skb, dev);
      				    ^
      }
      
          const struct net_device_ops *ops = dev->netdev_ops;
      				       ^
          rc = __netdev_start_xmit(ops, skb, dev, more);
      				       ^
      ```
      
      In each of the enumerated scenarios, it is impossible for the NULL-valued dev to
      reach the caif_xmit() without crashing the kernel earlier, therefore `BUG_ON(dev ==
      NULL)` is rather useless, hence the removal.
      
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarDu Cheng <ducheng2@gmail.com>
      Link: https://lore.kernel.org/r/20210503115736.2104747-20-gregkh@linuxfoundation.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      65a67792
    • Greg Kroah-Hartman's avatar
      Revert "net: caif: replace BUG_ON with recovery code" · 4df07045
      Greg Kroah-Hartman authored
      This reverts commit c5dea815.
      
      Because of recent interactions with developers from @umn.edu, all
      commits from them have been recently re-reviewed to ensure if they were
      correct or not.
      
      Upon review, this commit was found to be incorrect for the reasons
      below, so it must be reverted.  It will be fixed up "correctly" in a
      later kernel change.
      
      The original change here was pointless as dev can never be NULL in this
      function so the claim in the changelog that this "fixes" anything is
      incorrect (also the developer forgot about panic_on_warn).  A follow-up
      change will resolve this issue properly.
      
      Cc: Aditya Pakki <pakki001@umn.edu>
      Cc: David S. Miller <davem@davemloft.net>
      Link: https://lore.kernel.org/r/20210503115736.2104747-19-gregkh@linuxfoundation.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4df07045
    • Jiri Slaby's avatar
      tty: make tty_ldisc_ops a param in tty_unregister_ldisc · f81ee8b8
      Jiri Slaby authored
      
      Make tty_unregister_ldisc symmetric to tty_register_ldisc by accepting
      struct tty_ldisc_ops as a parameter instead of ldisc number. This avoids
      checking of the ldisc number bounds in tty_unregister_ldisc.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@reisers.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Rodolfo Giometti <giometti@enneenne.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-17-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f81ee8b8
    • Jiri Slaby's avatar
      tty: set tty_ldisc_ops::num statically · fbadf70a
      Jiri Slaby authored
      
      There is no reason to pass the ldisc number to tty_register_ldisc
      separately. Just set it in the already defined tty_ldisc_ops in all the
      ldiscs.
      
      This simplifies tty_register_ldisc a bit too (no need to set the num
      member there).
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@reisers.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Rodolfo Giometti <giometti@enneenne.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-15-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fbadf70a
    • Jiri Slaby's avatar
      tty: cumulate and document tty_struct::ctrl* members · 64d608db
      Jiri Slaby authored
      
      Group the ctrl members under a single struct called ctrl. The new struct
      contains 'pgrp', 'session', 'pktstatus', and 'packet'. 'pktstatus' and
      'packet' used to be bits in a bitfield. The struct also contains the
      lock protecting them to share the same cache line.
      
      Note that commit c545b66c (tty: Serialize tcflow() with other tty
      flow control changes) added a padding to the original bitfield. It was
      for the bitfield to occupy a whole 64b word to avoid interferring stores
      on Alpha (cannot we evaporate this arch with weird implications to C
      code yet?). But it doesn't work as expected as the padding
      (tty_struct::ctrl_unused) is aligned to a 8B boundary too and occupies
      some bytes from the next word.
      
      So make it reliable by:
      1) setting __aligned of the struct -- that aligns the start, and
      2) making 'unsigned long unused[0]' as the last member of the struct --
         pads the end.
      
      Add a kerneldoc comment for this grouped members.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: netdev@vger.kernel.org
      Link: https://lore.kernel.org/r/20210505091928.22010-14-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64d608db
    • Jiri Slaby's avatar
      tty: cumulate and document tty_struct::flow* members · 6e94dbc7
      Jiri Slaby authored
      
      Group the flow flags under a single struct called flow. The new struct
      contains 'stopped' and 'tco_stopped' bools which used to be bits in a
      bitfield. The struct also contains the lock protecting them to
      potentially share the same cache line.
      
      Note that commit c545b66c (tty: Serialize tcflow() with other tty
      flow control changes) added a padding to the original bitfield. It was
      for the bitfield to occupy a whole 64b word to avoid interferring stores
      on Alpha (cannot we evaporate this arch with weird implications to C
      code yet?). But it doesn't work as expected as the padding
      (tty_struct::unused) is aligned to a 8B boundary too and occupies some
      bytes from the next word.
      
      So make it reliable by:
      1) setting __aligned of the struct -- that aligns the start, and
      2) making 'unsigned long unused[0]' as the last member of the struct --
         pads the end.
      
      This is also the perfect time to start the documentation of tty_struct
      where all this lives. So we start by documenting what these bools
      actually serve for. And why we do all the alignment dances. Only the few
      up-to-date information from the Theodore's comment made it into this new
      Kerneldoc comment.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>
      Link: https://lore.kernel.org/r/20210505091928.22010-13-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e94dbc7
    • Jiri Slaby's avatar
      tty: make fp of tty_ldisc_ops::receive_buf{,2} const · 0f3dcf3b
      Jiri Slaby authored
      
      Char pointer (cp) passed to tty_ldisc_ops::receive_buf{,2} is const.
      There is no reason for flag pointer (fp) not to be too. So switch it in
      the definition and all uses.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: William Hubbs <w.d.hubbs@gmail.com>
      Cc: Chris Brannon <chris@the-brannons.com>
      Cc: Kirk Reiser <kirk@reisers.ca>
      Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
      Cc: Marcel Holtmann <marcel@holtmann.org>
      Cc: Johan Hedberg <johan.hedberg@gmail.com>
      Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Andreas Koensgen <ajk@comnets.uni-bremen.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
      Link: https://lore.kernel.org/r/20210505091928.22010-12-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0f3dcf3b
  5. Mar 10, 2021
  6. Feb 02, 2021
  7. Jan 07, 2021
  8. Oct 02, 2020
  9. Sep 29, 2020
    • Sebastian Andrzej Siewior's avatar
      net: caif: Use netif_rx_any_context() · f773c765
      Sebastian Andrzej Siewior authored
      
      The usage of in_interrupt() in non-core code is phased out. Ideally the
      information of the calling context should be passed by the callers or the
      functions be split as appropriate.
      
      cfhsi_rx_desc() and cfhsi_rx_pld() use in_interrupt() to distinguish if
      they should use netif_rx() or netif_rx_ni() for receiving packets.
      
      The attempt to consolidate the code by passing an arguemnt or by
      distangling it failed due lack of knowledge about this driver and because
      the call chains are hard to follow.
      
      As a stop gap use netif_rx_any_context() which invokes the correct code path
      depending on context and confines the in_interrupt() usage to core code.
      
      Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f773c765
    • Thomas Gleixner's avatar
      net: caif: Remove unused caif SPI driver · f2bf88c4
      Thomas Gleixner authored
      
      While chasing in_interrupt() (ab)use in drivers it turned out that the
      caif_spi driver has never been in use since the driver was merged 10 years
      ago. There never was any matching code which provides a platform device.
      
      The driver has not seen any update (asided of treewide changes and
      cleanups) since 8 years and the maintainers vanished from the planet.
      
      So analysing the potential contexts and the (in)correctness of
      in_interrupt() usage is just a pointless exercise.
      
      Remove the cruft.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f2bf88c4
  10. Jun 29, 2020
  11. Jun 13, 2020
    • Masahiro Yamada's avatar
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada authored
      
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  12. Jun 02, 2020
  13. Apr 28, 2020
  14. Apr 20, 2020
    • Michael S. Tsirkin's avatar
      vhost: disable for OABI · d085eb8c
      Michael S. Tsirkin authored
      
      vhost is currently broken on the some ARM configs.
      
      The reason is that the ring element addresses are passed between
      components with different alignments assumptions. Thus, if
      guest selects a pointer and host then gets and dereferences
      it, then alignment assumed by the host's compiler might be
      greater than the actual alignment of the pointer.
      compiler on the host from assuming pointer is aligned.
      
      This actually triggers on ARM with -mabi=apcs-gnu - which is a
      deprecated configuration. With this OABI, compiler assumes that
      all structures are 4 byte aligned - which is stronger than
      virtio guarantees for available and used rings, which are
      merely 2 bytes. Thus a guest without -mabi=apcs-gnu running
      on top of host with -mabi=apcs-gnu will be broken.
      
      The correct fix is to force alignment of structures - however
      that is an intrusive fix that's best deferred until the next release.
      
      We didn't previously support such ancient systems at all - this surfaced
      after vdpa support prompted removing dependency of vhost on
      VIRTULIZATION. So for now, let's just add something along the lines of
      
      	depends on !ARM || AEABI
      
      to the virtio Kconfig declaration, and add a comment that it has to do
      with struct member alignment.
      
      Note: we can't make VHOST and VHOST_RING themselves have
      a dependency since these are selected. Add a new symbol for that.
      
      We should be able to drop this dependency down the road.
      
      Fixes: 20c384f1 ("vhost: refine vhost and vringh kconfig")
      Suggested-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Suggested-by: default avatarRichard Earnshaw <Richard.Earnshaw@arm.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      d085eb8c
  15. Apr 01, 2020
  16. Mar 16, 2020
  17. Dec 17, 2019
  18. Nov 21, 2019
  19. Nov 09, 2019
  20. Oct 02, 2019
  21. Aug 12, 2019
  22. Jul 17, 2019
  23. May 30, 2019
  24. May 21, 2019
  25. Feb 12, 2019
  26. Jan 29, 2019
  27. Mar 26, 2018
  28. Jan 22, 2018
Loading