From nobody Tue May 02 12:20:41 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9fLK5fYmz48wDq; Tue, 2 May 2023 12:20:41 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9fLK5CWxz3thl; Tue, 2 May 2023 12:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXOT0xGaHYqivs0iNlWLQumvjmypZ2FRGuOWLXnps2k=; b=NEYlfAQmtz/9QUrYA/YFf362kAldq8mHJaPo7tWg9297vob4GHH7/oDF+OqfHEVr2PUj2z 0mmtHLB+KljWJcxjjc7vnINnWCzNynTjkKoE8zkce9z8Pp3A4pOP0CHmIJVlgSt4b8BIdE duwSWrWV9r/LKLrb8IPhliZDo0oG6vkJgTrgOxCJqFShF0I+haNeGN0i+HdS1C1WLwWtv5 UqPEpzZBOSz2WpIyS/lh3PkmANlWauKalDF6Wq0n1ncGv1YK/IJBhOnY0WDk7D8INsyNh7 UpQwPOuJ9Zn9dOLd6jOmA+4d6TpJ2hnF+Gdw1R3XHkhFaBMTRNvNbD9HT5Rvbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683030041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXOT0xGaHYqivs0iNlWLQumvjmypZ2FRGuOWLXnps2k=; b=ijsiHlnDL6DWEhB03lQXkhOLI6vKnNLYvGI/SZRjf0avr86hw/QPKE5mZxhjC5L4p2wpKU Aih3qaR9VLI0+Lda40GqrEwas2rnKxnlsUMRKT351vj8ZalzpKQL16gXkEyNUx4FZmemlW PFfZAqdiqq9o+Sl/GoQej23eRahd/yslLreXLDsArEbUiRBKzzFXZpOKLLKwlP4H5sFdQk yxGevVb4ffG6mI3ZFpy7+YyTEU+MLkdyrlZepSEAbXxkGByZXZnDwMK/Ay8r8UUku29Wxj 9ccrXToXFUWq1nc5VvBKh/862pw1mER60Udw35YxvBHUMvlnwg3lFRQBeJXGYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683030041; a=rsa-sha256; cv=none; b=pLCqCAH3/3ShF5J5vSIKnFjiCToDNKo0wgZ7nMnKqe8V9XDMK2tZf+zBtS5sdh0hVxeRgN Bk6BTAn+5/0S63crs+zqLUFSl1MBJIDSXdkd0IWVMtfDsFNC53VKPtsUdmuSP1IrTm39Ou YxVBEYOzrGkBb5R7Ip6TFpHzTuGCdI6pcV5sIMt5uw9FqvB6COthx950Qlp5CZ61mzEIez rJ446M8ItH1/0ZuQ+idGiecBJ9eIYM0PpQ3TV5U/NJf7lQZK0DCU5zwVdts7Bj8W2WhS03 BrxJz2JSeY/sD7bhqG2COIVacTParpnbCespFRYPSdIccNC2HYLp4MJCvZhQrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9fLK4JGSznGG; Tue, 2 May 2023 12:20:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 342CKfaJ067607; Tue, 2 May 2023 12:20:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 342CKflN067606; Tue, 2 May 2023 12:20:41 GMT (envelope-from git) Date: Tue, 2 May 2023 12:20:41 GMT Message-Id: <202305021220.342CKflN067606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mariusz Zaborski Subject: git: 2de69df6f398 - stable/12 - mpr: fix copying of event_mask List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2de69df6f398987cecbc5ac02b2183c561e0f220 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=2de69df6f398987cecbc5ac02b2183c561e0f220 commit 2de69df6f398987cecbc5ac02b2183c561e0f220 Author: Mariusz Zaborski AuthorDate: 2023-04-21 07:50:16 +0000 Commit: Mariusz Zaborski CommitDate: 2023-05-02 12:19:26 +0000 mpr: fix copying of event_mask Before the commit 6cc44223cb6717795afdac4348bbe7e2a968a07d the field event_mask was fully copied to the EventMasks field. After this commit the event_mask (uint8_t) is 4 times casted to EventMask (uint32_t). Because of that 24 bits of each event_mask array is lost. This commits brings back simple copying of field, and after words converting 32 bits field to the requested endian. I don't think we need more sophisticated method, as the array is of size 4 (for 32 bits version). Reviewed by: imp MFC after: 1 week Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D39562 (cherry picked from commit ea6597c38c77c7bfaae71259d8636cbb89add6a3) --- sys/dev/mpr/mpr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr.c b/sys/dev/mpr/mpr.c index 308c88112168..33afb7adf852 100644 --- a/sys/dev/mpr/mpr.c +++ b/sys/dev/mpr/mpr.c @@ -2795,8 +2795,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle, bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; @@ -2850,8 +2851,9 @@ mpr_reregister_events(struct mpr_softc *sc) bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16); } #else + bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask)); for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) - evtreq->EventMasks[i] = htole32(sc->event_mask[i]); + evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]); #endif cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL;