Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp275957pxb; Wed, 27 Jan 2021 07:30:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjFofAIYHSj0Z0Tm3FnxoB6D2MdTs0MP+2jOd/7NYJ2+ni5oYQRAScRAy2Bs8Jp6hbg5PB X-Received: by 2002:a05:6402:22e9:: with SMTP id dn9mr9524628edb.61.1611761406350; Wed, 27 Jan 2021 07:30:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611761406; cv=none; d=google.com; s=arc-20160816; b=iH8CFEr7/k+qwKz2bHTZeF0oCFf1462rflwIsw76oSUzi2A3QDXWChpryK1A2Jzcma gcSkRxOR89xZ8CQhrqDzQJD2YTlV1Cu3UkuRpT00ya1rd0T96Me5HmhDuXNs23hdPCAT vW+wwr8Hypfg6dJbFkqPsCMNFNntBI94zhFmTWukMAJEdpK3tmyrnUdgezqacX0W2G9L uLOZP9yH4qCCMi5R4dljz1Mw1r5PvpC34bzPVYzjo6d4RRIFrLhKt5uxYU1Y74q2qIzf eKxMVa5PY390ITefpIfKUpzfSzc6vn37S6iXCCjfXlDPGgQIPF+yBSv+sZJun/1BSkzT K2OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=g7J7YInXRf+vZfRSfEQpz6oEhJ+wLQcyQNNaVNH5HFY=; b=yvGu+6myfnLFi9SzTYDviLRkqr69/S79CwKHho7i1NgXcSmT1jjtoT/58xFC9EmHe2 AxcgeqVdCzfnM5ReqSc/KQtvC6iKSbGVgRZyPGinSjU2T5KrPbsjYWxzA9YzxR/IjcEx le1MPsF14n1xxMKo9VkxAlaOVtHLNadu4Jv26wtVqRsP/GIC1Kxj1yzcXSTMF0nCcRu0 hztNVKAkgDOOQh7c/aLzINKpZHGpMg6hM21Pr8IQzVrn65F3joXzsNqIqN7ba2KixhoK tExbcKKlFdlJRM7s6ELLg41PrwCtcf3jVXWwIYGeF6dgAJts7fYeB+YDZS9fLCsiB2s4 pEjQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si1004044ejc.697.2021.01.27.07.29.35; Wed, 27 Jan 2021 07:30:06 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343808AbhA0P1v (ORCPT + 99 others); Wed, 27 Jan 2021 10:27:51 -0500 Received: from mail-yb1-f176.google.com ([209.85.219.176]:46330 "EHLO mail-yb1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236004AbhA0P0c (ORCPT ); Wed, 27 Jan 2021 10:26:32 -0500 Received: by mail-yb1-f176.google.com with SMTP id e206so2330496ybh.13; Wed, 27 Jan 2021 07:26:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=g7J7YInXRf+vZfRSfEQpz6oEhJ+wLQcyQNNaVNH5HFY=; b=E3ObrQSskLNveWMs/JrnXSzo06UziGDWOK+BX4AdfhdtZeIMisOoTxuf1X0dJOUqTC 8qhlh7HYWhjrgXucSJHTBGUxm26lnNkiwN6y4LC5EabqXZ55Q1grVlndZrH0xygjQ88Y 5CD0OQGTqCePr7XMOZJPfOE/i0+4vxwZYzLcqzB9+SGJ+ujYayHSMrW5kX+P7+eo4pSu 2bJt/7P1PlZbTVUnQKG0igje1I4cA+apkEmd2EYyiLu+D0zQSiL1dFyuNt8OityvVxmD 4mjllzy9hFAerYHSiewmtZnACXYZWQGvdFnbw7JokXS+Zq/TzHPcgTSX9m96hGQRypJY 9dWQ== X-Gm-Message-State: AOAM531f3HJ0RJxIoRIzM+6Eg8RfmPOMJv5AdXP29xtn9x8Vu4xH+/00 Sklj4eNgTuPpNpBCx3wXCH9JmUYmzrIHf8DMW+8= X-Received: by 2002:a25:7783:: with SMTP id s125mr5616478ybc.111.1611761151447; Wed, 27 Jan 2021 07:25:51 -0800 (PST) MIME-Version: 1.0 References: <20210126171550.3066-1-kernel@esmil.dk> <87pn1q8l0t.fsf@codeaurora.org> In-Reply-To: <87pn1q8l0t.fsf@codeaurora.org> From: Emil Renner Berthing Date: Wed, 27 Jan 2021 16:25:39 +0100 Message-ID: Subject: Re: [PATCH] rtlwifi: use tasklet_setup to initialize rx_work_tasklet To: Kalle Valo Cc: Willem de Bruijn , linux-wireless , Network Development , Ping-Ke Shih , "David S. Miller" , Jakub Kicinski , Allen Pais , Romain Perier , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 27 Jan 2021 at 16:20, Kalle Valo wrote: > > Willem de Bruijn writes: > > > On Wed, Jan 27, 2021 at 5:23 AM Emil Renner Berthing wrote: > >> > >> In commit d3ccc14dfe95 most of the tasklets in this driver was > >> updated to the new API. However for the rx_work_tasklet only the > >> type of the callback was changed from > >> void _rtl_rx_work(unsigned long data) > >> to > >> void _rtl_rx_work(struct tasklet_struct *t). > >> > >> The initialization of rx_work_tasklet was still open-coded and the > >> function pointer just cast into the old type, and hence nothing sets > >> rx_work_tasklet.use_callback = true and the callback was still called as > >> > >> t->func(t->data); > >> > >> with uninitialized/zero t->data. > >> > >> Commit 6b8c7574a5f8 changed the casting of _rtl_rx_work a bit and > >> initialized t->data to a pointer to the tasklet cast to an unsigned > >> long. > >> > >> This way calling t->func(t->data) might actually work through all the > >> casting, but it still doesn't update the code to use the new tasklet > >> API. > >> > >> Let's use the new tasklet_setup to initialize rx_work_tasklet properly > >> and set rx_work_tasklet.use_callback = true so that the callback is > >> called as > >> > >> t->callback(t); > >> > >> without all the casting. > >> > >> Fixes: 6b8c7574a5f8 ("rtlwifi: fix build warning") > >> Fixes: d3ccc14dfe95 ("rtlwifi/rtw88: convert tasklets to use new > >> tasklet_setup() API") > >> Signed-off-by: Emil Renner Berthing > > > > Since the current code works, this could target net-next > > This should go to wireless-drivers-next, not net-next. > > > without Fixes tags. > > Correct, no need for Fixes tag as there's no bug to fix. This is only > cleanup AFAICS. I can definitely see how you can reasonably disagree, but I would not be comfortable having code that only works because the calling conventions of all relevant architectures happen to put the first unsigned long argument and the first pointer argument in the same register. If you want to be conservative I'd much rather revert all the changes around rx_work_tasklet including the new type of the _rtl_rx_work callback, so we don't have to rely on calling conventions matching up. In any case: as long as this fix eventually ends up upstream I'm fine. /Emil