From patchwork Mon Jun 25 13:50:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10486223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D860B603B5 for ; Mon, 25 Jun 2018 13:51:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D28BC1FE8A for ; Mon, 25 Jun 2018 13:51:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6F1528389; Mon, 25 Jun 2018 13:51:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A2771FE8A for ; Mon, 25 Jun 2018 13:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755530AbeFYNvJ (ORCPT ); Mon, 25 Jun 2018 09:51:09 -0400 Received: from mail-eopbgr710081.outbound.protection.outlook.com ([40.107.71.81]:57024 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755500AbeFYNvI (ORCPT ); Mon, 25 Jun 2018 09:51:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XaeR8g7EEIr3zSYMaXxn0ZXKAlOfCz8zy8CSHBzc2mQ=; b=bUFFNt+GUI6yfqrZee0xD0xYRgMYa/unZ3sVABUi+zUEUps58l01JkKC0BPFBc+CLvzQ7kmDt8dxYoOLcP7Jgt+C7N4Shc1p143+uUllS/AIeN8wIqlr++BJL/TY14kWqQSyxsFIasRWS/4iVWBqbc/iUqcs2RtVb6IPUMtavcg= Received: from MWHPR03CA0026.namprd03.prod.outlook.com (2603:10b6:301:3b::15) by BN6PR03MB3121.namprd03.prod.outlook.com (2603:10b6:405:3c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.19; Mon, 25 Jun 2018 13:51:06 +0000 Received: from BN1AFFO11FD027.protection.gbl (2a01:111:f400:7c10::167) by MWHPR03CA0026.outlook.office365.com (2603:10b6:301:3b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.19 via Frontend Transport; Mon, 25 Jun 2018 13:51:05 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; osg.samsung.com; dkim=none (message not signed) header.d=none;osg.samsung.com; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta4.analog.com; Received: from nwd2mta4.analog.com (137.71.25.57) by BN1AFFO11FD027.mail.protection.outlook.com (10.58.52.87) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.820.5 via Frontend Transport; Mon, 25 Jun 2018 13:51:04 +0000 Received: from NWD2HUBCAS8.ad.analog.com (nwd2hubcas8.ad.analog.com [10.64.69.108]) by nwd2mta4.analog.com (8.13.8/8.13.8) with ESMTP id w5PDp3AN030398 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK); Mon, 25 Jun 2018 06:51:03 -0700 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS8.ad.analog.com (10.64.69.108) with Microsoft SMTP Server id 14.3.301.0; Mon, 25 Jun 2018 09:51:02 -0400 Received: from saturn.analog.com ([10.50.1.244]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id w5PDotB7004866; Mon, 25 Jun 2018 09:50:56 -0400 From: Alexandru Ardelean To: , , CC: Michael Hennerich , Alexandru Ardelean Subject: [PATCH] net: ieee802154: adf7242: Fix OCL calibration runs Date: Mon, 25 Jun 2018 16:50:28 +0300 Message-ID: <20180625135028.14350-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(376002)(396003)(2980300002)(438002)(199004)(189003)(106466001)(336012)(110136005)(50466002)(7696005)(54906003)(2201001)(106002)(316002)(86362001)(51416003)(26005)(186003)(77096007)(16586007)(1857600001)(53416004)(59450400001)(48376002)(1076002)(246002)(478600001)(4326008)(2906002)(107886003)(47776003)(5660300001)(8936002)(486006)(126002)(50226002)(356003)(7636002)(305945005)(426003)(8676002)(2616005)(36756003)(476003)(44832011)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB3121; H:nwd2mta4.analog.com; FPR:; SPF:Pass; LANG:en; PTR:nwd2mail11.analog.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD027; 1:uVNRG8yuFYkd9l7xB0zzQYjI1jX+A2JF+2A6HeVJ58NcqOrPbvHdTpQfiVwIguHcNt8l0uQo+fRbaOfuwO1j5yzF0QDujw1fXAoYzaGd9miSlNOW7+d24NEdB6FQuDhj X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 04e192b7-9970-43f5-1074-08d5daa2b211 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(4608076)(2017052603328)(7153060); SRVR:BN6PR03MB3121; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3121; 3:qkO0rpqpTvg1de7tVFGGvZMVtTfOK4Wu9LzzXWkKh5001ItzCpM4A+hc8zQM+a3f+jyNtsH1Y53CUBSf6CNEvcsz3WlTj1uLrUVnOz8hHQ9ybRextuzbFLHkTEtUkNbm0NblXi8QqYhg6QgRY/8AH96d0SqWcskJst8S7Vk0CT5dkezzCnZSEVK5avRAmOLoAEAOVmpPm5/1/BfRjLKG1Etyn/8vAGy3ZYghm9MCAYXegRDxOrTBQEmMmyrUqRPKu75V3sz9C5tpl+Tq3tjEOd0SDW37Jv6Xgh9uhxojzcUyh538TRg7jBD22tatbtOfMFsCRKrPlWqfg6M73d0cU/UT1Xqfu/X/ZBrGPoL022s=; 25:laabdvYFKlRYky/TaulhaqhV9SNg+JyfGwtj+8ouyIi0z48FBog0reRa9fajsx/CPBNaxQ+z0wjsOS6uGVKoXZNLfCqR00qOzeCr+M3o0xfC9uX/gs/GidIGILXPc3dLMf2I8xYPTSxRwO8/bG1FlrdpaBTF9V0srC2ezvki5J6YywD36vwXK6YTHR8kRM9/rjrEXyIgrDOz/zNT9BCdSJbQFtX2DkqBudhRj7JOluJ/YrItAf8G68faYTyf9wohAFHBPmuvhLPdMuHhq3BsTwQ3W0y3w578RQMfthcb9jRK2MJPcPgHa9itoYXI9fo62uNHnJUaG4ygr5H6ZesqDg== X-MS-TrafficTypeDiagnostic: BN6PR03MB3121: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3121; 31:n8jZT7nlp2yrErEVnRTB6PughSr9PdfNi2vcERFz7A3ZNrGjI3AYZnl3PiL4OiY6DmnykUKZbXoAivujQ64W7Tfs4ggBu2/DHbOu8uhNxRT8nYk2KJKoUh7fTVQPYJKacgymJOyI057QlBOWmMDm/erXrVWYJMcYoBUdee/YMWzHD/9s2IBRE78LuNCVX6l0K6Yr/NxZ65NkWnNeeUeGuo5F/OmoIzq/z7P+b/DjF2Y=; 20:8883OM2WtPRFz6KzS+pN5QjAYdnOhjnfSeWwjRnYZc1rjlPTDkd9m9b/VX9aGWE/EdSvPMrfL3bCZEHiLO/o/Zkrpgc1C5bsIxWYqFircWihf22buhLkaCb2LGTZj7zwg0VPi8hGboC3RwJDnWjT/Y1sQ8vg0VJS56nEDf1UM5IGH8amNq3pck2s8J+Aaq9w4F9QYfm0oWV8naWwyxLT9KODx3cR7Vifo3XlUMEQKrSRrniy+ABZcfycNjE8PrJM6En68omvYyapzU078zH37H8wKUnz8FEvlrW1XLwkE14ipeAbLGozwz0jMJooCLZxgChXY+wqbHt9s5pvAX/WlEGQY3hnV39LxCNzfUtz4Ha3Dhm0+3eGFifbFFpDCuHNMrc9a+UxsyJY6nRYuFMoDgUwvkz4EBGngETVNtg1tFw41n+jf8tEwNy+R2dpgi27bIGYjZuxQEwscoQ77ntA7k/rz6P9bhy9UuMd54Js5G4akHbwIyq/83g+WC73MyQ1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(232431446821674)(277106579953875); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:BN6PR03MB3121; BCL:0; PCL:0; RULEID:; SRVR:BN6PR03MB3121; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3121; 4:NY211YLQjRjT8XZH22JcOKunkr7njBo5NokgGzwtLHymSFAG4C3F7mdRiS0b0qhdnc23Ee7pOoXqH6HOJ/qM4M/OELgCVaZDB8K/s2VX6FUZWWUC+nd88qDlumkjWjy5wWpwlwNp0MzT6C6hT1CvMqal8MnAd7aZdDZds9fu80ZcoMBjkCia2dA3s+Plf68M7cjbsBXLeB4M/UTApQpTYi1b/NApP2bk+gr+dB72pvJg9c2SfkRTQOBwPms7PDY03+M0wiIRoUan1kCj4H9Ef4IUipVg6Lzq6DLfeiJL2wt7FxszycFa+WfdN9ZT8tzsN2In+4OIDMCyED6lACSwkEWKj7+0QKmUIqBKiNQTJKk= X-Forefront-PRVS: 0714841678 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB3121; 23:j4i00OfGZn9V1G1Gg9U1HDC2VBm0DCS6VuPuIsZ/K?= =?us-ascii?Q?B6N/8tHvBAt/HP3ZFDt8kTJeRAoQh23JTy44y/h7J4VD0nYkAdwiVojoeUZ0?= =?us-ascii?Q?uWGtGgJwMf25+nhapb8X3Depa8nrPlvhIUnFotGLOzOOzkQSaa4u62mcVwqA?= =?us-ascii?Q?JS+rUDQ0efC01lSOhtIdDmehoI0D13LoAnI/j5/vvRZ79PjlZ93EASeuPYvn?= =?us-ascii?Q?nX2yESghRKcFe1Jvh5TBnNgiyvF+e1rFB2IIx13zAS5IpEZD6mMTf0EmgMF+?= =?us-ascii?Q?E9+0vI1olUJFOB9CB3ZFalLhPC5r20zS0vJQD4bgMpL4WwvqDVB71jtIxJN8?= =?us-ascii?Q?CWyhEP8Aqnsiglbbno9Q5Y64r8IjHXi5XRrhLVkb6QUHFjreTnkXEqR+POlK?= =?us-ascii?Q?oaHbTSvVPPi20BnyxZUmAcb0AzeYYV8RiuIirdGFNRtQyguIqQEE38zGIwEM?= =?us-ascii?Q?Fl0vbFdU++CNXUqDvPw81vWWQO5CeYJqbLXMaI/FOP0q3S3P94S6wn2KEZfT?= =?us-ascii?Q?7homoqammEoj8jQMS3oBU2wWXMNgvSICPPbKc/LmoYaaD8oCxTJedNokw0+v?= =?us-ascii?Q?F9WcTZ327PzxLOOsWg3qnnjUGsyNBmyNufj7j1Pia0ITIAe2lXd+qArOPMax?= =?us-ascii?Q?2HyjcwChe6w2yHvIFnokU5iWFfUs1dpmlcE1sxcVqqFcavjT0gOeMrcctx5H?= =?us-ascii?Q?G+fV04Ge5RqFwL88AJBNvnBt7nSlXt+rXGlHS/S1fImyRRYljaRGF5f1qAlQ?= =?us-ascii?Q?w/3pJdM91A+xBCI5SvblflplUakfu5+yNpTk1+hZK5r14tYiHF/1rZnPM2Ed?= =?us-ascii?Q?rwdNqsWYoHOCfbjXeJRKpcc4aVPxwCXbVtTn0rn4uTrwB86uvJrVBz93+v7T?= =?us-ascii?Q?ijccx5vQgnc7uSW+TQRxjMSQTRs/5amXA21wjupzevpNvwntkJKsjlRlRYba?= =?us-ascii?Q?uoo99CITOOZFkMEMlAZ1UiAn6ukYnbM8UY6pJRa2C7LI+7rZzucB7+Vtov1H?= =?us-ascii?Q?I4g4Yp0lNp4EdVCnRudiDQ9UcD7JtZoQlWIFI+KvcmaJR7YEj/RG40v+KAkQ?= =?us-ascii?Q?Tu+IIqsWjS0zNiO4hcJk7XLWAg9XxQh5K+RwbtkJNOg8kT9HG1N8IRjbUw+v?= =?us-ascii?Q?H+ot/qEKc4=3D?= X-Microsoft-Antispam-Message-Info: vELNzwm5gXClCRFhfAumBRY9e/Y356R7QBUJeQ81wZGY4k9CfG5q/rl9a82RA8ihpBzMcbgNwn2EI8ihMfzjuFQXj+LbvWR8ymjK4H1Dx7TD4sc1hzLaHov1LjGd2TU8JSY2FKwMSpzSo505cXBf06fb8gyrpBxTDPuGZnWtP5QTaE+kwVLlFRKVjVU2vM0PQjm0ri73UrDIGxd3f2Vbk4Sg/m4uSX4+kr2PC+31YBHlzTq9VCAmhSgtDVec+VWFDwDucE9q3vjLJhyaW6f2d2uZopGnbGXLVU4LnJVSqdFcSt4lZiPEi9S5gqlAyHl08hJJk0TfuLWgYUGK1NUqE1XhYDt32xK6WyVGntCj3Fo= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3121; 6:OqWBgFHEV+OueZfEzfd04xaSwN3alM8EK73FKMdwCiawjAFb4U2nNW87J4W5kigSD0+zCMMvuEWruqv+88TXQH8rmkNk/2cc2mwh6S9qPRITieeeFxtgFYfMsgovVxowmKfAzNYnZW8c0xvaTCmThcr+QHY/YJDxvPqbLT/N91NsvCfDOMdcsNc4+F/Zo1ERZPreo/5AkhYPA9AqtJ11N/xDDTgAlTYtr1KDHVL46/58uRJ+kOwZcbgpsWJyyCsge0r1dlq/ybCxYkF2nbZ9g7NN3LM2ZyNy3fHHqaoE25c+nPmpgIS38M7YFhhJbSSuTEYxYHUmFWvWe0K5SeAVNSYq326mqyOTDmD+Q/LTfMWF5HRKgR3lePfdA4p9oKsrIw5u48kcavyaSe178wDR5RTlXibemZXYyk0JSyIGg498Y3AIDYLdZFKpG/JUYSrDHd1kr38m89FdtWylgGRs2A==; 5:lAFkghPYHV7r6MyAhhAiUXoM1pBspSMBLoyb4lmV5VVYu3vqP17D+YZdYJfTNo+JcGBdtg/iyCT08XCS3ZUI7oeGl+/v40GfEp5C2awD/Pil4/QjVhq3LnAm3uvrw6f2Paeg8uoeU/TdV/QJ/kFjKHWf17tO5LDJCjfAkQu0VDI=; 24:sHUFqsEsxjwLjf/2cwstB2wAyIdjaMds2F+GZT8sDMMxVHXeciIugbZSl6OLqpeo04EonB5dx7ypQo4helcqACpgwnvd7pdlObEXsfgRlGs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3121; 7:QL+ISVhVyry9JdVh2Airzqe7bUy48Ud/A3hhpnL4wo37DyVUnqzSrZxlNa7OfCeS29/aWwjb4avKBSdsZI2z6Ob5YOZRUbdk0hZWO/xT8JvAVbAy2Q6KgfodLMxYFNobSqZr8Zt7KC4uzE0RI16zVTDS+5J7HuPMJmYUQQyyVe7Rg/ukPH2KZS5gX5Px7YQaxYMqrJKJwf1CZ/uADw3UsmUYri6y43/KncGVqlxwcQqy0egx2/WFb2sUH0YNWmju X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2018 13:51:04.8565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 04e192b7-9970-43f5-1074-08d5daa2b211 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a; Ip=[137.71.25.57]; Helo=[nwd2mta4.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB3121 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Hennerich Reissuing RC_RX every 400ms - to adjust for offset drift in receiver see datasheet page 61, OCL section. Signed-off-by: Michael Hennerich Signed-off-by: Alexandru Ardelean --- drivers/net/ieee802154/adf7242.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c index 64f1b1e77bc0..3e85e9500233 100644 --- a/drivers/net/ieee802154/adf7242.c +++ b/drivers/net/ieee802154/adf7242.c @@ -275,6 +275,8 @@ struct adf7242_local { struct spi_message stat_msg; struct spi_transfer stat_xfer; struct dentry *debugfs_root; + struct delayed_work work; + struct workqueue_struct *wqueue; unsigned long flags; int tx_stat; bool promiscuous; @@ -575,10 +577,27 @@ static int adf7242_cmd_rx(struct adf7242_local *lp) /* Wait until the ACK is sent */ adf7242_wait_status(lp, RC_STATUS_PHY_RDY, RC_STATUS_MASK, __LINE__); adf7242_clear_irqstat(lp); + mod_delayed_work(lp->wqueue, &lp->work, msecs_to_jiffies(400)); return adf7242_cmd(lp, CMD_RC_RX); } +static void adf7242_rx_cal_work(struct work_struct *work) +{ + struct adf7242_local *lp = + container_of(work, struct adf7242_local, work.work); + + /* + * Reissuing RC_RX every 400ms - to adjust for offset + * drift in receiver (datasheet page 61, OCL section) + */ + + if (!test_bit(FLAG_XMIT, &lp->flags)) { + adf7242_cmd(lp, CMD_RC_PHY_RDY); + adf7242_cmd_rx(lp); + } +} + static int adf7242_set_txpower(struct ieee802154_hw *hw, int mbm) { struct adf7242_local *lp = hw->priv; @@ -686,7 +705,7 @@ static int adf7242_start(struct ieee802154_hw *hw) enable_irq(lp->spi->irq); set_bit(FLAG_START, &lp->flags); - return adf7242_cmd(lp, CMD_RC_RX); + return adf7242_cmd_rx(lp); } static void adf7242_stop(struct ieee802154_hw *hw) @@ -694,6 +713,7 @@ static void adf7242_stop(struct ieee802154_hw *hw) struct adf7242_local *lp = hw->priv; disable_irq(lp->spi->irq); + cancel_delayed_work_sync(&lp->work); adf7242_cmd(lp, CMD_RC_IDLE); clear_bit(FLAG_START, &lp->flags); adf7242_clear_irqstat(lp); @@ -814,6 +834,7 @@ static int adf7242_xmit(struct ieee802154_hw *hw, struct sk_buff *skb) /* ensure existing instances of the IRQ handler have completed */ disable_irq(lp->spi->irq); set_bit(FLAG_XMIT, &lp->flags); + cancel_delayed_work_sync(&lp->work); reinit_completion(&lp->tx_complete); adf7242_cmd(lp, CMD_RC_PHY_RDY); adf7242_clear_irqstat(lp); @@ -952,6 +973,7 @@ static irqreturn_t adf7242_isr(int irq, void *data) unsigned int xmit; u8 irq1; + mod_delayed_work(lp->wqueue, &lp->work, msecs_to_jiffies(400)); adf7242_read_reg(lp, REG_IRQ1_SRC1, &irq1); if (!(irq1 & (IRQ_RX_PKT_RCVD | IRQ_CSMA_CA))) @@ -1241,6 +1263,8 @@ static int adf7242_probe(struct spi_device *spi) spi_message_add_tail(&lp->stat_xfer, &lp->stat_msg); spi_set_drvdata(spi, lp); + INIT_DELAYED_WORK(&lp->work, adf7242_rx_cal_work); + lp->wqueue = alloc_ordered_workqueue(dev_name(&spi->dev), WQ_MEM_RECLAIM); ret = adf7242_hw_init(lp); if (ret) @@ -1284,6 +1308,9 @@ static int adf7242_remove(struct spi_device *spi) if (!IS_ERR_OR_NULL(lp->debugfs_root)) debugfs_remove_recursive(lp->debugfs_root); + cancel_delayed_work_sync(&lp->work); + destroy_workqueue(lp->wqueue); + ieee802154_unregister_hw(lp->hw); mutex_destroy(&lp->bmux); ieee802154_free_hw(lp->hw);