From owner-svn-src-head@freebsd.org Sun Nov 8 04:15:53 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7480A29296; Sun, 8 Nov 2015 04:15:53 +0000 (UTC) (envelope-from gonzo@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 mx1.freebsd.org (Postfix) with ESMTPS id 8D4921B20; Sun, 8 Nov 2015 04:15:53 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA84FqYI009325; Sun, 8 Nov 2015 04:15:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA84FqX1009324; Sun, 8 Nov 2015 04:15:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201511080415.tA84FqX1009324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 8 Nov 2015 04:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290536 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Nov 2015 04:15:53 -0000 Author: gonzo Date: Sun Nov 8 04:15:52 2015 New Revision: 290536 URL: https://svnweb.freebsd.org/changeset/base/290536 Log: Fix some of WITNESS complaints and bootup lock by removing msg_avail condvar/mutex. They're basically no-op because error is not propagated up the call chain. We still report message failures in VC service callback Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_audio.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Sun Nov 8 03:54:15 2015 (r290535) +++ head/sys/arm/broadcom/bcm2835/bcm2835_audio.c Sun Nov 8 04:15:52 2015 (r290536) @@ -104,11 +104,6 @@ struct bcm2835_audio_info { /* VCHI data */ struct mtx vchi_lock; - /* MSG reply */ - struct mtx msg_avail_lock; - struct cv msg_avail_cv; - uint32_t msg_result; - VCHI_INSTANCE_T vchi_instance; VCHI_CONNECTION_T *vchi_connection; VCHI_SERVICE_HANDLE_T vchi_handle; @@ -162,8 +157,11 @@ bcm2835_audio_callback(void *param, cons status = vchi_msg_dequeue(sc->vchi_handle, &m, sizeof m, &msg_len, VCHI_FLAGS_NONE); if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { - sc->msg_result = m.u.result.success; - cv_signal(&sc->msg_avail_cv); + if (m.u.result.success) { + device_printf(sc->dev, + "msg type %08x failed\n", + m.type); + } } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { struct bcm2835_audio_chinfo *ch = m.u.complete.cookie; @@ -333,8 +331,6 @@ bcm2835_audio_update_controls(struct bcm if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { vchi_service_use(sc->vchi_handle); - sc->msg_result = -1; - m.type = VC_AUDIO_MSG_TYPE_CONTROL; m.u.control.dest = sc->dest; if (sc->volume > 99) @@ -348,12 +344,6 @@ bcm2835_audio_update_controls(struct bcm if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - mtx_lock(&sc->msg_avail_lock); - cv_wait_sig(&sc->msg_avail_cv, &sc->msg_avail_lock); - if (sc->msg_result) - printf("%s failed: %d\n", __func__, sc->msg_result); - mtx_unlock(&sc->msg_avail_lock); - vchi_service_release(sc->vchi_handle); } VCHIQ_VCHI_UNLOCK(sc); @@ -369,8 +359,6 @@ bcm2835_audio_update_params(struct bcm28 if (sc->vchi_handle != VCHIQ_SERVICE_HANDLE_INVALID) { vchi_service_use(sc->vchi_handle); - sc->msg_result = -1; - m.type = VC_AUDIO_MSG_TYPE_CONFIG; m.u.config.channels = AFMT_CHANNEL(ch->fmt); m.u.config.samplerate = ch->spd; @@ -382,12 +370,6 @@ bcm2835_audio_update_params(struct bcm28 if (ret != 0) printf("%s: vchi_msg_queue failed (err %d)\n", __func__, ret); - mtx_lock(&sc->msg_avail_lock); - cv_wait_sig(&sc->msg_avail_cv, &sc->msg_avail_lock); - if (sc->msg_result) - printf("%s failed: %d\n", __func__, sc->msg_result); - mtx_unlock(&sc->msg_avail_lock); - vchi_service_release(sc->vchi_handle); } VCHIQ_VCHI_UNLOCK(sc); @@ -831,8 +813,6 @@ bcm2835_audio_attach(device_t dev) sc->lock = snd_mtxcreate(device_get_nameunit(dev), "bcm2835_audio softc"); mtx_init(&sc->vchi_lock, "bcm2835_audio", "vchi_lock", MTX_DEF); - mtx_init(&sc->msg_avail_lock, "msg_avail_mtx", "msg_avail_mtx", MTX_DEF); - cv_init(&sc->msg_avail_cv, "msg_avail_cv"); mtx_init(&sc->data_lock, "data_mtx", "data_mtx", MTX_DEF); cv_init(&sc->data_cv, "data_cv"); sc->vchi_handle = VCHIQ_SERVICE_HANDLE_INVALID; @@ -869,8 +849,6 @@ bcm2835_audio_detach(device_t dev) return r; mtx_destroy(&sc->vchi_lock); - mtx_destroy(&sc->msg_avail_lock); - cv_destroy(&sc->msg_avail_cv); mtx_destroy(&sc->data_lock); cv_destroy(&sc->data_cv);