Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp26941pxu; Mon, 5 Oct 2020 22:54:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5+ql99aU0XgPrVrA2lRxzFb16YY0OICpQhnUI/mKJ2J6j4kFSyzOjoX66S7AyHgPDt89k X-Received: by 2002:a05:6402:b72:: with SMTP id cb18mr3444317edb.129.1601963640185; Mon, 05 Oct 2020 22:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601963640; cv=none; d=google.com; s=arc-20160816; b=UedxRiF3zgHZCfgnCkv/zqfOp/+L1N4ooIyYY9onAk64XgRVmKvHwIlbLwsWbqSVB2 jhEYIeDGoIom5YuYrI2qo80H4PV8KYWKinWRjCZ++QVtC8C44/5nmwQ88wO6Brlto1LZ UOFYMlUJMxVNUO5V4SaTG984tq9JyUoNskQeFWCAQfumvHlsN+6zQMqesJBUOAeJcAMQ rlQmbPgGALX8Vm8SYPy5WPI8Z/yFvaBq38hVSpm3vdVU+DBSm6Leil0NL0syw6Z/U9Ow yhgQsaDQ1GCaKAfIU8srouZQbZIlxLr8p2XfDQRnrmJEaqmIUEhO1MDD5dmnevznaf5M 5Emw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=L9S6dNgcY2hOWdZzm9r/z3rxfbvgfnUp4lHemfjXmvs=; b=pgU29/40eIw4SqFLHWy0tno5ZO4G7oe4dXxlbPElO3Zu0G2SCx5RE2oUjabV4uV0BA zWYzKffHFoUZ2Q+GGxkp/o06/iVxpXrCmqvuERlvmSCVszFZzeY4RT/2EkuCuUnSw6L+ XegsgqiExavZNMyn1z37Mn3I+zc4n0KF5uarQ63BA6dvGlWSMpcNGFVUnVYr3LhrwfOJ bP2iZtSmQIKKPbe4IlqIzEMBTsxTSGOqmi7UGFugSrziKWrwyU6GDPF2Sy+qBmzRd2QN f+VzuEoruwSusB+ZBOA7qs3+/ly3i12GwxS4rZ+5fJvcsxUsRouNCh0ARRmc8TAb4pYT b4iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iu2qxx7n; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca16si1554137edb.546.2020.10.05.22.53.35; Mon, 05 Oct 2020 22:54:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iu2qxx7n; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726957AbgJFFv7 (ORCPT + 99 others); Tue, 6 Oct 2020 01:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbgJFFv7 (ORCPT ); Tue, 6 Oct 2020 01:51:59 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A85C0613A7; Mon, 5 Oct 2020 22:51:59 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id y20so676481pll.12; Mon, 05 Oct 2020 22:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L9S6dNgcY2hOWdZzm9r/z3rxfbvgfnUp4lHemfjXmvs=; b=iu2qxx7nqszWCRF/0Wc5RWPNPoD6uWpkxddKEUAPCelJuijptrzlh78J0XtBpJ/Y+E 9fengwvC+qDHKnHhBKasCJ3OMsiw731lPe/bOQqcRpawALLukCuO5+8nqFCFaqtZroyX oyfKJdpmkeoJsbr4EcGF9eyUAEuI1yr6jZwcK4w0vrEBMUqcHPTWh3NIapGQ4ApGE2u3 uPGDl8OypCkyQZ3HvuRapMd4N4lMqr3Ywnz4qkVDgQaMMoCWGymKnxUe92GVsT6e6ePu RJwj86ebQ8n4lQkiXLdxz7sLUDHr84T8g25iHcansB0SjgDlQPkBwo4HDrH82not8IM4 D1yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L9S6dNgcY2hOWdZzm9r/z3rxfbvgfnUp4lHemfjXmvs=; b=ZjF7PVR31yPJwqGQd/YLf2FfDCgm+7kjbRv4gQ3Ui3OYM9CLmoiXUocjvimPe4AkIn J+u3mwv9xnP1PDhq7W9kV9hTDrHoZKzoIHQ/dWqaFUqM4uZZzJIA8Jhq0AK9V5ojdliE 7wdOa9979gPrgJjeSzntKzVSG2vNoPLBB1IrNiQvmed6rwMSE2tplzMUlOMCH+8lTx0o W+AJ8NcXDBKjXQAks5uFzQnO0owp92NuS4uVc++ya3aECb18sOIVNVCh1pKQl4JlEEoZ HxBLtmNQGFWh/JbpQ6Xe3eiqtb8UgoI89RVOa4IvjKXnEZ8XarO3cXuSSUkirbhnM6Wc JECg== X-Gm-Message-State: AOAM533jjrAgWyDLawwZHfbjUjyAmzfLY319GGmfXkbw5hjIT18smYCA kFe9wYlg97TugPF8gTaYyno= X-Received: by 2002:a17:902:c394:b029:d2:4ca:2e22 with SMTP id g20-20020a170902c394b02900d204ca2e22mr1817746plg.77.1601963519051; Mon, 05 Oct 2020 22:51:59 -0700 (PDT) Received: from localhost.localdomain ([49.207.203.202]) by smtp.gmail.com with ESMTPSA id x6sm1413685pjp.25.2020.10.05.22.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 22:51:58 -0700 (PDT) From: Allen Pais To: kvalo@codeaurora.org Cc: davem@davemloft.net, nbd@nbd.name, lorenzo.bianconi83@gmail.com, ryder.lee@mediatek.com, kuba@kernel.org, matthias.bgg@gmail.com, ath11k@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Allen Pais , Romain Perier Subject: [PATCH 2/2] wireless: mt76: convert tasklets to use new tasklet_setup() API Date: Tue, 6 Oct 2020 11:21:35 +0530 Message-Id: <20201006055135.291411-3-allen.lkml@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201006055135.291411-1-allen.lkml@gmail.com> References: <20201006055135.291411-1-allen.lkml@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Allen Pais In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly. Signed-off-by: Romain Perier Signed-off-by: Allen Pais --- drivers/net/wireless/mediatek/mt76/mt7603/beacon.c | 4 ++-- drivers/net/wireless/mediatek/mt76/mt7603/init.c | 3 +-- drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mmio.c | 6 +++--- drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c | 10 +++++----- drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 7 +++---- drivers/net/wireless/mediatek/mt76/usb.c | 6 +++--- drivers/net/wireless/mediatek/mt7601u/dma.c | 12 ++++++------ 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c index d728c5e43..53c229cad 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/beacon.c @@ -64,9 +64,9 @@ mt7603_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif) data->count[mvif->idx]++; } -void mt7603_pre_tbtt_tasklet(unsigned long arg) +void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t) { - struct mt7603_dev *dev = (struct mt7603_dev *)arg; + struct mt7603_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet); struct mt76_queue *q; struct beacon_bc_data data = {}; struct sk_buff *skb; diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/init.c b/drivers/net/wireless/mediatek/mt76/mt7603/init.c index c4848fafd..126f7c95f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/init.c @@ -533,8 +533,7 @@ int mt7603_register_device(struct mt7603_dev *dev) spin_lock_init(&dev->ps_lock); INIT_DELAYED_WORK(&dev->mt76.mac_work, mt7603_mac_work); - tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet, - (unsigned long)dev); + tasklet_setup(&dev->mt76.pre_tbtt_tasklet, mt7603_pre_tbtt_tasklet); dev->slottime = 9; dev->sensitivity_limit = 28; diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h index 2a6e4332a..6e0a92a28 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h @@ -256,7 +256,7 @@ void mt7603_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif, void mt7603_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, struct ieee80211_sta *sta); -void mt7603_pre_tbtt_tasklet(unsigned long arg); +void mt7603_pre_tbtt_tasklet(struct tasklet_struct *t); void mt7603_update_channel(struct mt76_dev *mdev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c index 6de492a4c..b108324aa 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c @@ -98,9 +98,9 @@ static irqreturn_t mt7615_irq_handler(int irq, void *dev_instance) return IRQ_HANDLED; } -static void mt7615_irq_tasklet(unsigned long data) +static void mt7615_irq_tasklet(struct tasklet_struct *t) { - struct mt7615_dev *dev = (struct mt7615_dev *)data; + struct mt7615_dev *dev = from_tasklet(dev, t, irq_tasklet); u32 intr, mask = 0, tx_mcu_mask = mt7615_tx_mcu_int_mask(dev); mt76_wr(dev, MT_INT_MASK_CSR, 0); @@ -203,7 +203,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, dev = container_of(mdev, struct mt7615_dev, mt76); mt76_mmio_init(&dev->mt76, mem_base); - tasklet_init(&dev->irq_tasklet, mt7615_irq_tasklet, (unsigned long)dev); + tasklet_setup(&dev->irq_tasklet, mt7615_irq_tasklet); dev->reg_map = map; dev->ops = ops; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c index b29cd39dc..a60135053 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c @@ -609,10 +609,11 @@ static void mt76x02_dfs_check_event_window(struct mt76x02_dev *dev) } } -static void mt76x02_dfs_tasklet(unsigned long arg) +static void mt76x02_dfs_tasklet(struct tasklet_struct *t) { - struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; - struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; + struct mt76x02_dfs_pattern_detector *dfs_pd = from_tasklet(dfs_pd, t, + dfs_tasklet); + struct mt76x02_dev *dev = container_of(dfs_pd, typeof(*dev), dfs_pd); u32 engine_mask; int i; @@ -860,8 +861,7 @@ void mt76x02_dfs_init_detector(struct mt76x02_dev *dev) INIT_LIST_HEAD(&dfs_pd->seq_pool); dev->mt76.region = NL80211_DFS_UNSET; dfs_pd->last_sw_check = jiffies; - tasklet_init(&dfs_pd->dfs_tasklet, mt76x02_dfs_tasklet, - (unsigned long)dev); + tasklet_setup(&dfs_pd->dfs_tasklet, mt76x02_dfs_tasklet); } static void diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c index cf68731bd..67911c021 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c @@ -11,9 +11,9 @@ #include "mt76x02_mcu.h" #include "trace.h" -static void mt76x02_pre_tbtt_tasklet(unsigned long arg) +static void mt76x02_pre_tbtt_tasklet(struct tasklet_struct *t) { - struct mt76x02_dev *dev = (struct mt76x02_dev *)arg; + struct mt76x02_dev *dev = from_tasklet(dev, t, mt76.pre_tbtt_tasklet); struct mt76_queue *q = dev->mt76.q_tx[MT_TXQ_PSD]; struct beacon_bc_data data = {}; struct sk_buff *skb; @@ -198,8 +198,7 @@ int mt76x02_dma_init(struct mt76x02_dev *dev) return -ENOMEM; dev->mt76.tx_worker.fn = mt76x02_tx_worker; - tasklet_init(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet, - (unsigned long)dev); + tasklet_setup(&dev->mt76.pre_tbtt_tasklet, mt76x02_pre_tbtt_tasklet); spin_lock_init(&dev->txstatus_fifo_lock); kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size); diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c index 7d3f0a2e5..911fb61df 100644 --- a/drivers/net/wireless/mediatek/mt76/usb.c +++ b/drivers/net/wireless/mediatek/mt76/usb.c @@ -669,9 +669,9 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q) mt76_rx_poll_complete(dev, MT_RXQ_MAIN, NULL); } -static void mt76u_rx_tasklet(unsigned long data) +static void mt76u_rx_tasklet(struct tasklet_struct *t) { - struct mt76_dev *dev = (struct mt76_dev *)data; + struct mt76_dev *dev = from_tasklet(dev, t, usb.rx_tasklet); int i; rcu_read_lock(); @@ -1110,7 +1110,7 @@ int mt76u_init(struct mt76_dev *dev, mt76u_ops.write_copy = ext ? mt76u_copy_ext : mt76u_copy; dev->tx_worker.fn = mt76u_tx_worker; - tasklet_init(&usb->rx_tasklet, mt76u_rx_tasklet, (unsigned long)dev); + tasklet_setup(&usb->rx_tasklet, mt76u_rx_tasklet); INIT_WORK(&usb->stat_work, mt76u_tx_status_data); usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1); diff --git a/drivers/net/wireless/mediatek/mt7601u/dma.c b/drivers/net/wireless/mediatek/mt7601u/dma.c index 09f931d45..5f99054f5 100644 --- a/drivers/net/wireless/mediatek/mt7601u/dma.c +++ b/drivers/net/wireless/mediatek/mt7601u/dma.c @@ -212,9 +212,9 @@ static void mt7601u_complete_rx(struct urb *urb) spin_unlock_irqrestore(&dev->rx_lock, flags); } -static void mt7601u_rx_tasklet(unsigned long data) +static void mt7601u_rx_tasklet(struct tasklet_struct *t) { - struct mt7601u_dev *dev = (struct mt7601u_dev *) data; + struct mt7601u_dev *dev = from_tasklet(dev, t, rx_tasklet); struct mt7601u_dma_buf_rx *e; while ((e = mt7601u_rx_get_pending_entry(dev))) { @@ -266,9 +266,9 @@ static void mt7601u_complete_tx(struct urb *urb) spin_unlock_irqrestore(&dev->tx_lock, flags); } -static void mt7601u_tx_tasklet(unsigned long data) +static void mt7601u_tx_tasklet(struct tasklet_struct *t) { - struct mt7601u_dev *dev = (struct mt7601u_dev *) data; + struct mt7601u_dev *dev = from_tasklet(dev, t, tx_tasklet); struct sk_buff_head skbs; unsigned long flags; @@ -507,8 +507,8 @@ int mt7601u_dma_init(struct mt7601u_dev *dev) { int ret = -ENOMEM; - tasklet_init(&dev->tx_tasklet, mt7601u_tx_tasklet, (unsigned long) dev); - tasklet_init(&dev->rx_tasklet, mt7601u_rx_tasklet, (unsigned long) dev); + tasklet_setup(&dev->tx_tasklet, mt7601u_tx_tasklet); + tasklet_setup(&dev->rx_tasklet, mt7601u_rx_tasklet); ret = mt7601u_alloc_tx(dev); if (ret) -- 2.25.1