Skip to content

Commit

Permalink
Merge branch 'net-in_interrupt-cleanup-and-fixes'
Browse files Browse the repository at this point in the history
Thomas Gleixner says:

====================
net: in_interrupt() cleanup and fixes

in the discussion about preempt count consistency accross kernel configurations:

  https://lore.kernel.org/r/20200914204209.256266093@linutronix.de/

Linus clearly requested that code in drivers and libraries which changes
behaviour based on execution context should either be split up so that
e.g. task context invocations and BH invocations have different interfaces
or if that's not possible the context information has to be provided by the
caller which knows in which context it is executing.

This includes conditional locking, allocation mode (GFP_*) decisions and
avoidance of code paths which might sleep.

In the long run, usage of 'preemptible, in_*irq etc.' should be banned from
driver code completely.

This is the second version of the first batch of related changes. V1 can be
found here:

     https://lore.kernel.org/r/20200927194846.045411263@linutronix.de

Changes vs. V1:

  - Rebased to net-next

  - Fixed the half done rename sillyness in the ENIC patch.

  - Fixed the IONIC driver fallout.

  - Picked up the SFC fix from Edward and adjusted the GFP_KERNEL change
    accordingly.

  - Addressed the review comments vs. BCRFMAC.

  - Collected Reviewed/Acked-by tags as appropriate.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 29, 2020
2 parents 2ec13cb + 920872e commit e6b6be5
Show file tree
Hide file tree
Showing 89 changed files with 354 additions and 2,234 deletions.
1 change: 0 additions & 1 deletion Documentation/networking/caif/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ Contents:

linux_caif
caif
spi_porting
229 changes: 0 additions & 229 deletions Documentation/networking/caif/spi_porting.rst

This file was deleted.

19 changes: 0 additions & 19 deletions drivers/net/caif/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@ config CAIF_TTY
identified as N_CAIF. When this ldisc is opened from user space
it will redirect the TTY's traffic into the CAIF stack.

config CAIF_SPI_SLAVE
tristate "CAIF SPI transport driver for slave interface"
depends on CAIF && HAS_DMA
default n
help
The CAIF Link layer SPI Protocol driver for Slave SPI interface.
This driver implements a platform driver to accommodate for a
platform specific SPI device. A sample CAIF SPI Platform device is
provided in <file:Documentation/networking/caif/spi_porting.rst>.

config CAIF_SPI_SYNC
bool "Next command and length in start of frame"
depends on CAIF_SPI_SLAVE
default n
help
Putting the next command and length in the start of the frame can
help to synchronize to the next transfer in case of over or under-runs.
This option also needs to be enabled on the modem.

config CAIF_HSI
tristate "CAIF HSI transport driver"
depends on CAIF
Expand Down
4 changes: 0 additions & 4 deletions drivers/net/caif/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ ccflags-$(CONFIG_CAIF_DEBUG) := -DDEBUG
# Serial interface
obj-$(CONFIG_CAIF_TTY) += caif_serial.o

# SPI slave physical interfaces module
cfspi_slave-objs := caif_spi.o caif_spi_slave.o
obj-$(CONFIG_CAIF_SPI_SLAVE) += cfspi_slave.o

# HSI interface
obj-$(CONFIG_CAIF_HSI) += caif_hsi.o

Expand Down
19 changes: 2 additions & 17 deletions drivers/net/caif/caif_hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,7 @@ static int cfhsi_rx_desc(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
skb_reset_mac_header(skb);
skb->dev = cfhsi->ndev;

/*
* We are in a callback handler and
* unfortunately we don't know what context we're
* running in.
*/
if (in_interrupt())
netif_rx(skb);
else
netif_rx_ni(skb);
netif_rx_any_context(skb);

/* Update network statistics. */
cfhsi->ndev->stats.rx_packets++;
Expand Down Expand Up @@ -587,14 +579,7 @@ static int cfhsi_rx_pld(struct cfhsi_desc *desc, struct cfhsi *cfhsi)
skb_reset_mac_header(skb);
skb->dev = cfhsi->ndev;

/*
* We're called in callback from HSI
* and don't know the context we're running in.
*/
if (in_interrupt())
netif_rx(skb);
else
netif_rx_ni(skb);
netif_rx_any_context(skb);

/* Update network statistics. */
cfhsi->ndev->stats.rx_packets++;
Expand Down
Loading

0 comments on commit e6b6be5

Please sign in to comment.