From owner-svn-src-all@freebsd.org Fri Dec 13 19:56:49 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BB7A1D5539; Fri, 13 Dec 2019 19:56:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47ZLz52Cp0z4Qvj; Fri, 13 Dec 2019 19:56:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 422C4194D1; Fri, 13 Dec 2019 19:56:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBDJun76082374; Fri, 13 Dec 2019 19:56:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBDJumqY082372; Fri, 13 Dec 2019 19:56:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201912131956.xBDJumqY082372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Dec 2019 19:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355728 - head/sys/dev/smartpqi X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/dev/smartpqi X-SVN-Commit-Revision: 355728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 19:56:49 -0000 Author: jhb Date: Fri Dec 13 19:56:48 2019 New Revision: 355728 URL: https://svnweb.freebsd.org/changeset/base/355728 Log: Use callout(9) instead of deprecated timeout(9). Reviewed by: imp Tested by: Scott Benesh Differential Revision: https://reviews.freebsd.org/D22598 Modified: head/sys/dev/smartpqi/smartpqi_defines.h head/sys/dev/smartpqi/smartpqi_main.c head/sys/dev/smartpqi/smartpqi_misc.c Modified: head/sys/dev/smartpqi/smartpqi_defines.h ============================================================================== --- head/sys/dev/smartpqi/smartpqi_defines.h Fri Dec 13 19:39:33 2019 (r355727) +++ head/sys/dev/smartpqi/smartpqi_defines.h Fri Dec 13 19:56:48 2019 (r355728) @@ -856,8 +856,8 @@ typedef struct OS_SPECIFIC { struct cam_path *path; struct task event_task; struct cdev *cdev; - struct callout_handle wellness_periodic; /* periodic event handling */ - struct callout_handle heartbeat_timeout_id; /* heart beat event handling */ + struct callout wellness_periodic; /* periodic event handling */ + struct callout heartbeat_timeout_id; /* heart beat event handling */ eventhandler_tag eh; } OS_SPECIFIC_T; Modified: head/sys/dev/smartpqi/smartpqi_main.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_main.c Fri Dec 13 19:39:33 2019 (r355727) +++ head/sys/dev/smartpqi/smartpqi_main.c Fri Dec 13 19:56:48 2019 (r355728) @@ -324,6 +324,8 @@ smartpqi_attach(device_t dev) mtx_init(&softs->os_specific.cam_lock, "cam_lock", NULL, MTX_DEF); softs->os_specific.mtx_init = TRUE; mtx_init(&softs->os_specific.map_lock, "map_lock", NULL, MTX_DEF); + callout_init(&softs->os_specific.wellness_periodic, 1); + callout_init(&softs->os_specific.heartbeat_timeout_id, 1); /* * Create DMA tag for mapping buffers into controller-addressable space. @@ -355,8 +357,8 @@ smartpqi_attach(device_t dev) } os_start_heartbeat_timer((void *)softs); /* Start the heart-beat timer */ - softs->os_specific.wellness_periodic = timeout( os_wellness_periodic, - softs, 120*hz); + callout_reset(&softs->os_specific.wellness_periodic, 120*hz, + os_wellness_periodic, softs); /* Register our shutdown handler. */ softs->os_specific.eh = EVENTHANDLER_REGISTER(shutdown_final, smartpqi_shutdown, softs, SHUTDOWN_PRI_DEFAULT); @@ -410,11 +412,9 @@ smartpqi_detach(device_t dev) EVENTHANDLER_DEREGISTER(shutdown_final, softs->os_specific.eh); /* kill the periodic event */ - untimeout(os_wellness_periodic, softs, - softs->os_specific.wellness_periodic); + callout_drain(&softs->os_specific.wellness_periodic); /* Kill the heart beat event */ - untimeout(os_start_heartbeat_timer, softs, - softs->os_specific.heartbeat_timeout_id); + callout_drain(&softs->os_specific.heartbeat_timeout_id); smartpqi_shutdown(softs); destroy_char_dev(softs); Modified: head/sys/dev/smartpqi/smartpqi_misc.c ============================================================================== --- head/sys/dev/smartpqi/smartpqi_misc.c Fri Dec 13 19:39:33 2019 (r355727) +++ head/sys/dev/smartpqi/smartpqi_misc.c Fri Dec 13 19:56:48 2019 (r355728) @@ -69,8 +69,8 @@ void os_wellness_periodic(void *data) } /* reschedule ourselves */ - softs->os_specific.wellness_periodic = timeout(os_wellness_periodic, - softs, OS_HOST_WELLNESS_TIMEOUT * hz); + callout_schedule(&softs->os_specific.wellness_periodic, + OS_HOST_WELLNESS_TIMEOUT * hz); } /* @@ -81,8 +81,7 @@ void os_stop_heartbeat_timer(pqisrc_softstate_t *softs DBG_FUNC("IN\n"); /* Kill the heart beat event */ - untimeout(os_start_heartbeat_timer, softs, - softs->os_specific.heartbeat_timeout_id); + callout_stop(&softs->os_specific.heartbeat_timeout_id); DBG_FUNC("OUT\n"); } @@ -97,9 +96,9 @@ void os_start_heartbeat_timer(void *data) pqisrc_heartbeat_timer_handler(softs); if (!pqisrc_ctrl_offline(softs)) { - softs->os_specific.heartbeat_timeout_id = - timeout(os_start_heartbeat_timer, softs, - OS_FW_HEARTBEAT_TIMER_INTERVAL * hz); + callout_reset(&softs->os_specific.heartbeat_timeout_id, + OS_FW_HEARTBEAT_TIMER_INTERVAL * hz, + os_start_heartbeat_timer, softs); } DBG_FUNC("OUT\n");