Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2127187pxa; Mon, 17 Aug 2020 01:13:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOhnY7qjxFxarp03PeFMlq1EKGftAh5qvyRlYgnvBOsRxLsa4VLSYqqDeSvRwyLZSsMZln X-Received: by 2002:a50:fb14:: with SMTP id d20mr13324889edq.191.1597652033155; Mon, 17 Aug 2020 01:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597652033; cv=none; d=google.com; s=arc-20160816; b=PGdSUuN2TR9E8ZO3mmGfljhO0vGg1KdBwcGk2DMsKq7uQN26ZS5bugsBQdfHzFrAo8 2IvRZAX4jf6mQKcF2LtLS3gnak+a3wHEUvXQ2mZ/frmUt03d2bytcJ48Mi7OsfAxMMB9 e4K6N1NondApDLN/f2J/E4vzYutKzeCEQ71e0TZJZWJsVit0YLf2Mj+pCa12AFk/7SEL PgIMAoZ3ChhPJ+zb5ZVrutAyDHDtEQzllcSmDntYbScUJNYVWQo7OFfhfrFCyLCvnIu2 Zd4BBxA3BUlp2ZKr6drmRM0rB0T9J3SNsPySdMtj3dhz/r5m+puTGpdVEEMLD7escChU QwMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=pdIJjny9D2jgWVeCI9nYJimGzTera5WNgADtbJ8YXDE=; b=DJOmA5xBwN1iMnxAb8RavWD9xp5PjWGMarDkwzPWXsFbhIRe/THjcR1zNRJzwdrU1t bRTelyfDxFxedSU1hLTIeVnqvEUv7IUgbW7NmR0hm69gy6eGe9d8PMq72l9atCAjCzdh BSAe+aaPVtgVAYXaQZpynWSQVAhc4vcgKPE+Z8CCOXUDxUtjb6km0BmFU5vxyIVbqfnV F6X/3BkgYcLRT37dgzSBpQCM1Ny6m87dBvmYCssauRmcq1X9KqYvvYyz9GhxWGr8DEod V/5UAZEHyZoaLo/7sRFr8cf58lr62fjBl4bHmr5491vrM4nzpPfSVNDiZBbwzaKicdro 4New== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XSjipeYZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 e8si10283335edv.104.2020.08.17.01.13.30; Mon, 17 Aug 2020 01:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=XSjipeYZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1727005AbgHQIKc (ORCPT + 99 others); Mon, 17 Aug 2020 04:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgHQIK2 (ORCPT ); Mon, 17 Aug 2020 04:10:28 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 581B5C061389 for ; Mon, 17 Aug 2020 01:10:27 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id a79so7843486pfa.8 for ; Mon, 17 Aug 2020 01:10:27 -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; bh=pdIJjny9D2jgWVeCI9nYJimGzTera5WNgADtbJ8YXDE=; b=XSjipeYZMmDA8zRg8x2SsXfp2Jhr+d0PlIDgkWlY2tO9bFDJdnAQ40Ua0gtXG/g9kc QHtzYoiLq1/e8E0xhNkuMtoXw+U4ScBKf7Ym2DN5ftUBThFR/RUJKEuWfc1UjegEIHti xF+YmcEboQ6vcnthDllRioUfqz0S7QriDkfmROrrMpdZ6fG91nbW4RO71lXZz61xrWIV L60f1ctUGqRyzK/sWnccUABOBpaXcHAsLACBo7ClFY7s1QvA0a3fZQl0Omr9Gy7kUPYd 4v4+uyxRfPRQMKqpt6oWXNzjLuE4nvp9dixEgispq5w+1/GnNOuPltS95VTjbJY+HusW 5OBQ== 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; bh=pdIJjny9D2jgWVeCI9nYJimGzTera5WNgADtbJ8YXDE=; b=SbFjQbs2ibWo97hjKeai+ZsRcmubnzN7+oexmHH0fz/2ev1R5/XWJRENmY0wlfFXjG ygVJRvfJsMegin/ZRkpBd4POCe7g/1f2k6vA66omg6vFZXRrIU5PIcx4RqCeU3U2A/h5 7Ei4kT5HsHG5exqVUUpXvr0nzIB6j5pTlreOMeyv9uzK9W/Y2sDCOWDkcFnSCbUDL1gK flTSHNAM79+JDdT06lChuWW+ejL8wC6u2dGHjsN17oqMfq4nkjByVGOuaCSxm19MrQRC Rz1BSIv+MPIFsCT4HQr1tkKy5IRHpX4O8i8DCcH3AQZ0FjPenQBMIVExt5pvITM5TtRz 3V+A== X-Gm-Message-State: AOAM532Ij5HBx6fKAK9Mk4vmgZinz8yzBWXNJC3l16xEnOFI5uH8wt0x fn1lqqMh/AljROPIDxya4I8= X-Received: by 2002:a62:f904:: with SMTP id o4mr10820050pfh.14.1597651827314; Mon, 17 Aug 2020 01:10:27 -0700 (PDT) Received: from localhost.localdomain ([49.207.202.98]) by smtp.gmail.com with ESMTPSA id 77sm18499751pfx.85.2020.08.17.01.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 01:10:26 -0700 (PDT) From: Allen Pais To: nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, ludovic.desroches@microchip.com, heiko@sntech.de, matthias.bgg@gmail.com Cc: keescook@chromium.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, inux-mediatek@lists.infradead.org, Allen Pais , Romain Perier Subject: [PATCH 05/19] crypto: cavium: convert tasklets to use new tasklet_setup() API Date: Mon, 17 Aug 2020 13:39:27 +0530 Message-Id: <20200817080941.19227-6-allen.lkml@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817080941.19227-1-allen.lkml@gmail.com> References: <20200817080941.19227-1-allen.lkml@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/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 ++-- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c index a15245992cf9..485105ee3178 100644 --- a/drivers/crypto/cavium/cpt/cptvf_main.c +++ b/drivers/crypto/cavium/cpt/cptvf_main.c @@ -21,10 +21,10 @@ struct cptvf_wqe_info { struct cptvf_wqe vq_wqe[CPT_NUM_QS_PER_VF]; }; -static void vq_work_handler(unsigned long data) +static void vq_work_handler(struct tasklet_struct *t) { - struct cptvf_wqe_info *cwqe_info = (struct cptvf_wqe_info *)data; - struct cptvf_wqe *cwqe = &cwqe_info->vq_wqe[0]; + struct cptvf_wqe *cwqe = from_tasklet(cwqe, t, twork); + struct cptvf_wqe_info *cwqe_info = container_of(cwqe, typeof(*cwqe_info), vq_wqe[0]); vq_post_process(cwqe->cptvf, cwqe->qno); } @@ -45,8 +45,7 @@ static int init_worker_threads(struct cpt_vf *cptvf) } for (i = 0; i < cptvf->nr_queues; i++) { - tasklet_init(&cwqe_info->vq_wqe[i].twork, vq_work_handler, - (u64)cwqe_info); + tasklet_setup(&cwqe_info->vq_wqe[i].twork, vq_work_handler); cwqe_info->vq_wqe[i].qno = i; cwqe_info->vq_wqe[i].cptvf = cptvf; } diff --git a/drivers/crypto/cavium/nitrox/nitrox_common.h b/drivers/crypto/cavium/nitrox/nitrox_common.h index e4be69d7e6e5..f73ae8735272 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_common.h +++ b/drivers/crypto/cavium/nitrox/nitrox_common.h @@ -19,7 +19,7 @@ void nitrox_put_device(struct nitrox_device *ndev); int nitrox_common_sw_init(struct nitrox_device *ndev); void nitrox_common_sw_cleanup(struct nitrox_device *ndev); -void pkt_slc_resp_tasklet(unsigned long data); +void pkt_slc_resp_tasklet(struct tasklet_struct *t); int nitrox_process_se_request(struct nitrox_device *ndev, struct se_crypto_request *req, completion_t cb, diff --git a/drivers/crypto/cavium/nitrox/nitrox_isr.c b/drivers/crypto/cavium/nitrox/nitrox_isr.c index 3dec570a190a..cc6b7c78e070 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_isr.c +++ b/drivers/crypto/cavium/nitrox/nitrox_isr.c @@ -200,9 +200,9 @@ static void clear_bmi_err_intr(struct nitrox_device *ndev) dev_err_ratelimited(DEV(ndev), "BMI_INT 0x%016llx\n", value); } -static void nps_core_int_tasklet(unsigned long data) +static void nps_core_int_tasklet(struct tasklet_struct *t) { - struct nitrox_q_vector *qvec = (void *)(uintptr_t)(data); + struct nitrox_q_vector *qvec = from_tasklet(qvec, t, resp_tasklet); struct nitrox_device *ndev = qvec->ndev; /* if pf mode do queue recovery */ @@ -342,8 +342,7 @@ int nitrox_register_interrupts(struct nitrox_device *ndev) cpu = qvec->ring % num_online_cpus(); irq_set_affinity_hint(vec, get_cpu_mask(cpu)); - tasklet_init(&qvec->resp_tasklet, pkt_slc_resp_tasklet, - (unsigned long)qvec); + tasklet_setup(&qvec->resp_tasklet, pkt_slc_resp_tasklet); qvec->valid = true; } @@ -363,8 +362,7 @@ int nitrox_register_interrupts(struct nitrox_device *ndev) cpu = num_online_cpus(); irq_set_affinity_hint(vec, get_cpu_mask(cpu)); - tasklet_init(&qvec->resp_tasklet, nps_core_int_tasklet, - (unsigned long)qvec); + tasklet_setup(&qvec->resp_tasklet, nps_core_int_tasklet); qvec->valid = true; return 0; @@ -441,8 +439,7 @@ int nitrox_sriov_register_interupts(struct nitrox_device *ndev) cpu = num_online_cpus(); irq_set_affinity_hint(vec, get_cpu_mask(cpu)); - tasklet_init(&qvec->resp_tasklet, nps_core_int_tasklet, - (unsigned long)qvec); + tasklet_setup(&qvec->resp_tasklet, nps_core_int_tasklet); qvec->valid = true; return 0; diff --git a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c index 5826c2c98a50..1c113be87ada 100644 --- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c +++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c @@ -579,9 +579,9 @@ static void process_response_list(struct nitrox_cmdq *cmdq) /** * pkt_slc_resp_tasklet - post processing of SE responses */ -void pkt_slc_resp_tasklet(unsigned long data) +void pkt_slc_resp_tasklet(struct tasklet_struct *t) { - struct nitrox_q_vector *qvec = (void *)(uintptr_t)(data); + struct nitrox_q_vector *qvec = from_tasklet(qvec, t, resp_tasklet); struct nitrox_cmdq *cmdq = qvec->cmdq; union nps_pkt_slc_cnts slc_cnts; -- 2.17.1