mbox series

[PRE-REVIEW,00/16] Modernize the tasklet API

Message ID 20190929163028.9665-1-romain.perier@gmail.com (mailing list archive)
Headers show
Series Modernize the tasklet API | expand

Message

Romain Perier Sept. 29, 2019, 4:30 p.m. UTC
Hello,

Nowadays, modern kernel subsystems that use callbacks pass the data
structure associated with a given callback as argument to the callback.
The data structure specific to the driver or subsystem that uses this
callback framework is usually "derivated" from the data structure that
is passed as argument to the callback.

The tasklet subsystem remains the one to pass callback argument as an
arbitrary unsigned long argument (This has several issues that are
explained in the first commit).

This series aims to improve the tasklet API and converts all the code
that is using it. It is based on the series for timer_list at [1].

1. https://lore.kernel.org/patchwork/patch/835464


Romain Perier (16):
  tasklet: Prepare to change tasklet callback argument type
  crypto: ccp - Prepare to use the new tasklet API
  mmc: renesas_sdhi: Prepare to use the new tasklet API
  net: liquidio: Prepare to use the new tasklet API
  chelsio: Prepare to use the new tasklet API
  net: mvpp2: Prepare to use the new tasklet API
  qed: Prepare to use the new tasklet API
  isdn: Prepare to use the new tasklet API
  scsi: pm8001: Prepare to use the new tasklet API
  scsi: pmcraid: Prepare to use the new tasklet API
  treewide: Globally replace tasklet_init() by tasklet_setup()
  tasklet: Pass tasklet_struct pointer as .data in DECLARE_TASKLET
  tasklet: Pass tasklet_struct pointer to callbacks unconditionally
  tasklet: Remove the data argument from DECLARE_TASKLET() macros
  tasklet: convert callbacks prototype for using struct tasklet_struct *
    arguments
  tasklet: Add the new initialization function permanently

 arch/mips/lasat/picvue_proc.c                 |  2 +-
 arch/um/drivers/vector_kern.c                 |  6 +-
 drivers/atm/eni.c                             |  8 +--
 drivers/atm/fore200e.c                        | 14 ++---
 drivers/atm/he.c                              |  8 +--
 drivers/atm/solos-pci.c                       |  8 +--
 drivers/block/umem.c                          |  6 +-
 drivers/block/xsysace.c                       |  6 +-
 drivers/char/ipmi/ipmi_msghandler.c           | 12 ++--
 drivers/crypto/amcc/crypto4xx_core.c          |  7 +--
 drivers/crypto/atmel-aes.c                    | 14 ++---
 drivers/crypto/atmel-sha.c                    | 14 ++---
 drivers/crypto/atmel-tdes.c                   | 14 ++---
 drivers/crypto/axis/artpec6_crypto.c          |  7 +--
 drivers/crypto/caam/jr.c                      |  8 +--
 drivers/crypto/cavium/cpt/cptvf_main.c        |  9 ++-
 drivers/crypto/cavium/nitrox/nitrox_common.h  |  2 +-
 drivers/crypto/cavium/nitrox/nitrox_isr.c     | 13 ++---
 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c  |  4 +-
 drivers/crypto/ccp/ccp-dev-v3.c               |  9 ++-
 drivers/crypto/ccp/ccp-dev-v5.c               |  9 ++-
 drivers/crypto/ccp/ccp-dev.c                  | 10 ++--
 drivers/crypto/ccp/ccp-dmaengine.c            |  7 +--
 drivers/crypto/ccree/cc_fips.c                |  8 +--
 drivers/crypto/ccree/cc_request_mgr.c         | 12 ++--
 drivers/crypto/hifn_795x.c                    |  6 +-
 drivers/crypto/img-hash.c                     | 12 ++--
 drivers/crypto/ixp4xx_crypto.c                |  5 +-
 drivers/crypto/mediatek/mtk-aes.c             | 14 ++---
 drivers/crypto/mediatek/mtk-sha.c             | 14 ++---
 drivers/crypto/omap-aes.c                     |  6 +-
 drivers/crypto/omap-des.c                     |  6 +-
 drivers/crypto/omap-sham.c                    |  6 +-
 drivers/crypto/picoxcell_crypto.c             |  7 +--
 drivers/crypto/qat/qat_common/adf_isr.c       |  5 +-
 drivers/crypto/qat/qat_common/adf_sriov.c     |  8 +--
 drivers/crypto/qat/qat_common/adf_transport.c |  4 +-
 .../qat/qat_common/adf_transport_internal.h   |  2 +-
 drivers/crypto/qat/qat_common/adf_vf_isr.c    | 11 ++--
 drivers/crypto/qce/core.c                     |  7 +--
 drivers/crypto/rockchip/rk3288_crypto.c       | 14 ++---
 drivers/crypto/s5p-sss.c                      | 13 ++---
 drivers/crypto/talitos.c                      | 42 +++++++-------
 drivers/dma/altera-msgdma.c                   |  6 +-
 drivers/dma/at_hdmac.c                        |  7 +--
 drivers/dma/at_xdmac.c                        |  7 +--
 drivers/dma/coh901318.c                       |  7 +--
 drivers/dma/dw/core.c                         |  6 +-
 drivers/dma/ep93xx_dma.c                      |  7 +--
 drivers/dma/fsl_raid.c                        |  8 +--
 drivers/dma/fsldma.c                          |  6 +-
 drivers/dma/imx-dma.c                         |  7 +--
 drivers/dma/ioat/dma.c                        |  6 +-
 drivers/dma/ioat/dma.h                        |  2 +-
 drivers/dma/ioat/init.c                       |  2 +-
 drivers/dma/iop-adma.c                        |  8 +--
 drivers/dma/ipu/ipu_idmac.c                   |  6 +-
 drivers/dma/k3dma.c                           |  6 +-
 drivers/dma/mediatek/mtk-cqdma.c              |  7 +--
 drivers/dma/mmp_pdma.c                        |  6 +-
 drivers/dma/mmp_tdma.c                        |  6 +-
 drivers/dma/mpc512x_dma.c                     |  6 +-
 drivers/dma/mv_xor.c                          |  7 +--
 drivers/dma/mv_xor_v2.c                       |  8 +--
 drivers/dma/mxs-dma.c                         |  7 +--
 drivers/dma/nbpfaxi.c                         |  6 +-
 drivers/dma/pch_dma.c                         |  7 +--
 drivers/dma/pl330.c                           | 12 ++--
 drivers/dma/ppc4xx/adma.c                     |  7 +--
 drivers/dma/qcom/bam_dma.c                    |  6 +-
 drivers/dma/qcom/hidma.c                      |  6 +-
 drivers/dma/qcom/hidma_ll.c                   |  6 +-
 drivers/dma/sa11x0-dma.c                      |  6 +-
 drivers/dma/sirf-dma.c                        |  6 +-
 drivers/dma/ste_dma40.c                       |  7 +--
 drivers/dma/sun6i-dma.c                       |  6 +-
 drivers/dma/tegra20-apb-dma.c                 |  7 +--
 drivers/dma/timb_dma.c                        |  6 +-
 drivers/dma/txx9dmac.c                        | 14 ++---
 drivers/dma/virt-dma.c                        |  6 +-
 drivers/dma/xgene-dma.c                       |  7 +--
 drivers/dma/xilinx/xilinx_dma.c               |  7 +--
 drivers/dma/xilinx/zynqmp_dma.c               |  6 +-
 drivers/firewire/ohci.c                       | 16 +++---
 drivers/gpu/drm/i915/gt/intel_engine_cs.c     |  2 +-
 drivers/gpu/drm/i915/gt/intel_lrc.c           | 28 +++++-----
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  7 ++-
 drivers/hsi/clients/nokia-modem.c             |  9 +--
 drivers/hsi/controllers/omap_ssi_core.c       |  9 ++-
 drivers/hv/channel_mgmt.c                     |  3 +-
 drivers/hv/connection.c                       |  4 +-
 drivers/hv/hv.c                               |  3 +-
 drivers/hv/hyperv_vmbus.h                     |  4 +-
 drivers/hv/vmbus_drv.c                        |  4 +-
 drivers/infiniband/hw/bnxt_re/qplib_fp.c      |  7 +--
 drivers/infiniband/hw/bnxt_re/qplib_rcfw.c    | 11 ++--
 drivers/infiniband/hw/hfi1/sdma.c             | 20 +++----
 drivers/infiniband/hw/i40iw/i40iw_main.c      | 14 ++---
 drivers/infiniband/hw/qib/qib_iba7322.c       |  7 +--
 drivers/infiniband/hw/qib/qib_sdma.c          | 10 ++--
 drivers/infiniband/sw/rxe/rxe_cq.c            |  6 +-
 drivers/infiniband/sw/rxe/rxe_task.c          |  8 +--
 drivers/infiniband/sw/rxe/rxe_task.h          |  2 +-
 drivers/input/keyboard/omap-keypad.c          | 14 +++--
 drivers/input/serio/hil_mlc.c                 |  4 +-
 drivers/input/serio/hp_sdc.c                  |  4 +-
 drivers/mailbox/bcm-pdc-mailbox.c             |  6 +-
 drivers/mailbox/imx-mailbox.c                 |  7 +--
 drivers/media/pci/bt8xx/dvb-bt8xx.c           |  7 ++-
 drivers/media/pci/mantis/mantis_dma.c         |  4 +-
 drivers/media/pci/mantis/mantis_dma.h         |  2 +-
 drivers/media/pci/mantis/mantis_dvb.c         |  2 +-
 drivers/media/pci/ngene/ngene-core.c          | 12 ++--
 drivers/media/pci/smipcie/smipcie-main.c      |  6 +-
 drivers/media/pci/ttpci/av7110.c              | 20 +++----
 drivers/media/pci/ttpci/budget-ci.c           | 16 +++---
 drivers/media/pci/ttpci/budget-core.c         |  6 +-
 drivers/media/pci/tw5864/tw5864-video.c       |  9 ++-
 .../media/platform/marvell-ccic/mcam-core.c   |  7 +--
 drivers/media/platform/pxa_camera.c           |  6 +-
 .../platform/sti/c8sectpfe/c8sectpfe-core.c   | 10 ++--
 drivers/media/radio/wl128x/fmdrv_common.c     | 12 ++--
 drivers/media/usb/ttusb-dec/ttusb_dec.c       |  7 +--
 drivers/memstick/host/jmb38x_ms.c             |  8 +--
 drivers/memstick/host/tifm_ms.c               |  8 +--
 drivers/misc/ibmvmc.c                         |  8 +--
 drivers/misc/vmw_vmci/vmci_guest.c            | 15 +++--
 drivers/mmc/host/atmel-mci.c                  |  6 +-
 drivers/mmc/host/au1xmmc.c                    | 14 ++---
 drivers/mmc/host/cb710-mmc.c                  | 10 ++--
 drivers/mmc/host/dw_mmc.c                     |  6 +-
 drivers/mmc/host/omap.c                       |  7 +--
 drivers/mmc/host/renesas_sdhi.h               |  1 +
 drivers/mmc/host/renesas_sdhi_core.c          |  2 +
 drivers/mmc/host/renesas_sdhi_internal_dmac.c | 19 +++----
 drivers/mmc/host/renesas_sdhi_sys_dmac.c      |  9 ++-
 drivers/mmc/host/s3cmci.c                     |  6 +-
 drivers/mmc/host/tifm_sd.c                    |  7 +--
 drivers/mmc/host/uniphier-sd.c                | 14 ++---
 drivers/mmc/host/via-sdmmc.c                  |  7 +--
 drivers/mmc/host/wbsd.c                       | 35 +++++-------
 drivers/net/arcnet/arcnet.c                   |  7 +--
 drivers/net/caif/caif_virtio.c                |  8 +--
 drivers/net/ethernet/alteon/acenic.c          |  9 +--
 drivers/net/ethernet/alteon/acenic.h          |  2 +-
 drivers/net/ethernet/amd/xgbe/xgbe-drv.c      | 19 +++----
 drivers/net/ethernet/amd/xgbe/xgbe-i2c.c      | 11 ++--
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c     | 11 ++--
 drivers/net/ethernet/broadcom/cnic.c          | 18 +++---
 drivers/net/ethernet/cadence/macb_main.c      |  7 +--
 .../net/ethernet/cavium/liquidio/lio_main.c   | 11 ++--
 .../ethernet/cavium/liquidio/octeon_main.h    |  1 +
 .../net/ethernet/cavium/octeon/octeon_mgmt.c  |  7 +--
 .../net/ethernet/cavium/thunder/nicvf_main.c  | 10 ++--
 .../ethernet/cavium/thunder/nicvf_queues.c    |  4 +-
 .../ethernet/cavium/thunder/nicvf_queues.h    |  2 +-
 drivers/net/ethernet/chelsio/cxgb/sge.c       | 11 ++--
 drivers/net/ethernet/chelsio/cxgb3/sge.c      | 16 +++---
 drivers/net/ethernet/chelsio/cxgb4/sge.c      | 12 ++--
 drivers/net/ethernet/dlink/sundance.c         | 19 +++----
 .../net/ethernet/huawei/hinic/hinic_hw_eqs.c  |  7 +--
 drivers/net/ethernet/ibm/ehea/ehea_main.c     |  7 +--
 drivers/net/ethernet/ibm/ibmvnic.c            |  7 +--
 drivers/net/ethernet/jme.c                    | 43 ++++++---------
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h    |  1 +
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |  1 +
 drivers/net/ethernet/marvell/skge.c           |  6 +-
 drivers/net/ethernet/mellanox/mlx4/cq.c       |  4 +-
 drivers/net/ethernet/mellanox/mlx4/eq.c       |  3 +-
 drivers/net/ethernet/mellanox/mlx4/mlx4.h     |  2 +-
 drivers/net/ethernet/mellanox/mlx5/core/cq.c  |  4 +-
 drivers/net/ethernet/mellanox/mlx5/core/eq.c  |  3 +-
 .../ethernet/mellanox/mlx5/core/fpga/conn.c   |  7 +--
 .../net/ethernet/mellanox/mlx5/core/lib/eq.h  |  2 +-
 drivers/net/ethernet/mellanox/mlxsw/pci.c     | 12 ++--
 drivers/net/ethernet/micrel/ks8842.c          | 19 ++++---
 drivers/net/ethernet/micrel/ksz884x.c         | 14 ++---
 drivers/net/ethernet/natsemi/ns83820.c        |  8 +--
 .../ethernet/netronome/nfp/nfp_net_common.c   |  7 +--
 drivers/net/ethernet/ni/nixge.c               |  7 +--
 drivers/net/ethernet/qlogic/qed/qed.h         |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_int.c     | 27 +--------
 drivers/net/ethernet/qlogic/qed/qed_int.h     |  2 +-
 drivers/net/ethernet/qlogic/qed/qed_main.c    | 14 ++---
 drivers/net/ethernet/silan/sc92031.c          | 11 ++--
 drivers/net/ethernet/smsc/smc91x.c            |  8 +--
 .../net/ethernet/xilinx/xilinx_axienet_main.c |  9 ++-
 drivers/net/ifb.c                             |  7 +--
 drivers/net/ppp/ppp_async.c                   |  8 +--
 drivers/net/ppp/ppp_synctty.c                 |  8 +--
 drivers/net/usb/cdc_ncm.c                     |  8 +--
 drivers/net/usb/hso.c                         |  8 +--
 drivers/net/usb/lan78xx.c                     |  6 +-
 drivers/net/usb/pegasus.c                     |  6 +-
 drivers/net/usb/r8152.c                       |  8 +--
 drivers/net/usb/rtl8150.c                     |  6 +-
 drivers/net/usb/usbnet.c                      |  3 +-
 drivers/net/wan/farsync.c                     | 12 ++--
 drivers/net/wireless/ath/ath5k/base.c         | 24 ++++----
 drivers/net/wireless/ath/ath5k/rfkill.c       |  8 +--
 drivers/net/wireless/ath/ath9k/ath9k.h        |  4 +-
 drivers/net/wireless/ath/ath9k/beacon.c       |  4 +-
 drivers/net/wireless/ath/ath9k/htc.h          |  4 +-
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |  6 +-
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c |  8 +--
 drivers/net/wireless/ath/ath9k/init.c         |  5 +-
 drivers/net/wireless/ath/ath9k/main.c         |  4 +-
 drivers/net/wireless/ath/ath9k/wmi.c          |  7 +--
 drivers/net/wireless/ath/ath9k/wmi.h          |  2 +-
 drivers/net/wireless/ath/carl9170/usb.c       |  7 +--
 drivers/net/wireless/atmel/at76c50x-usb.c     |  9 ++-
 .../net/wireless/broadcom/b43legacy/main.c    |  7 +--
 drivers/net/wireless/broadcom/b43legacy/pio.c |  7 +--
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |  6 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.h |  2 +-
 drivers/net/wireless/intel/ipw2x00/ipw2100.c  |  8 +--
 drivers/net/wireless/intel/ipw2x00/ipw2200.c  |  6 +-
 .../net/wireless/intel/iwlegacy/3945-mac.c    |  7 +--
 .../net/wireless/intel/iwlegacy/4965-mac.c    |  7 +--
 .../net/wireless/intersil/hostap/hostap_hw.c  | 18 +++---
 drivers/net/wireless/intersil/orinoco/main.c  |  7 +--
 drivers/net/wireless/intersil/p54/p54pci.c    |  8 +--
 drivers/net/wireless/marvell/mwl8k.c          | 16 +++---
 drivers/net/wireless/mediatek/mt76/mac80211.c |  2 +-
 drivers/net/wireless/mediatek/mt76/mt76.h     |  2 +-
 .../wireless/mediatek/mt76/mt7603/beacon.c    |  4 +-
 .../net/wireless/mediatek/mt76/mt7603/init.c  |  3 +-
 .../wireless/mediatek/mt76/mt7603/mt7603.h    |  2 +-
 .../net/wireless/mediatek/mt76/mt76x02_dfs.c  |  9 ++-
 .../net/wireless/mediatek/mt76/mt76x02_mmio.c | 14 ++---
 drivers/net/wireless/mediatek/mt76/tx.c       |  4 +-
 drivers/net/wireless/mediatek/mt76/usb.c      | 12 ++--
 drivers/net/wireless/mediatek/mt7601u/dma.c   | 12 ++--
 .../quantenna/qtnfmac/pcie/pearl_pcie.c       |  7 +--
 .../quantenna/qtnfmac/pcie/topaz_pcie.c       |  7 +--
 .../net/wireless/ralink/rt2x00/rt2400pci.c    | 14 +++--
 .../net/wireless/ralink/rt2x00/rt2500pci.c    | 14 +++--
 .../net/wireless/ralink/rt2x00/rt2800mmio.c   | 25 +++++----
 .../net/wireless/ralink/rt2x00/rt2800mmio.h   | 10 ++--
 drivers/net/wireless/ralink/rt2x00/rt2x00.h   | 10 ++--
 .../net/wireless/ralink/rt2x00/rt2x00dev.c    |  5 +-
 drivers/net/wireless/ralink/rt2x00/rt61pci.c  | 19 ++++---
 drivers/net/wireless/realtek/rtlwifi/pci.c    | 20 ++++---
 drivers/net/wireless/realtek/rtlwifi/usb.c    |  9 ++-
 drivers/net/wireless/zydas/zd1211rw/zd_usb.c  |  7 +--
 drivers/ntb/ntb_transport.c                   |  9 ++-
 drivers/platform/goldfish/goldfish_pipe.c     |  7 +--
 drivers/rapidio/devices/tsi721_dma.c          |  7 +--
 drivers/s390/block/dasd.c                     | 18 +++---
 drivers/s390/char/con3215.c                   |  6 +-
 drivers/s390/char/con3270.c                   |  7 +--
 drivers/s390/char/tty3270.c                   | 15 +++--
 drivers/s390/cio/qdio.h                       |  6 +-
 drivers/s390/cio/qdio_main.c                  | 12 ++--
 drivers/s390/cio/qdio_setup.c                 |  9 +--
 drivers/s390/crypto/ap_bus.c                  |  8 +--
 drivers/s390/net/ctcm_main.c                  |  9 ++-
 drivers/s390/net/ctcm_mpc.c                   | 16 +++---
 drivers/s390/net/ctcm_mpc.h                   |  6 +-
 drivers/scsi/aic94xx/aic94xx_hwi.c            |  9 ++-
 drivers/scsi/esas2r/esas2r.h                  |  2 +-
 drivers/scsi/esas2r/esas2r_init.c             |  4 +-
 drivers/scsi/esas2r/esas2r_main.c             |  4 +-
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c        |  6 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c        |  6 +-
 drivers/scsi/ibmvscsi/ibmvfc.c                |  6 +-
 drivers/scsi/ibmvscsi/ibmvscsi.c              |  8 +--
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c      |  7 +--
 drivers/scsi/isci/host.c                      |  4 +-
 drivers/scsi/isci/host.h                      |  2 +-
 drivers/scsi/isci/init.c                      |  4 +-
 drivers/scsi/megaraid/megaraid_mbox.c         | 11 ++--
 drivers/scsi/megaraid/megaraid_sas.h          |  2 +-
 drivers/scsi/megaraid/megaraid_sas_base.c     | 16 +++---
 drivers/scsi/megaraid/megaraid_sas_fusion.c   | 13 ++---
 drivers/scsi/mvsas/mv_init.c                  |  8 +--
 drivers/scsi/pm8001/pm8001_init.c             | 55 +++++++++++--------
 drivers/scsi/pm8001/pm8001_sas.h              |  6 +-
 drivers/scsi/pmcraid.c                        | 29 +++++-----
 drivers/scsi/pmcraid.h                        |  9 ++-
 drivers/spi/spi-pl022.c                       |  7 +--
 drivers/staging/isdn/gigaset/bas-gigaset.c    | 23 ++++----
 drivers/staging/isdn/gigaset/common.c         |  3 +-
 drivers/staging/isdn/gigaset/ev-layer.c       |  4 +-
 drivers/staging/isdn/gigaset/gigaset.h        |  3 +-
 drivers/staging/isdn/gigaset/interface.c      |  6 +-
 drivers/staging/isdn/gigaset/ser-gigaset.c    |  7 +--
 drivers/staging/isdn/gigaset/usb-gigaset.c    |  7 +--
 drivers/staging/ks7010/ks7010_sdio.c          |  6 +-
 drivers/staging/ks7010/ks_hostif.c            |  6 +-
 drivers/staging/most/dim2/dim2.c              | 19 ++++---
 drivers/staging/mt7621-dma/mtk-hsdma.c        |  6 +-
 drivers/staging/octeon/ethernet-tx.c          |  6 +-
 drivers/staging/ralink-gdma/ralink-gdma.c     |  6 +-
 .../staging/rtl8188eu/hal/rtl8188eu_recv.c    |  4 +-
 .../staging/rtl8188eu/hal/rtl8188eu_xmit.c    |  5 +-
 .../staging/rtl8188eu/include/rtl8188e_recv.h |  2 +-
 .../staging/rtl8188eu/include/rtl8188e_xmit.h |  2 +-
 .../staging/rtl8188eu/os_dep/usb_ops_linux.c  |  8 +--
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c  | 29 +++++-----
 drivers/staging/rtl8192e/rtllib_softmac.c     |  8 +--
 .../rtl8192u/ieee80211/ieee80211_softmac.c    |  7 +--
 drivers/staging/rtl8192u/r8192U_core.c        |  9 ++-
 drivers/staging/rtl8712/rtl8712_recv.c        | 10 ++--
 drivers/staging/rtl8712/rtl871x_xmit.c        |  4 +-
 drivers/staging/rtl8712/rtl871x_xmit.h        |  2 +-
 drivers/staging/rtl8712/usb_ops_linux.c       |  4 +-
 .../staging/rtl8723bs/hal/rtl8723bs_recv.c    | 13 ++---
 drivers/staging/wlan-ng/hfa384x_usb.c         | 18 +++---
 drivers/staging/wlan-ng/p80211netdev.c        |  7 +--
 drivers/tty/ipwireless/hardware.c             |  6 +-
 drivers/tty/serial/atmel_serial.c             | 18 +++---
 drivers/tty/serial/ifx6x60.c                  |  7 +--
 drivers/tty/serial/timbuart.c                 |  6 +-
 drivers/tty/vt/keyboard.c                     |  4 +-
 drivers/usb/atm/usbatm.c                      | 12 ++--
 drivers/usb/c67x00/c67x00-sched.c             |  7 +--
 drivers/usb/core/hcd.c                        |  6 +-
 drivers/usb/gadget/function/f_midi.c          |  6 +-
 drivers/usb/gadget/udc/amd5536udc.h           |  1 +
 drivers/usb/gadget/udc/fsl_qe_udc.c           |  7 +--
 drivers/usb/gadget/udc/snps_udc_core.c        | 16 +++---
 drivers/usb/host/fhci-hcd.c                   |  5 +-
 drivers/usb/host/fhci-sched.c                 |  8 +--
 drivers/usb/host/fhci.h                       |  2 +-
 drivers/usb/host/xhci-dbgtty.c                |  6 +-
 drivers/usb/serial/mos7720.c                  |  7 +--
 drivers/vme/bridges/vme_fake.c                |  9 ++-
 include/linux/interrupt.h                     | 20 ++++---
 kernel/backtracetest.c                        |  4 +-
 kernel/debug/debug_core.c                     |  4 +-
 kernel/irq/resend.c                           |  4 +-
 kernel/softirq.c                              |  9 ++-
 net/atm/pppoatm.c                             |  8 +--
 net/dccp/timer.c                              |  9 +--
 net/ipv4/tcp_output.c                         |  8 +--
 net/iucv/iucv.c                               |  4 +-
 net/mac80211/ieee80211_i.h                    |  4 +-
 net/mac80211/main.c                           | 14 ++---
 net/mac80211/tx.c                             |  4 +-
 net/mac80211/util.c                           |  4 +-
 net/mac802154/main.c                          |  8 +--
 net/rds/ib_cm.c                               | 14 ++---
 net/sched/sch_atm.c                           |  8 +--
 net/smc/smc_cdc.c                             |  6 +-
 net/smc/smc_wr.c                              | 14 ++---
 net/xfrm/xfrm_input.c                         |  7 +--
 sound/core/timer.c                            |  7 +--
 sound/drivers/pcsp/pcsp_lib.c                 |  4 +-
 sound/firewire/amdtp-stream.c                 |  8 +--
 sound/pci/asihpi/asihpi.c                     |  9 ++-
 sound/pci/riptide/riptide.c                   |  6 +-
 sound/pci/rme9652/hdsp.c                      |  6 +-
 sound/pci/rme9652/hdspm.c                     |  7 +--
 sound/soc/fsl/fsl_esai.c                      |  7 +--
 sound/soc/sh/siu_pcm.c                        | 10 ++--
 sound/soc/txx9/txx9aclc.c                     |  7 +--
 sound/usb/midi.c                              |  7 +--
 sound/usb/misc/ua101.c                        |  7 +--
 359 files changed, 1432 insertions(+), 1612 deletions(-)

Comments

Kees Cook Sept. 30, 2019, 11:06 p.m. UTC | #1
On Sun, Sep 29, 2019 at 06:30:12PM +0200, Romain Perier wrote:
> Hello,
> 
> Nowadays, modern kernel subsystems that use callbacks pass the data
> structure associated with a given callback as argument to the callback.
> The data structure specific to the driver or subsystem that uses this
> callback framework is usually "derivated" from the data structure that
> is passed as argument to the callback.
> 
> The tasklet subsystem remains the one to pass callback argument as an
> arbitrary unsigned long argument (This has several issues that are
> explained in the first commit).
> 
> This series aims to improve the tasklet API and converts all the code
> that is using it. It is based on the series for timer_list at [1].
> 
> 1. https://lore.kernel.org/patchwork/patch/835464
> 
> 
> Romain Perier (16):
>   tasklet: Prepare to change tasklet callback argument type
>   crypto: ccp - Prepare to use the new tasklet API
>   mmc: renesas_sdhi: Prepare to use the new tasklet API
>   net: liquidio: Prepare to use the new tasklet API
>   chelsio: Prepare to use the new tasklet API
>   net: mvpp2: Prepare to use the new tasklet API
>   qed: Prepare to use the new tasklet API
>   isdn: Prepare to use the new tasklet API
>   scsi: pm8001: Prepare to use the new tasklet API
>   scsi: pmcraid: Prepare to use the new tasklet API
>   treewide: Globally replace tasklet_init() by tasklet_setup()
>   tasklet: Pass tasklet_struct pointer as .data in DECLARE_TASKLET
>   tasklet: Pass tasklet_struct pointer to callbacks unconditionally
>   tasklet: Remove the data argument from DECLARE_TASKLET() macros
>   tasklet: convert callbacks prototype for using struct tasklet_struct *
>     arguments
>   tasklet: Add the new initialization function permanently

This is looking really good; thank you! I think for easier review it
would make sense to break out the "special" cases (where you're changing
structures, etc) into their own patches (and not as a bulk change --
they need review by different subsystem maintainers, etc).

Then the patch phases can be:

1) Introduce new APIs and casts
2) Convert special cases include passing the tasklet as their .data
   (while also changing the prototypes and replacing tasklet_init() with
    tasklet_setup())
3) Convert DECLARE_TASKLET() users to the same
4) Manual one-off conversions of tasklet_init() -> tasklet_setup()
5) Mechanical mass conversion of tasklet_init() -> tasklet_setup()
6) Mass removal of .data argument from DECLARE_TASKLET()
7) tasklet API internal swap and removal of .data
8) tasklet_init() and helper cast removals.

Step 1 needs to happen in an -rc1 (e.g. v5.5-rc1).

Then steps 2, 3, and 4 can happen simultaneously across all the
maintainers that need to be aware of it and land in the next release
(the linux-next for v5.6).

Finally steps 5, 6, 7, and 8 happen in the next release's -rc1
(v5.6-rc1).

If we can get the "phase 1" patch ready quick, maybe we can get into
-rc2 for v5.4 and move things up by a release...

-Kees
Romain Perier Oct. 1, 2019, 5:47 p.m. UTC | #2
On Mon, Sep 30, 2019 at 04:06:50PM -0700, Kees Cook wrote:
> On Sun, Sep 29, 2019 at 06:30:12PM +0200, Romain Perier wrote:
> This is looking really good; thank you! 

Glad to read this :)

> I think for easier review it
> would make sense to break out the "special" cases (where you're changing
> structures, etc) into their own patches (and not as a bulk change --
> they need review by different subsystem maintainers, etc).
> 
> Then the patch phases can be:
> 
> 1) Introduce new APIs and casts
> 2) Convert special cases include passing the tasklet as their .data
>    (while also changing the prototypes and replacing tasklet_init() with
>     tasklet_setup())

	=> So, one commit per driver for preparing the data structure to
	own a sub "struct tasklet_struct" + tasklet_init() ->
	tasklet_setup() with use of "from_tasklet" in the same commit.
	Right ?

	For example:
	the commit "[PRE-REVIEW PATCH 03/16] mmc:
	renesas_sdhi: Prepare to use the new tasklet API"

	would contain changes for preparing the driver to use a
	"struct tasklet_struct" correctly + convert the driver to
	the new API (tasklet_init() -> tasklet_setup())

	Same for commit "[PRE-REVIEW PATCH 04/16] net: liquidio: Prepare
	to use the new tasklet API".

	This is what you had in mind ?

> 3) Convert DECLARE_TASKLET() users to the same

Yeah, this is what you explain in reply to "[PRE-REVIEW PATCH 12/16]
tasklet: Pass tasklet_struct pointer as .data in DECLARE_TASKLET", right
?

> 4) Manual one-off conversions of tasklet_init() -> tasklet_setup()
> 5) Mechanical mass conversion of tasklet_init() -> tasklet_setup()

 See the reply to the commit "treewide:" about this

> 6) Mass removal of .data argument from DECLARE_TASKLET()
> 7) tasklet API internal swap and removal of .data
> 8) tasklet_init() and helper cast removals.

Ack

> 
> Step 1 needs to happen in an -rc1 (e.g. v5.5-rc1).
> 
> Then steps 2, 3, and 4 can happen simultaneously across all the
> maintainers that need to be aware of it and land in the next release
> (the linux-next for v5.6).
> 
> Finally steps 5, 6, 7, and 8 happen in the next release's -rc1
> (v5.6-rc1).
> 
> If we can get the "phase 1" patch ready quick, maybe we can get into
> -rc2 for v5.4 and move things up by a release...
> 
> -Kees
>

Thanks for your time,

Regards,
Romain

> -- 
> Kees Cook
Kees Cook Oct. 10, 2019, 10:34 p.m. UTC | #3
On Tue, Oct 01, 2019 at 07:47:52PM +0200, Romain Perier wrote:
> 	=> So, one commit per driver for preparing the data structure to
> 	own a sub "struct tasklet_struct" + tasklet_init() ->
> 	tasklet_setup() with use of "from_tasklet" in the same commit.
> 	Right ?
> 
> 	For example:
> 	the commit "[PRE-REVIEW PATCH 03/16] mmc:
> 	renesas_sdhi: Prepare to use the new tasklet API"
> 
> 	would contain changes for preparing the driver to use a
> 	"struct tasklet_struct" correctly + convert the driver to
> 	the new API (tasklet_init() -> tasklet_setup())
> 
> 	Same for commit "[PRE-REVIEW PATCH 04/16] net: liquidio: Prepare
> 	to use the new tasklet API".
> 
> 	This is what you had in mind ?

Right -- the commit would be complete from a "touch-once" perspective.
The one commit completely swaps to the new API and nothing will ever
have to poke this file again. (The exception being any explicit casts
that might be rarely needed for weird direct initialization, etc: most
patches should be entirely self-contained, though they depend on the new
API from patch #1.)

> > 3) Convert DECLARE_TASKLET() users to the same
> 
> Yeah, this is what you explain in reply to "[PRE-REVIEW PATCH 12/16]
> tasklet: Pass tasklet_struct pointer as .data in DECLARE_TASKLET", right
> ?

Right -- after all the other stuff, do the the DECLARE_TASKLET changes,
with a final mechanical patch that drops the unused .data argument from
all the users.

This is all a normally thankless set of patches, so I'll go out of my
way to say again: thank you for working on this! I know how tedious it
can be from when I did timer_struct. :)
Allen Oct. 30, 2019, 8:20 a.m. UTC | #4
Romain,
>
> This is all a normally thankless set of patches, so I'll go out of my
> way to say again: thank you for working on this! I know how tedious it
> can be from when I did timer_struct. :)

 First of all Romain, nice work. I started working on this
set a few months back, but could only carve out limited time.

  I sent out RFC for this sometime in May[1]. And my approach
was a little different when compared to what you have sent on the
list.

 Well, I have pushed my work to github[2], only thing I could
think of as an improvement in your patch set it to break it down
into smaller chunk so that it's easier to review. I have made each
occurrence of tasklet_init() into a commit[3] which I thought would
make it easier to review. I'll leave that decision to you and kees.

Let me know if I could help in any way.

[1] https://www.openwall.com/lists/kernel-hardening/2019/05/06/1
[2] https://github.com/allenpais/tasklet
[3] Sample list of patches:
5d0b728649b6 atm/solos-pci: Convert tasklets to use new tasklet_init API
e5144c3c16d8 atm: Convert tasklets to use new tasklet_init API
71028976d3ed arch/um: Convert tasklets to use new tasklet_init API
c9a39c23b78c xfrm: Convert tasklets to use new tasklet_init API
91d93fe12bbc mac80211: Convert tasklets to use new tasklet_init API
d68f1e9e4531 ipv4: Convert tasklets to use new tasklet_init API
4f9379dcd8ad sound/timer: Convert tasklets to use new tasklet_init API
b4519111b75e drivers/usb: Convert tasklets to use new tasklet_init API
52f04bf54a5a drivers:vt/keyboard: Convert tasklets to use new tasklet_init API
295de7c9812c dma/virt-dma: Convert tasklets to use new tasklet_init API
6c713c83b58f dma/dw: Convert tasklets to use new tasklet_init API
eaaaaba8a4a7 debug:Convert tasklets to use new tasklet_init API
b23f4ff5021b tasklet: prepare to change tasklet API

Thanks,
- Allen
Romain Perier Nov. 7, 2019, 7:29 a.m. UTC | #5
Le mer. 30 oct. 2019 à 09:21, Allen <allen.lkml@gmail.com> a écrit :
>
> Romain,
> >
>
>  First of all Romain, nice work. I started working on this
> set a few months back, but could only carve out limited time.
>
>   I sent out RFC for this sometime in May[1]. And my approach
> was a little different when compared to what you have sent on the
> list.
>
>  Well, I have pushed my work to github[2], only thing I could
> think of as an improvement in your patch set it to break it down
> into smaller chunk so that it's easier to review. I have made each
> occurrence of tasklet_init() into a commit[3] which I thought would
> make it easier to review. I'll leave that decision to you and kees.
>
> Let me know if I could help in any way.
>
> [1] https://www.openwall.com/lists/kernel-hardening/2019/05/06/1
> [2] https://github.com/allenpais/tasklet
> [3] Sample list of patches:
> 5d0b728649b6 atm/solos-pci: Convert tasklets to use new tasklet_init API
> e5144c3c16d8 atm: Convert tasklets to use new tasklet_init API
> 71028976d3ed arch/um: Convert tasklets to use new tasklet_init API
> c9a39c23b78c xfrm: Convert tasklets to use new tasklet_init API
> 91d93fe12bbc mac80211: Convert tasklets to use new tasklet_init API
> d68f1e9e4531 ipv4: Convert tasklets to use new tasklet_init API
> 4f9379dcd8ad sound/timer: Convert tasklets to use new tasklet_init API
> b4519111b75e drivers/usb: Convert tasklets to use new tasklet_init API
> 52f04bf54a5a drivers:vt/keyboard: Convert tasklets to use new tasklet_init API
> 295de7c9812c dma/virt-dma: Convert tasklets to use new tasklet_init API
> 6c713c83b58f dma/dw: Convert tasklets to use new tasklet_init API
> eaaaaba8a4a7 debug:Convert tasklets to use new tasklet_init API
> b23f4ff5021b tasklet: prepare to change tasklet API

From experience, this is better to group bunch of commits like we
currently do with Kees on this series, instead to have one commit per
change (I mean for huge patchset)
Mainly because you have too much replacements with this API change,
and it will be really complicated to merge.

Last time I have proposed an API change for removing "pci_pool" , it
was a patchset of 20 commits (something like this), it tooks 6 months
to be merged :) (with a fine grain granularity on each commit)

This is better to be the more atomic as possible. If we split the "one
massive tasklet_init replacement" commit into many commit, I am sure
that we find old tasklet API for months in the kernel... it is not
something we want , imho.  + treewide commits are common in the kernel
tree, for important API changes :)

@Kees: agreed ?

I think that the timer_list approach is good. You can help by
providing feedbacks and by testing if you want.


Regards,
Romain




>
> Thanks,
> - Allen
Kees Cook Nov. 7, 2019, 9:22 p.m. UTC | #6
On Thu, Nov 07, 2019 at 08:29:40AM +0100, Romain Perier wrote:
> Le mer. 30 oct. 2019 à 09:21, Allen <allen.lkml@gmail.com> a écrit :
> >
> > Romain,
> > >
> >
> >  First of all Romain, nice work. I started working on this
> > set a few months back, but could only carve out limited time.
> >
> >   I sent out RFC for this sometime in May[1]. And my approach
> > was a little different when compared to what you have sent on the
> > list.
> >
> >  Well, I have pushed my work to github[2], only thing I could
> > think of as an improvement in your patch set it to break it down
> > into smaller chunk so that it's easier to review. I have made each
> > occurrence of tasklet_init() into a commit[3] which I thought would
> > make it easier to review. I'll leave that decision to you and kees.
> >
> > Let me know if I could help in any way.
> >
> > [1] https://www.openwall.com/lists/kernel-hardening/2019/05/06/1
> > [2] https://github.com/allenpais/tasklet
> > [3] Sample list of patches:
> > 5d0b728649b6 atm/solos-pci: Convert tasklets to use new tasklet_init API
> > e5144c3c16d8 atm: Convert tasklets to use new tasklet_init API
> > 71028976d3ed arch/um: Convert tasklets to use new tasklet_init API
> > c9a39c23b78c xfrm: Convert tasklets to use new tasklet_init API
> > 91d93fe12bbc mac80211: Convert tasklets to use new tasklet_init API
> > d68f1e9e4531 ipv4: Convert tasklets to use new tasklet_init API
> > 4f9379dcd8ad sound/timer: Convert tasklets to use new tasklet_init API
> > b4519111b75e drivers/usb: Convert tasklets to use new tasklet_init API
> > 52f04bf54a5a drivers:vt/keyboard: Convert tasklets to use new tasklet_init API
> > 295de7c9812c dma/virt-dma: Convert tasklets to use new tasklet_init API
> > 6c713c83b58f dma/dw: Convert tasklets to use new tasklet_init API
> > eaaaaba8a4a7 debug:Convert tasklets to use new tasklet_init API
> > b23f4ff5021b tasklet: prepare to change tasklet API
> 
> From experience, this is better to group bunch of commits like we
> currently do with Kees on this series, instead to have one commit per
> change (I mean for huge patchset)
> Mainly because you have too much replacements with this API change,
> and it will be really complicated to merge.
> 
> Last time I have proposed an API change for removing "pci_pool" , it
> was a patchset of 20 commits (something like this), it tooks 6 months
> to be merged :) (with a fine grain granularity on each commit)
> 
> This is better to be the more atomic as possible. If we split the "one
> massive tasklet_init replacement" commit into many commit, I am sure
> that we find old tasklet API for months in the kernel... it is not
> something we want , imho.  + treewide commits are common in the kernel
> tree, for important API changes :)
> 
> @Kees: agreed ?
> 
> I think that the timer_list approach is good. You can help by
> providing feedbacks and by testing if you want.

It worked well the last time. :)

I think splitting the non-mechanical changes and landing those first is
the right approach. Then we can land a massive treewide for all the
"easy" cases without trickling them in over months.

-Kees