From patchwork Tue Jan 28 18:21:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952852 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3575A1D9694; Tue, 28 Jan 2025 18:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088521; cv=none; b=IxBW2hecuTvSM5K9p0y1VsyLPbJCaIGLxCyjzQ9NF23f+sW7kpAAa4N4y6INcA07dWLVtzYih5XZAKDlgmP1jD98yfWrG3xmg5sLgvPtwNPN6U/h/EQYTyKvPtboYAQTgAqyk5w7BlDjXM/iDh7dgNEOBXKuXbbzuE5zoXb4qV8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088521; c=relaxed/simple; bh=i1gF+KzTeeLc+I/VqC4kKiZ7dNaJzjT1GEHojaiXSI4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=saDJ12eOsiE6VnDtDTgNkKFvrtX9iSeZUcxYs38T0x27JaPrG7h2lHoI9yGah8ej3FpGz5Aj97JiBCfqKQXQKodxzcpD5U8eTojLx4pvIZeXZYEs1DWsJuG6466rQOc4mX2v+yl5I4q///iJplBRGsXkZrXbFaUlc0D5oxlOYYM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=MpuX2sNp; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="MpuX2sNp" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 82D962037176; Tue, 28 Jan 2025 10:21:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 82D962037176 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088517; bh=rV0pV6uCo+L2WatPjWritu1rnlahIFpB3WVk2Ubag/g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=MpuX2sNpGSPCvn8+X9FT8BIYX1CfONbQBAPmYcXzwcby57+iq8EKvUSw9yit4i+7h dPFF//UAxR4uzIgeiuRZT3KuJxDL9DDxO1Shj3JGkr9ECePLei7FWUPWNCb9Vm85BJ TYvfPkoReBWVf1lpVq62IZLjI7cVTJ7HW4ILEEko= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:46 +0000 Subject: [PATCH 01/16] coccinelle: misc: secs_to_jiffies: Patch expressions too Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-1-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Teach the script to suggest conversions for timeout patterns where the arguments to msecs_to_jiffies() are expressions as well. Signed-off-by: Easwar Hariharan --- scripts/coccinelle/misc/secs_to_jiffies.cocci | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/coccinelle/misc/secs_to_jiffies.cocci b/scripts/coccinelle/misc/secs_to_jiffies.cocci index 8bbb2884ea5db939c63fd4513cf5ca8c977aa8cb..ab9880d239f7d2a8d56a481a2710369e1082e16e 100644 --- a/scripts/coccinelle/misc/secs_to_jiffies.cocci +++ b/scripts/coccinelle/misc/secs_to_jiffies.cocci @@ -11,12 +11,22 @@ virtual patch -@depends on patch@ constant C; @@ +@depends on patch@ +constant C; +@@ -- msecs_to_jiffies(C * 1000) -+ secs_to_jiffies(C) +-msecs_to_jiffies ++secs_to_jiffies + (C +- * \( 1000 \| MSEC_PER_SEC \) + ) -@depends on patch@ constant C; @@ +@depends on patch@ +expression E; +@@ -- msecs_to_jiffies(C * MSEC_PER_SEC) -+ secs_to_jiffies(C) +-msecs_to_jiffies ++secs_to_jiffies + (E +- * \( 1000 \| MSEC_PER_SEC \) + ) From patchwork Tue Jan 28 18:21:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952850 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6586C1DE883; Tue, 28 Jan 2025 18:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088520; cv=none; b=kermLJdDC24Le3ErYD6irVjlVppoB0LGp2wMFAJrZ3IkIFVrO+e26loZ382p7+h3bSFGtrCGxBmpEQTbjFsLjsYZsJE6G1gZiaAo0XU0s3tEp2z9RGVl62deOq30BvJ+XFtCJlhthNX7NU4FUalG85Os61NSCQrpTsgnwV+TXJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088520; c=relaxed/simple; bh=iIQzJX8f/eC7FsZxb8QYjCqjWvaS61qp8B1ScA7VBzg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rGbFyLdyJO4u4d6QE2PfIcfikahDBI58RaeUMFPFoTssOtEfHwchjnv+CvWigWDuOmpmY62udc6yyE6lP7RA0wRWk2Lx3OcjZiJ224UijUaEdEQWnxSHJOVaRT4Zwd+MQiDWBWM9mStmaPk0lKb37X2gv3E4m/GnazdduPVMarU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=na5TgR7E; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="na5TgR7E" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id A5F412037178; Tue, 28 Jan 2025 10:21:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A5F412037178 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088517; bh=Wadsy2NxJXxqQ+ZbhJ1ZiEC/4XRrTap5C0/XqtGuMu0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=na5TgR7ElKwogZ/k+Z0ybAln+R1AMEzKcOKd3gVcuZRiyqr/iXkxm5sB4wdMicFT8 5cV0NYPUXQT7qjedQEwyZQIdf7RjebrBopNTxrugtd5gFZqW8w6LS7rzpaEmz3HAP1 6iPQpwjqyuRZVEMFlWOaUeR52txcp6jerxVEtbhM= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:47 +0000 Subject: [PATCH 02/16] scsi: lpfc: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-2-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/scsi/lpfc/lpfc_init.c | 4 ++-- drivers/scsi/lpfc/lpfc_scsi.c | 12 +++++------- drivers/scsi/lpfc/lpfc_sli.c | 24 +++++++++--------------- drivers/scsi/lpfc/lpfc_vport.c | 2 +- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index bcadf11414c8a41d6fc99d03586d55c26d0a6a0f..783ba9c6a81cdc560b8c901d383c3c4d55eedbc7 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -3361,8 +3361,8 @@ lpfc_block_mgmt_io(struct lpfc_hba *phba, int mbx_action) /* Determine how long we might wait for the active mailbox * command to be gracefully completed by firmware. */ - timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, - phba->sli.mbox_active) * 1000) + jiffies; + timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, + phba->sli.mbox_active)) + jiffies; } spin_unlock_irqrestore(&phba->hbalock, iflag); diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 055ed632c14df51376126a285df728269ca1da6c..f0158fc00f783239db615b0978b6785de064535f 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -5645,9 +5645,8 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd) * cmd_flag is set to LPFC_DRIVER_ABORTED before we wait * for abort to complete. */ - wait_event_timeout(waitq, - (lpfc_cmd->pCmd != cmnd), - msecs_to_jiffies(2*vport->cfg_devloss_tmo*1000)); + wait_event_timeout(waitq, (lpfc_cmd->pCmd != cmnd), + secs_to_jiffies(2*vport->cfg_devloss_tmo)); spin_lock(&lpfc_cmd->buf_lock); @@ -5911,7 +5910,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct fc_rport *rport) * If target is not in a MAPPED state, delay until * target is rediscovered or devloss timeout expires. */ - later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies; + later = secs_to_jiffies(2 * vport->cfg_devloss_tmo) + jiffies; while (time_after(later, jiffies)) { if (!pnode) return FAILED; @@ -5957,7 +5956,7 @@ lpfc_reset_flush_io_context(struct lpfc_vport *vport, uint16_t tgt_id, lpfc_sli_abort_taskmgmt(vport, &phba->sli.sli3_ring[LPFC_FCP_RING], tgt_id, lun_id, context); - later = msecs_to_jiffies(2 * vport->cfg_devloss_tmo * 1000) + jiffies; + later = secs_to_jiffies(2 * vport->cfg_devloss_tmo) + jiffies; while (time_after(later, jiffies) && cnt) { schedule_timeout_uninterruptible(msecs_to_jiffies(20)); cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context); @@ -6137,8 +6136,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) wait_event_timeout(waitq, !test_bit(NLP_WAIT_FOR_LOGO, &pnode->save_flags), - msecs_to_jiffies(dev_loss_tmo * - 1000)); + secs_to_jiffies(dev_loss_tmo)); if (test_and_clear_bit(NLP_WAIT_FOR_LOGO, &pnode->save_flags)) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 3fd9723cd271c8a024b6f34e583668e973404e6f..3ccc444c018c51f7c78a8acdb9d12ead8697fbcb 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -9504,8 +9504,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, goto out_not_finished; } /* timeout active mbox command */ - timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox) * - 1000); + timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox)); mod_timer(&psli->mbox_tmo, jiffies + timeout); } @@ -9629,8 +9628,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, drvr_flag); goto out_not_finished; } - timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox) * - 1000) + jiffies; + timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, pmbox)) + jiffies; i = 0; /* Wait for command to complete */ while (((word0 & OWN_CHIP) == OWN_CHIP) || @@ -9756,9 +9754,8 @@ lpfc_sli4_async_mbox_block(struct lpfc_hba *phba) * command to be gracefully completed by firmware. */ if (phba->sli.mbox_active) - timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, - phba->sli.mbox_active) * - 1000) + jiffies; + timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, + phba->sli.mbox_active)) + jiffies; spin_unlock_irq(&phba->hbalock); /* Make sure the mailbox is really active */ @@ -9881,8 +9878,7 @@ lpfc_sli4_wait_bmbx_ready(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) } } - timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, mboxq) - * 1000) + jiffies; + timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, mboxq)) + jiffies; do { bmbx_reg.word0 = readl(phba->sli4_hba.BMBXregaddr); @@ -13159,7 +13155,7 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba, retval = lpfc_sli_issue_iocb(phba, ring_number, piocb, SLI_IOCB_RET_IOCB); if (retval == IOCB_SUCCESS) { - timeout_req = msecs_to_jiffies(timeout * 1000); + timeout_req = secs_to_jiffies(timeout); timeleft = wait_event_timeout(done_q, lpfc_chk_iocb_flg(phba, piocb, LPFC_IO_WAKE), timeout_req); @@ -13275,8 +13271,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, /* now issue the command */ retval = lpfc_sli_issue_mbox(phba, pmboxq, MBX_NOWAIT); if (retval == MBX_BUSY || retval == MBX_SUCCESS) { - wait_for_completion_timeout(&mbox_done, - msecs_to_jiffies(timeout * 1000)); + wait_for_completion_timeout(&mbox_done, secs_to_jiffies(timeout)); spin_lock_irqsave(&phba->hbalock, flag); pmboxq->ctx_u.mbox_wait = NULL; @@ -13336,9 +13331,8 @@ lpfc_sli_mbox_sys_shutdown(struct lpfc_hba *phba, int mbx_action) * command to be gracefully completed by firmware. */ if (phba->sli.mbox_active) - timeout = msecs_to_jiffies(lpfc_mbox_tmo_val(phba, - phba->sli.mbox_active) * - 1000) + jiffies; + timeout = secs_to_jiffies(lpfc_mbox_tmo_val(phba, + phba->sli.mbox_active)) + jiffies; spin_unlock_irq(&phba->hbalock); /* Enable softirqs again, done with phba->hbalock */ diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 3d70cc5175730b31eeaf46c89d65c0dc09367d44..cc56a73343195a263c307fab6870a0012899060a 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c @@ -246,7 +246,7 @@ static void lpfc_discovery_wait(struct lpfc_vport *vport) * fabric RA_TOV value and dev_loss tmo. The driver's * devloss_tmo is 10 giving this loop a 3x multiplier minimally. */ - wait_time_max = msecs_to_jiffies(((phba->fc_ratov * 3) + 3) * 1000); + wait_time_max = secs_to_jiffies((phba->fc_ratov * 3) + 3); wait_time_max += jiffies; start_time = jiffies; while (time_before(jiffies, wait_time_max)) { From patchwork Tue Jan 28 18:21:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952851 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C33CC1DE8AB; Tue, 28 Jan 2025 18:21:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088520; cv=none; b=h+x2cbP7LOiTUqitwVDGDCX0DTT8KxNA3KBw9zeeRHZkrye8Le7G634X25sMv07GSO4jOZLF395AcwsMuET8gBIBxVPsn/Dd/JhQtTjePXSdLlo3+2QOm2UtSbqgHFdA9WN2cwk8MHUHjC5AN+3shz41JanU2bVxcMb01F49Ntk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088520; c=relaxed/simple; bh=68Gbg2fhfS8FvSFYnoSmzDDd5lhuvGiyxTI1Zb29nr0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FVYM1gmPxwQYzzbT0B3jPl7kdBH0ngMMtV/6OK3y7pvtSuNcyHzc6PS3oT4CDoftJ8Wi+vPsm6LePGGeEUjHFElbj5heMs5DIlcION36+C9NjJHsflsH8aecoGbkmefYhB8YZhAbZHMkIrA7wIhFzMWkzEPVoHspyVwToGHY+tM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=FaJCMhXq; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="FaJCMhXq" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id C988B2037179; Tue, 28 Jan 2025 10:21:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C988B2037179 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088517; bh=NnK20PmZCF3Ily6Bk4PfjyKx9tsw9Ltz3kRT5x7zGKM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FaJCMhXqnOBKCZK58/aDFyxpugTwuUI0zorVbM17ln8zh2Kidcw4dLV6kvgQrvjgC 0NTPud50z5k1yBSbcBf+9ThgyXzP902+ENnzRWcvFd3c3gCBEPcZA9Zr7F3/Xti+Lp 3eGcpMelp4xFNnrE38aQ+AoRxDphqgUTWgfcQdRE= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:48 +0000 Subject: [PATCH 03/16] accel/habanalabs: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-3-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/accel/habanalabs/common/command_submission.c | 2 +- drivers/accel/habanalabs/common/debugfs.c | 2 +- drivers/accel/habanalabs/common/device.c | 2 +- drivers/accel/habanalabs/common/habanalabs_drv.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/accel/habanalabs/common/command_submission.c b/drivers/accel/habanalabs/common/command_submission.c index 59823e3c3bf7a4fafc0b112fd7b4b2209149973c..dee487724918554c24c3e78df4e8715dd1c73acd 100644 --- a/drivers/accel/habanalabs/common/command_submission.c +++ b/drivers/accel/habanalabs/common/command_submission.c @@ -2586,7 +2586,7 @@ int hl_cs_ioctl(struct drm_device *ddev, void *data, struct drm_file *file_priv) cs_seq = args->in.seq; timeout = flags & HL_CS_FLAGS_CUSTOM_TIMEOUT - ? msecs_to_jiffies(args->in.timeout * 1000) + ? secs_to_jiffies(args->in.timeout) : hpriv->hdev->timeout_jiffies; switch (cs_type) { diff --git a/drivers/accel/habanalabs/common/debugfs.c b/drivers/accel/habanalabs/common/debugfs.c index ca7677293a55822f703a3a1cbf947c4c44fdc569..4b391807e5f2e2a2570a38b9dfdf6be4299dbfb6 100644 --- a/drivers/accel/habanalabs/common/debugfs.c +++ b/drivers/accel/habanalabs/common/debugfs.c @@ -1403,7 +1403,7 @@ static ssize_t hl_timeout_locked_write(struct file *f, const char __user *buf, return rc; if (value) - hdev->timeout_jiffies = msecs_to_jiffies(value * 1000); + hdev->timeout_jiffies = secs_to_jiffies(value); else hdev->timeout_jiffies = MAX_SCHEDULE_TIMEOUT; diff --git a/drivers/accel/habanalabs/common/device.c b/drivers/accel/habanalabs/common/device.c index 30277ae410d4b742ffb7bddc35498564ff96fe62..68eebed3b050f72f81e55b86da869b56b4cdeadf 100644 --- a/drivers/accel/habanalabs/common/device.c +++ b/drivers/accel/habanalabs/common/device.c @@ -2091,7 +2091,7 @@ int hl_device_cond_reset(struct hl_device *hdev, u32 flags, u64 event_mask) dev_dbg(hdev->dev, "Device is going to be hard-reset in %u sec unless being released\n", hdev->device_release_watchdog_timeout_sec); schedule_delayed_work(&hdev->device_release_watchdog_work.reset_work, - msecs_to_jiffies(hdev->device_release_watchdog_timeout_sec * 1000)); + secs_to_jiffies(hdev->device_release_watchdog_timeout_sec)); hdev->reset_info.watchdog_active = 1; out: spin_unlock(&hdev->reset_info.lock); diff --git a/drivers/accel/habanalabs/common/habanalabs_drv.c b/drivers/accel/habanalabs/common/habanalabs_drv.c index 596c52e8aa266bf48e2be45e719adb202604577b..0035748f3228246da235f227b2cf3939d64af350 100644 --- a/drivers/accel/habanalabs/common/habanalabs_drv.c +++ b/drivers/accel/habanalabs/common/habanalabs_drv.c @@ -386,7 +386,7 @@ static int fixup_device_params(struct hl_device *hdev) hdev->fw_comms_poll_interval_usec = HL_FW_STATUS_POLL_INTERVAL_USEC; if (tmp_timeout) - hdev->timeout_jiffies = msecs_to_jiffies(tmp_timeout * MSEC_PER_SEC); + hdev->timeout_jiffies = secs_to_jiffies(tmp_timeout); else hdev->timeout_jiffies = MAX_SCHEDULE_TIMEOUT; From patchwork Tue Jan 28 18:21:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952853 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 634081DE8AD; Tue, 28 Jan 2025 18:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088521; cv=none; b=cI0fPtQQcaVT6i6og9CHCNecQ5eZ2HX/aZlnBX0VnRIb+I33tCMEDXRqHH7GjnHTL1/XsdClNJgComFHaW+w7V3i1uU/ZE2orInR4CoyxAu5Bjgcb9f1bi4BFD0WJ4+oH18YrHF6O+enb3hvRVEM7TjpI2Gq7oqlQzOD7NzSnB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088521; c=relaxed/simple; bh=G16h0yxHDNl3YiJLDUgcJDZI/QKtvBTKJxJPm17mVaE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P+ugDxX7bWqiAyyTOnP4He60p05mLKrhHnY7JPxm8MTeJRhKixRAhv6+/C/K7SoBbNWTK1cWtzSRV3IW7JgH5gHQAiP9M1fYErLTjpwXSE733RSoDrrn9+fAgngHNRjnG0IlIe2AkwB9v1vebs7y8jcn5QCa6QfjLtx14/QFnzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=qifPuciL; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="qifPuciL" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id EE39B203717A; Tue, 28 Jan 2025 10:21:57 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com EE39B203717A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=/EWqXlZOyaOm4g59VS89I2uqnGTUPl37w71b9X7s02o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qifPuciLp6zYrAFWIRB9lwfoiORDq5Znn6Y1MZg447mRd521rUeXZX4ssO4a3zPi0 yIeJx+BuhYKeboGXzAtI2rktLS4vmUes2TtMU1tgSIC4k2CZaQfPx4pU+CBe+A2DVU iFfDndGnNrrUEfvChktnE0Qma+AmmL/g2NBtRY68= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:49 +0000 Subject: [PATCH 04/16] ALSA: ac97: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-4-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: Takashi Iwai --- sound/pci/ac97/ac97_codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 6e710dce5c6068ec20c2da751b6f5372ad1df211..88ac37739b7653f69af430dd0163f5ab4ddf0d0c 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -2461,8 +2461,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup) * (for avoiding loud click noises for many (OSS) apps * that open/close frequently) */ - schedule_delayed_work(&ac97->power_work, - msecs_to_jiffies(power_save * 1000)); + schedule_delayed_work(&ac97->power_work, secs_to_jiffies(power_save)); else { cancel_delayed_work(&ac97->power_work); update_power_regs(ac97); From patchwork Tue Jan 28 18:21:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952857 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4CE71DEFE3; Tue, 28 Jan 2025 18:21:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088522; cv=none; b=s2TWS+uOeiL2SZpzW/GicEfcAAV2w3yvcMhUWsL1ci2iU8MkQKNwkpJVvOSqFeWFlABRoiix8qbTpWs5o/3ahn6wAzbvHVNp7WDh4WOVw0207hL4+/C6Nijzn0YSqjwXGyYjgxv92/XRLoEJfQcukto5C5s6qJz0fHS794gfaro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088522; c=relaxed/simple; bh=UsUwkjA8cNb2PcchDqY2QvKjXirKtHPuHHZCi+z/zFw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=czXQ+lIKwIgcZ4cGFTQqIqrNc+SHhpJN20+bFqvR+0Dq9TtWDufSFmJ3fcT59o+MpaDBplriZo4sV02KhCbx8YvDgifV45OQ7eqWAFK5nUfi8yWtVS6C60YXrdKiCfXNIEAhpt+S1J/L8UM51Do2JU1obA+gxjcXWIaTCAxmFUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=LxxdIayM; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="LxxdIayM" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 1D482203717B; Tue, 28 Jan 2025 10:21:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1D482203717B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=CFb4XrnDSERyLmvQoVXwUxR+JwVzCZvuuqJLbnh8AHY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=LxxdIayMSyUMAUeZUUnUyY3SQxVmwYY5Yyy03OWU22J18lbSyq7bmmWrhs+09j8qK AdDxUAv3Opt8Wt6axGPYWRpk6/ENme+ZBSlX8IppgdX/yiYG+JdoRJjp8kHw8DUyuj x3rFLX3PefulMBej9H+RgFZR+bApgqLL7hw3/Tgc= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:50 +0000 Subject: [PATCH 05/16] btrfs: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-5-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: David Sterba --- fs/btrfs/disk-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f09db62e61a1b0e2b8b319f9605883fe0c86cf9d..ed2772d2791997b1e1d15e71d01d818b325f5173 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1568,7 +1568,7 @@ static int transaction_kthread(void *arg) do { cannot_commit = false; - delay = msecs_to_jiffies(fs_info->commit_interval * 1000); + delay = secs_to_jiffies(fs_info->commit_interval); mutex_lock(&fs_info->transaction_kthread_mutex); spin_lock(&fs_info->trans_lock); @@ -1583,9 +1583,9 @@ static int transaction_kthread(void *arg) cur->state < TRANS_STATE_COMMIT_PREP && delta < fs_info->commit_interval) { spin_unlock(&fs_info->trans_lock); - delay -= msecs_to_jiffies((delta - 1) * 1000); + delay -= secs_to_jiffies(delta - 1); delay = min(delay, - msecs_to_jiffies(fs_info->commit_interval * 1000)); + secs_to_jiffies(fs_info->commit_interval)); goto sleep; } transid = cur->transid; From patchwork Tue Jan 28 18:21:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952854 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 33CE11DFD9B; Tue, 28 Jan 2025 18:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088522; cv=none; b=eM1GtWVG8+gYTHQ5m2NAoI1TALsJDwpmfKFP9iiDMB8tmvf5DtDgVFlzjDAaONvP/GW1a7bT9+ST6KoBznjt1eDK6Sc5WyZm8wzXwVBZvFDuzVKee9Zx2q5H4KHPJheaDGavZqb8c9XUo61kc/bIivBaVpMh4AoP+dKb7h53G2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088522; c=relaxed/simple; bh=LMhba986ZxOJNGnWGqqqyhuYQflTFf2hc6xABzRlil4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hZlWaA4SZl/41SnWV9W0C8hnALkzLByNs6SVnTHfy+l9XRsa9H1mJJBTvcC6jCsPQiH4i9CPs+wcjLf0GZd6Ic0c7GRQMU6n8ELRRYLC3kTCb9EChFhRqOeowxGmLP60hNU4mlng81rDm0tr/So/xeooyYLyHTJMhu6mtYxkWVU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=rfpPyd5u; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="rfpPyd5u" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 42B3F203717C; Tue, 28 Jan 2025 10:21:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 42B3F203717C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=T5lTYOdqZ18PkVPGKayEf1CtNzfnccen/5GASjCaKq8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rfpPyd5u2ZlUcIwQygPeTjz3YVe0bsvVHvz8oTJmztLsU9la/gkLXe+572rOIv/gB i7G5iRnJ4ApNulfyRHe7j7M91b9gXSmWOIpvgx9y6je8Dp4x/KKRzHQhcPHDtnmULj WHUHoPOTUtxAhJC69Tbiyelh7/Qnkg0BPCHLyWN4= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:51 +0000 Subject: [PATCH 06/16] rbd: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-6-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/block/rbd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 5b393e4a1ddfc4eba1a821b9bf8e04585bdf2190..c2389500076643b8e1e9caa75431693d12e59a5e 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4162,7 +4162,7 @@ static void rbd_acquire_lock(struct work_struct *work) dout("%s rbd_dev %p requeuing lock_dwork\n", __func__, rbd_dev); mod_delayed_work(rbd_dev->task_wq, &rbd_dev->lock_dwork, - msecs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT * MSEC_PER_SEC)); + secs_to_jiffies(2 * RBD_NOTIFY_TIMEOUT)); } } @@ -6283,9 +6283,9 @@ static int rbd_parse_param(struct fs_parameter *param, break; case Opt_lock_timeout: /* 0 is "wait forever" (i.e. infinite timeout) */ - if (result.uint_32 > INT_MAX / 1000) + if (result.uint_32 > INT_MAX) goto out_of_range; - opt->lock_timeout = msecs_to_jiffies(result.uint_32 * 1000); + opt->lock_timeout = secs_to_jiffies(result.uint_32); break; case Opt_pool_ns: kfree(pctx->spec->pool_ns); From patchwork Tue Jan 28 18:21:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952856 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A37E31E1A20; Tue, 28 Jan 2025 18:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088523; cv=none; b=EqhM6IlY3OJjwFbcgigOBUthHYxPt23HQJWdRR2A9Meus1UoOuoBgqF3G3QBQ3t9HnOWHCuv2Dsc/6IANZKyFyZQF2wWBDjNG9uXdV9X9jEbGWsaRU+70gymcBRa3c7J50TSdnta5BOTnLiRr2B3wrPDQWPyvhA2R6ifM0s9CoE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088523; c=relaxed/simple; bh=hxzBuqSwk2zzOwQjj5kj7Zs58bHYnySoYbzTohNwNyI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k+y9hzPceXjvH3+8OOajv+oCtYX+LExJulRqDkRBHepWxK9yvGx95ph7RECSjLMxPhUVho5Xjp0nZlxJVV5lammi032CFfg1cctbeCNVWUwVP2s+dbqCpDZj8WnaQtvL7jdOKu4bf52t03WGj7jreLJwzd/f5sjI2AapX7TgjSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=hgE89/ZE; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="hgE89/ZE" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 677F3203717D; Tue, 28 Jan 2025 10:21:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 677F3203717D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=HdLPh2PfgYXpuYBC8DOdOZE21MhHNYKQn7qY/vRruJc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hgE89/ZEGzhCC06fBSy0OuT0sQNDNNusckBiNMFdx8HObLyTLW3siMG94Pr0ZLlsb fQK9++emxz2f1q1VTPxH2f2GJNOABzUmDv5dw+7qWye+06L0MBnTU4YhBM46fW71JN PSr2aK+Cp92CEJ/69KbyMUuvjSAK/8CWtJpCo8l8= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:52 +0000 Subject: [PATCH 07/16] libceph: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-7-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- net/ceph/ceph_common.c | 10 ++++------ net/ceph/osd_client.c | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c index 4c6441536d55b6323f4b9d93b5d4837cd4ec880c..0d1e303c0212cc9f70f7c54ca422b0b3ea01bf32 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -529,27 +529,25 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt, /* 0 isn't well defined right now, reject it */ if (result.uint_32 < 1 || result.uint_32 > INT_MAX / 1000) goto out_of_range; - opt->osd_keepalive_timeout = - msecs_to_jiffies(result.uint_32 * 1000); + opt->osd_keepalive_timeout = secs_to_jiffies(result.uint_32); break; case Opt_osd_idle_ttl: /* 0 isn't well defined right now, reject it */ if (result.uint_32 < 1 || result.uint_32 > INT_MAX / 1000) goto out_of_range; - opt->osd_idle_ttl = msecs_to_jiffies(result.uint_32 * 1000); + opt->osd_idle_ttl = secs_to_jiffies(result.uint_32); break; case Opt_mount_timeout: /* 0 is "wait forever" (i.e. infinite timeout) */ if (result.uint_32 > INT_MAX / 1000) goto out_of_range; - opt->mount_timeout = msecs_to_jiffies(result.uint_32 * 1000); + opt->mount_timeout = secs_to_jiffies(result.uint_32); break; case Opt_osd_request_timeout: /* 0 is "wait forever" (i.e. infinite timeout) */ if (result.uint_32 > INT_MAX / 1000) goto out_of_range; - opt->osd_request_timeout = - msecs_to_jiffies(result.uint_32 * 1000); + opt->osd_request_timeout = secs_to_jiffies(result.uint_32); break; case Opt_share: diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index b24afec241382b60d775dd12a6561fa23a7eca45..ba61a48b4388c2eceb5b7a299906e7f90191dd5d 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -4989,8 +4989,7 @@ int ceph_osdc_notify(struct ceph_osd_client *osdc, linger_submit(lreq); ret = linger_reg_commit_wait(lreq); if (!ret) - ret = linger_notify_finish_wait(lreq, - msecs_to_jiffies(2 * timeout * MSEC_PER_SEC)); + ret = linger_notify_finish_wait(lreq, secs_to_jiffies(2 * timeout)); else dout("lreq %p failed to initiate notify %d\n", lreq, ret); From patchwork Tue Jan 28 18:21:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952855 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FB0C1E98FD; Tue, 28 Jan 2025 18:22:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088523; cv=none; b=MuOq9E3c+cU7ySqa7XM166jzEgvAqIKEqn10nnfx6LnbgRNytYt8/WcNbv6a9EhhrAwlMf6X52hgNWf/cmM763BS0TczHsDJiEyNZ3RUVVQQogl2PzIsEBwvHOOUKL/+6eOk+2ctNZx3i3VvqvEqTU5R4cM/wWUbvfVemeH1l2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088523; c=relaxed/simple; bh=kN1DmhU9yrjNZu0QSYW1NiN/kroOX9bjf+LNgqzAZhQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U5wZvJM9jUB3xiXdEnYiHA1Vjmw2qTvwVPfJ5tANYM2Zq02/A2kEPTvHzUfuc+itgmWByqdLKR7n96rgvs/xi02s31A+AGzokDNMYIPr/QAY1QmWKxAY21xJb4bVwZoMk0Urc/FYRj3wfN1yJ1clXDptvTToFvbKGfPEVBrAlmg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=Y6ylpiLi; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="Y6ylpiLi" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 91DF1203717E; Tue, 28 Jan 2025 10:21:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 91DF1203717E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=DdLbmsRzgWLdzC2fj6O2CIX1t5gGJspI8Pgb54drLsE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y6ylpiLi1KVZ08WiTao/OJYzlh6hCYH9M4Lti7xtSLDcF9isW5mseElvLmHpIZ8qP x/5hoAPvzc6Kc/w4ySGEyIVQMvEw8hunjl0cSDD/bAeaa2sgqpNFi8a/A/eDwTMxh5 TRAFAiqE6+9cKOciP+b85ff4KZYaPvXJLO+fVtn0= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:53 +0000 Subject: [PATCH 08/16] libata: zpodd: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-8-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: Damien Le Moal --- drivers/ata/libata-zpodd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c index 4b83b517caec66c82b126666f6dffd09729bf845..799531218ea2d5cc1b7e693a2b2aff7f376f7d76 100644 --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c @@ -160,8 +160,7 @@ void zpodd_on_suspend(struct ata_device *dev) return; } - expires = zpodd->last_ready + - msecs_to_jiffies(zpodd_poweroff_delay * 1000); + expires = zpodd->last_ready + secs_to_jiffies(zpodd_poweroff_delay); if (time_before(jiffies, expires)) return; From patchwork Tue Jan 28 18:21:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952858 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A84E1F1520; Tue, 28 Jan 2025 18:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088523; cv=none; b=NL5fd4Uqe+htyN5+ZZ35wMrSDFj6lVwvdCz5MRSKcndCkYhQF8sYmyb5o9cdbv2mLm9qcxGxBVlhc2RUnzu9iRa6pbbFVQLFy9GI1QWDN1io+vvU1jrx4BBNImkE17mRDpvXsZtJqiAnogXLmCL6JBzxgxTTejOZyJVzgiXaQXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088523; c=relaxed/simple; bh=OLA3A56uD0O5H9QiRTUKVuZZklZoijvOUfZpIkvjlIU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BIXkyK24lyRrqkysp7RxuOk26knqdhxRvcWC/8FmVHMIwBZJQ/c5EoW6NhuJATaU8D46J+XqESMs0GbcakJL6c27upXs8t5ryRvQYXsVME7C0994ui2t6l/hCKocZMXr319pPxUawwp3/ldfGQ3SjNz3jJC/cDpuZPCkSx87Wxg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=bCWdmC5s; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="bCWdmC5s" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id B64E5203717F; Tue, 28 Jan 2025 10:21:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B64E5203717F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=u7OiaBq0jFk7FcA2dC+mPjTQmMAI3oiqK6Ljbdu99Zo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bCWdmC5sK+KGAbHIQs99+gR3I9KkUGPk8kFlcCfGOtNz5+PxpeUtS30nO0JF6Kkrh 4YdwJAnsnMu3a7zDoviG7hWlukFPfHmJucfdR4tFHFcqEK2OJWxup5PGk5ZafTVcpE UzK+XoLAiEFwEnVWfbUT/XAsd53WZnxAQJy+FV1o= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:54 +0000 Subject: [PATCH 09/16] xfs: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-9-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: "Darrick J. Wong" Reviewed-by: Carlos Maiolino --- fs/xfs/xfs_icache.c | 2 +- fs/xfs/xfs_sysfs.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 7b6c026d01a1fc020a41a678964cdbf7a8113323..7a1feb8dc21f6f71d04f88de866e5a95925e0c54 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -230,7 +230,7 @@ xfs_blockgc_queue( rcu_read_lock(); if (radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_BLOCKGC_TAG)) queue_delayed_work(mp->m_blockgc_wq, &pag->pag_blockgc_work, - msecs_to_jiffies(xfs_blockgc_secs * 1000)); + secs_to_jiffies(xfs_blockgc_secs)); rcu_read_unlock(); } diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index 60cb5318fdae3cc246236fd988b4749df57f8bfc..eed0f28afe97ead762a9539e45f292db7d0d0c4a 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -568,8 +568,8 @@ retry_timeout_seconds_store( if (val == -1) cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; else { - cfg->retry_timeout = msecs_to_jiffies(val * MSEC_PER_SEC); - ASSERT(msecs_to_jiffies(val * MSEC_PER_SEC) < LONG_MAX); + cfg->retry_timeout = secs_to_jiffies(val); + ASSERT(secs_to_jiffies(val) < LONG_MAX); } return count; } @@ -686,8 +686,7 @@ xfs_error_sysfs_init_class( if (init[i].retry_timeout == XFS_ERR_RETRY_FOREVER) cfg->retry_timeout = XFS_ERR_RETRY_FOREVER; else - cfg->retry_timeout = msecs_to_jiffies( - init[i].retry_timeout * MSEC_PER_SEC); + cfg->retry_timeout = secs_to_jiffies(init[i].retry_timeout); } return 0; From patchwork Tue Jan 28 18:21:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952859 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D93A71F3FEC; Tue, 28 Jan 2025 18:22:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088524; cv=none; b=KapF/PqITv5g4lx6nqO7+lw7vDuNmjgc4ADf+wTv+sx21R1VoPCIB7/A+TYzh673BAglBw5ypFiguyaUe6ddFzA8kyVc79/+e32xwu5kpVT9zNkiVHdia6C8ZweWR40NnCNhttL4kIlzzY8IfFCI4+jrZiQ3wrplH0fZQOOEf4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088524; c=relaxed/simple; bh=OsYTfsOCztno0rw4bH8H93fzXxdgLqs3edOsOwLU26w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cyFKetNO0CIluwYw5acIyHKC0ScraxvZAc2ybNV28g3hPqCi2ow0bCWCDr0G6t68Km3kYk8J+ErmcdooqAT8PbwJp+mIUOBe5FgAuptee5rucP4r8VIuWQQNqkH9ne1t5k/CXHB7Ge3Zqd2Vtx5rzNkipNl+gRIp6qIcfkSBQG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=nOvIreoP; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="nOvIreoP" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id DB2792037180; Tue, 28 Jan 2025 10:21:58 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com DB2792037180 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088518; bh=++CcFDhMGmgcKwzaiNwx3lMiN5jr5twzkm9Lzfmspqc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nOvIreoPo3EtPXnqT78hdGSPjS+BJfm76bfob6LjYY8fpAzAx+SSWBMemjjxO+8RL gtA/N4PvBwCgX5MwsErpmvFLEJEFEicnjVAtYs/DImfDKgiY3inNNwt6TIW4w8Mj2E eLHR2MK1+CS1Dd52E6DvRE+gXgt4inmHotPghBSw= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:55 +0000 Subject: [PATCH 10/16] power: supply: da9030: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-10-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/power/supply/da9030_battery.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c index ac2e319e95179039279dacaed1744136f679fbac..d25279c260308b6c82acb2aabf44f3749f71b703 100644 --- a/drivers/power/supply/da9030_battery.c +++ b/drivers/power/supply/da9030_battery.c @@ -502,8 +502,7 @@ static int da9030_battery_probe(struct platform_device *pdev) /* 10 seconds between monitor runs unless platform defines other interval */ - charger->interval = msecs_to_jiffies( - (pdata->batmon_interval ? : 10) * 1000); + charger->interval = secs_to_jiffies(pdata->batmon_interval ? : 10); charger->charge_milliamp = pdata->charge_milliamp; charger->charge_millivolt = pdata->charge_millivolt; From patchwork Tue Jan 28 18:21:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952860 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C8181DED68; Tue, 28 Jan 2025 18:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088524; cv=none; b=bzw+tJYxZRdeyTDRI4qUljdFloHJ3xe+yQlQp42hGe+ChnV2i8N1TWacF7mGEBwnQOqfF5pdm38AjzLtW9OQtzp524V26JoQYb6n2TIhp7fSu0MaoczcscmThyeIWnEIp2h1IhxN1aJD9d3J0Vih3MGkWb2QIO0u0cjJueZWrXQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088524; c=relaxed/simple; bh=hA3Q3K9glBf7uUWiSoreFmdKqoQ37oa0nFKbyW6Ranw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eibcRrF9o/IrbOGQW66LSifdZeA2bq7bOuXSlJ7SewEOHleqmGMPAdJKwpbqytQr/BEEnWvsvVHk+mz4YoMUESkheGkweFwtbsh6ORCnACnbJrrKM1KBMfPgV3LUEyIsW7D54jS8fnHv89ioEwLViJgbkhKRN4ZmvDVO/9H559M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=cKEYru15; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="cKEYru15" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 0FF192037181; Tue, 28 Jan 2025 10:21:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0FF192037181 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088519; bh=mkn/3Lgtg54GNzaXlgwnQtoAqu7SMhloWS9nR/qJKuY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cKEYru15Mtf5Q/kd1hSFKWBC52Cu5K/BLR2OJkWAzj2ZRqT7jwKiudaaP1oxpVDD2 Ch28OEl3D9iSWgJG7LiMGUZuZZPQ0TT3G25/suv+aMV6FU+12BnnbXEYRDXYc7j3CK B5oP9zQfweGdZD0+cB+LjlH0pntkjNINNMAcz/8U= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:56 +0000 Subject: [PATCH 11/16] nvme: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-11-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: Keith Busch --- drivers/nvme/host/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 76b615d4d5b91e163e5a6e7baf451c959a2c3cab..87498215ede4bcaf48660b89c901075dfcfaf041 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4459,11 +4459,9 @@ static void nvme_fw_act_work(struct work_struct *work) nvme_auth_stop(ctrl); if (ctrl->mtfa) - fw_act_timeout = jiffies + - msecs_to_jiffies(ctrl->mtfa * 100); + fw_act_timeout = jiffies + msecs_to_jiffies(ctrl->mtfa * 100); else - fw_act_timeout = jiffies + - msecs_to_jiffies(admin_timeout * 1000); + fw_act_timeout = jiffies + secs_to_jiffies(admin_timeout); nvme_quiesce_io_queues(ctrl); while (nvme_ctrl_pp_status(ctrl)) { From patchwork Tue Jan 28 18:21:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952861 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D19C51F667A; Tue, 28 Jan 2025 18:22:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088525; cv=none; b=Nwc555yHtL8zYYdSOf///71xKgwTuDPg+YcEX0LkXNHiAb+kXDCxaz/QxxwL6da8YRrk2TPzM769J0geQNcDgdd96dEGobOBAC9Dsml951nMGvCOZQV2a7GXSSUzFpf8BRogtLtvzPCJuWbhnaJoAj3xLiGTxrsfKHVgnFCVLa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088525; c=relaxed/simple; bh=/FXWK0n3siVRo/xV5fNEKJe6vhBZrxP7iSjz3SuPHsM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ihnt390y2uv76ZcuAtEbaGU/oBo0qaUMR1Tw+Aq0xzExs6+WmSXLCEVlOSM/5thHq2SCCFQDsC7Kz4bxVRYwkBDGVqUAbA42Yzew454N2qqoU9yy2Cwr7C1zfiKs20cugRbHvPT0x4QdtWdg0W8PZdhjgaf6jMn/oFlDlFW/9XM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=i1P5CteI; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="i1P5CteI" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 367E92037182; Tue, 28 Jan 2025 10:21:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 367E92037182 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088519; bh=cIG2dfkqcecUU0JqZpchlOURAaCdxgZkNT0UTt4bvLA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i1P5CteIH6opQQHIehVjxxbMtebMN7rXuNwBXMSI0asiaK5CTudtXAgtKgnK6I75c 1ngX/e4Oyj1B1vWMI4mQPUPmJ8cuPN3FTRVbcAp1DyhUYo8gGu4rDV59iA6QKrL9uC BkxdKeiMaFW1YdRdBrMCMMVni2EQgoLc5InCNfZg= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:57 +0000 Subject: [PATCH 12/16] spi: spi-fsl-lpspi: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-12-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: Mark Brown --- drivers/spi/spi-fsl-lpspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 40f5c8fdba765a1334710a696966232a459316e6..5e381844523440c03b1d0bbe4a044f28fbfbc738 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -572,7 +572,7 @@ static int fsl_lpspi_calculate_timeout(struct fsl_lpspi_data *fsl_lpspi, timeout += 1; /* Double calculated timeout */ - return msecs_to_jiffies(2 * timeout * MSEC_PER_SEC); + return secs_to_jiffies(2 * timeout); } static int fsl_lpspi_dma_transfer(struct spi_controller *controller, From patchwork Tue Jan 28 18:21:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952862 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 61E7F1F76AD; Tue, 28 Jan 2025 18:22:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088525; cv=none; b=O7KtJZdZqet7Y37z/mLvDMtosAXdgWoQQOnoAlnpQJWEWIDR87pC+vRp7Ajyjz9tPSbCceG6z7mR+u3eBdZ92CXvhUAVjeCEfSXYdHi66zjGtG+VsYttebLH+UwJTUOYOdPtoHySLVTYDUBCStySPacwwLJI69JCeHI07zpN2gM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088525; c=relaxed/simple; bh=/Gm1s5G9N70bKkSKAZy+8441KJAW3dFSUk0guKC3iRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LZQuxv02Fsk8mhcF6LxUtbBFQ56ciHC2O+PFVUbnXaDTyU2QwLvc2IsEwdT9/ZgS3f6VTc6qZf38ERJI8ugsa8fpECKH+R7wFczNq+Tu09Des3OZ6DPKYJmrhsqxiK7u54ojvDnk5Nor6Wfq47Mhxx4pq7O7GAVFEa4JETo+XD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=jXfb9M/C; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="jXfb9M/C" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 598502037184; Tue, 28 Jan 2025 10:21:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 598502037184 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088519; bh=OqPAwTULz/ylA5SQSCmsIKYH/79lvRoXFrBfI1CqqYw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jXfb9M/Cehjh0rKk4/gwmJMdgUjXncg0HDEC39xVRFWQkuiYphjidp7M9lcy47Bum gUNDvi3+taG7qq0jtJSKlDz1ymYX6/HH0DskMWFPIdQPzlPn2zSfXJ32Gn2cCN+9lW iIDOVi+CXaME0UAmvAJpRjEmzopqE4zm0lQ/NWzM= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:58 +0000 Subject: [PATCH 13/16] spi: spi-imx: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-13-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan Acked-by: Mark Brown --- drivers/spi/spi-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index eeb7d082c2472f954001045295b349bc2eb53197..832d6e9009ebe741779acd58c3a9450c231151bb 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1449,7 +1449,7 @@ static int spi_imx_calculate_timeout(struct spi_imx_data *spi_imx, int size) timeout += 1; /* Double calculated timeout */ - return msecs_to_jiffies(2 * timeout * MSEC_PER_SEC); + return secs_to_jiffies(2 * timeout); } static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx, From patchwork Tue Jan 28 18:21:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952863 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93D351F78E6; Tue, 28 Jan 2025 18:22:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088526; cv=none; b=qMBPJsMKjK1pq5L1+e3eJVCXguIvb5se9t+S+j/L458543BAhdIMygqp4v6T0qJBDDTqfmPuf+uorLseusFzPADt2KczgtW8xCP8aKY01+RTeQar711LPIJysFgMMgIeDBBy8PQpgyokMxyv+XZQo9pDV/2RtjGx7bR9lEl0y1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088526; c=relaxed/simple; bh=CLfhMWMTls81fldJlgdOHYuSb53h9V9zAXCK22tn3uE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XnjjS/NSjR1y3mM3R7IyCDuuoixov41sonUhcjmfVqVFCacoLRlFs+EfMoFbjWdeVIvKJeTzeuhN/ITJHjHn22La1SmwgRlYsHMTafAOQoA2HkWQ+VC8d3VDS+T0iYYIun8LFew8e7shTXNunqRfGOUnWc0sooK3KoW0BIUytFU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=ZOuwdqaZ; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="ZOuwdqaZ" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 7B8912037183; Tue, 28 Jan 2025 10:21:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7B8912037183 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088519; bh=VqcHpB+vyGTp1RMX3+WFTH5f5bCj+Q9J8OolxUskrKo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZOuwdqaZhug0KNQQ21Ohb30BhgvBJyo55qHRaa7MGqCb8wONCvj3jN/bLp9sKWWM6 8bC+bT63Hpx0+HHlZCeQeaR75fGVzJRRwDfMPixaFz8dfRqI1843e4U/m+evk1P+Me /+O0qMwZndCMTYuy618bWJRmYRUItE1KI26PeEM4= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:21:59 +0000 Subject: [PATCH 14/16] platform/x86/amd/pmf: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-14-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/platform/x86/amd/pmf/acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/amd/pmf/acpi.c index dd5780a1d06e1dc979fcff5bafd6729bc4937eab..6b7effe80b78b7389b320ee65fa5d2373f782a2f 100644 --- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -220,7 +220,8 @@ static void apmf_sbios_heartbeat_notify(struct work_struct *work) if (!info) return; - schedule_delayed_work(&dev->heart_beat, msecs_to_jiffies(dev->hb_interval * 1000)); + schedule_delayed_work(&dev->heart_beat, + secs_to_jiffies(dev->hb_interval)); kfree(info); } From patchwork Tue Jan 28 18:22:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952865 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55CFB1F8694; Tue, 28 Jan 2025 18:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088526; cv=none; b=qi4FJa3hh8djGcJOfoTbVa+3vQsPLOM9MPSNlZNyf5AVCNYtouWshQEpXKKmerVcMxsf5WyfeWB8T2BJfHjVTtYI7YhwV1Fr/qKt1/TmEPvaNGY9IHmsAbGKkjPH86rC67Urq8HFOtTgO9f0Y+AT0RwV3M0qgvNLFKns+lmJ5qk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088526; c=relaxed/simple; bh=NLKLSdK0FDvLRV6/WQ6AEOph8/GppwC6VzlI+eh0e9Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a5fYiPhLjqRkqj8HbhRigIiYW6uOmn2hIw6ldWjan50bqdcBi5IK62V/Qi2wBp3F2HZg7+CYeM9VhgT8noMRXbHL9mS3zT69mZlV6f75h2/MFo3SdFkYPt3yUTZoIl/PpwjR5FcqCrIoga6YbFKrelA9uS+KEezRJK3az+xtmjg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=VDOJ0UVc; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="VDOJ0UVc" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id 9DEDF2037186; Tue, 28 Jan 2025 10:21:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9DEDF2037186 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088519; bh=MrRoSF+FOHzMLN/F6LhKtUoOtRK4Dvpw4z2TjFgN7VQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VDOJ0UVcB3tdWtv0kEPgju6P8XjLVhI9v/FwUwQueJEftvBCu5K7f+pdk59MpNfkK ZNizZYJyPBz3Enx9ehl7deE8rXReMEi7MKIck08fnn53suV4apwJE6v0a75dbsKot1 FOlMM/x/cVOz5FAhrxA1C4ODo0Fz3V/+H2e0Wt4U= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:22:00 +0000 Subject: [PATCH 15/16] platform/x86: thinkpad_acpi: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-15-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/platform/x86/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 1fcb0f99695a78d392ed000b0831eb4d45eff55f..500b497c3f375f463f014ed3f3361afc9d6f3329 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -8505,7 +8505,7 @@ static void fan_watchdog_reset(void) if (fan_watchdog_maxinterval > 0 && tpacpi_lifecycle != TPACPI_LIFE_EXITING) mod_delayed_work(tpacpi_wq, &fan_watchdog_task, - msecs_to_jiffies(fan_watchdog_maxinterval * 1000)); + secs_to_jiffies(fan_watchdog_maxinterval)); else cancel_delayed_work(&fan_watchdog_task); } From patchwork Tue Jan 28 18:22:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Easwar Hariharan X-Patchwork-Id: 13952864 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 55DEC1F8695; Tue, 28 Jan 2025 18:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088526; cv=none; b=bQSxsHSmgpH9W4QhFDV6wJZECauGLU1LmwwUoYS9jcfruJs8/ybNQwCHtxTJm/wLmlZPKIFiXyF8erJCfM+EDNayv4+u9te9i6VC0VKcfMm16S1CVpU3UOZQAGx8Ft79Wmj3EPNoqKyYzBHnGQdwTSfG3v62GKPSbQPgbXg+uIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738088526; c=relaxed/simple; bh=KJMzKtLgUjkdiRLa5HitUr7Wx/UXOJQ27K9oYkXSQt8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QKLO50ePNnmGE1Ed3XJSH8CeT2Hu5pBdqr3LVS3Vxgovyx4N2SnNllayTLIL5UCBj8TRSfyePbgIlSmobS+Tlwf9VeGf/3RfBhGdkJlasEZpQ7mfG9IeSkYo2/WeEsIL/j6F+rsqWKv50rmEJWriBCh5OEFzol8hC4gMzHdA0MA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=q+xwP6Cl; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="q+xwP6Cl" Received: from eahariha-devbox.internal.cloudapp.net (unknown [40.91.112.99]) by linux.microsoft.com (Postfix) with ESMTPSA id C24F42037187; Tue, 28 Jan 2025 10:21:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C24F42037187 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1738088519; bh=kdMVzzkgTOOmufQV39efQmOyjkxwKqjsv6zrS4rXQDA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=q+xwP6ClPU9Ft8nUZaAm0N07V7hTj7HoQgpntSqU7xz/FSC1uyq8yI9vSrWHQTVoJ PSX32EpAjhCmTdNfYRkq0EvtpfRW1IfUg+fLiSx95EzydAGIAXQme2d6mFML8NbA9f CPhNataDz2TgSPTNZMYPFDRtUHD77vCxTnf0vsIo= From: Easwar Hariharan Date: Tue, 28 Jan 2025 18:22:01 +0000 Subject: [PATCH 16/16] RDMA/bnxt_re: convert timeouts to secs_to_jiffies() Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250128-converge-secs-to-jiffies-part-two-v1-16-9a6ecf0b2308@linux.microsoft.com> References: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> In-Reply-To: <20250128-converge-secs-to-jiffies-part-two-v1-0-9a6ecf0b2308@linux.microsoft.com> To: Andrew Morton , Yaron Avizrat , Oded Gabbay , Julia Lawall , Nicolas Palix , James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Jaroslav Kysela , Takashi Iwai , Chris Mason , Josef Bacik , David Sterba , Ilya Dryomov , Dongsheng Yang , Jens Axboe , Xiubo Li , Damien Le Moal , Niklas Cassel , Carlos Maiolino , "Darrick J. Wong" , Sebastian Reichel , Keith Busch , Christoph Hellwig , Sagi Grimberg , Frank Li , Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Shyam Sundar S K , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Henrique de Moraes Holschuh , Selvin Xavier , Kalesh AP , Jason Gunthorpe , Leon Romanovsky Cc: cocci@inria.fr, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sound@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-xfs@vger.kernel.org, linux-pm@vger.kernel.org, linux-nvme@lists.infradead.org, linux-spi@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, linux-rdma@vger.kernel.org, Easwar Hariharan X-Mailer: b4 0.14.2 Commit b35108a51cf7 ("jiffies: Define secs_to_jiffies()") introduced secs_to_jiffies(). As the value here is a multiple of 1000, use secs_to_jiffies() instead of msecs_to_jiffies to avoid the multiplication. This is converted using scripts/coccinelle/misc/secs_to_jiffies.cocci with the following Coccinelle rules: @depends on patch@ expression E; @@ -msecs_to_jiffies +secs_to_jiffies (E - * \( 1000 \| MSEC_PER_SEC \) ) Signed-off-by: Easwar Hariharan --- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index 17e62f22683b14a3571188e25fe0df3cbf1d8360..b1a18c9cb7f6c248548bc38fcb98781a3030a1b6 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -160,7 +160,7 @@ static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie) wait_event_timeout(cmdq->waitq, !crsqe->is_in_used || test_bit(ERR_DEVICE_DETACHED, &cmdq->flags), - msecs_to_jiffies(rcfw->max_timeout * 1000)); + secs_to_jiffies(rcfw->max_timeout)); if (!crsqe->is_in_used) return 0;