From nobody Thu Feb 01 02:47:11 2024 X-Original-To: dev-commits-src-main@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 4TQNbg5C0Pz58r6q; Thu, 1 Feb 2024 02:47:11 +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 4TQNbg4hmpz4c9l; Thu, 1 Feb 2024 02:47:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706755631; 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=JvRRWPJTt5Z6ow4dxYe0JoheY1LRef+LuretC3/bMDQ=; b=vKW1QNO2VR6pQWwRXBu0BQCd8CXbqgNkmxREui5EMeL7lak6q42pD+NtLQMvP37JRinF5R 1CcCknSCVctmnk/QuQZxqEprX/UqJPVpHSJWXbo8RQtZhhH4exF+G+nQ6kBFJ/+BPCvH/k GM6WeK47hYbO/W3lUqp9hTHecWvRfxXXYrRKMRjt3fruwrWd1pMF+bGcdKzZDvMfOmXZdT sDIpY5ndjxy5nIgYOXp9AC5ebCSrttYZMnW0m/4ZE4LQzgwJtl4+1nXxaQLJgdpfgg0gYq BWVWrZPHYWzfH60I4Yy5+amNJpMTeMlr0XnjVL9m+1QWHDwIEIl8CpNDxXtDqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706755631; 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=JvRRWPJTt5Z6ow4dxYe0JoheY1LRef+LuretC3/bMDQ=; b=RoiqSbeMXKZJmufVX+yQ1KOLRgFTtaD00sGcN9qgr8GosT0UKT62882zHXRSKTRSOraabk 4KZMDnvEOL9lE1hI78+xIhmt3CrVAHmqJ74AsLICTZi0+F+LZlcm5Ix/ka2OGnmjYf3cVH JuAjZo1KqIxcouwGTj1K1OsP9pdlU2WtCOJzjfHHYj5ZPxGLTF4TydiNQ3xdmoLpR/x+/n fdZV5yWAT47mVPZOkQwmrNQgMYc7/0S01jCISTRBRTwRhFoiGOR+/8I1IAlpEUE456gn8P TFwCLdGALCBaa2Li/8SOOlQ/6EK/4lDLNiu//PVVek/YgIfnur1oBUwpy4pLGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706755631; a=rsa-sha256; cv=none; b=VplS1vsDkL8mJpppxJBEg0kXXUtWZUUyO8nB6zbDA9TpvJzBpiNvwTKYL9UXq59R8E4YXD RtyrNtIVUsfKN+9H/bO5D4dWMYEgrcIsD+8bhK9j0nrEjfqCOT/3VtCDatZNQYv8Bl8G5B Ha5dloe3bJLJ+bUOwRClsOdHBsrNuDTcp7K/lRtl3NqJThc7HzF43EtBtVMxHqcI4VBTGu b1m1bfZQpH9BlFm67yZwtc0JuNrFO6JK4KcOlf7xn8eFW66jQsgEvcTup/N4B4zNCWzqDM 6nDkVVA2uK1Y9CciiYalW805FpkZxiMoW+/IXffSTbKQdKb5gssquPUrm0dJlQ== 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 4TQNbg3lv1zkVZ; Thu, 1 Feb 2024 02:47:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4112lB4n087901; Thu, 1 Feb 2024 02:47:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4112lBtS087898; Thu, 1 Feb 2024 02:47:11 GMT (envelope-from git) Date: Thu, 1 Feb 2024 02:47:11 GMT Message-Id: <202402010247.4112lBtS087898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Wing Subject: git: d9b3bba2f302 - main - mpr: endianess fix for set/get dpm page0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9b3bba2f3022f1b577fb7a18c523c92551d8257 Auto-Submitted: auto-generated The branch main has been updated by rew: URL: https://cgit.FreeBSD.org/src/commit/?id=d9b3bba2f3022f1b577fb7a18c523c92551d8257 commit d9b3bba2f3022f1b577fb7a18c523c92551d8257 Author: Robert Wing AuthorDate: 2024-02-01 02:33:05 +0000 Commit: Robert Wing CommitDate: 2024-02-01 02:33:05 +0000 mpr: endianess fix for set/get dpm page0 Reviewed by: oshogbo, imp Sponsored by: Klara, Inc. Sponsored by: Datazap Differential Revision: https://reviews.freebsd.org/D43505 --- sys/dev/mpr/mpr_config.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/dev/mpr/mpr_config.c b/sys/dev/mpr/mpr_config.c index 768f69cdc89f..b7882feed158 100644 --- a/sys/dev/mpr/mpr_config.c +++ b/sys/dev/mpr/mpr_config.c @@ -547,8 +547,8 @@ mpr_config_get_dpm_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; request->Header.PageNumber = 0; request->ExtPageLength = request->Header.PageVersion = 0; - request->PageAddress = sc->max_dpm_entries << - MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; + request->PageAddress = htole32(sc->max_dpm_entries << + MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT); cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; error = mpr_wait_command(sc, &cm, 60, CAN_SLEEP); @@ -597,8 +597,8 @@ mpr_config_get_dpm_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; request->Header.PageNumber = 0; request->Header.PageVersion = mpi_reply->Header.PageVersion; - request->PageAddress = sc->max_dpm_entries << - MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; + request->PageAddress = htole32(sc->max_dpm_entries << + MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT); request->ExtPageLength = mpi_reply->ExtPageLength; cm->cm_length = le16toh(request->ExtPageLength) * 4; cm->cm_sge = &request->PageBufferSGE; @@ -684,9 +684,8 @@ int mpr_config_set_dpm_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; request->Header.PageNumber = 0; request->ExtPageLength = request->Header.PageVersion = 0; - /* We can remove below two lines ????*/ - request->PageAddress = 1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; - request->PageAddress |= htole16(entry_idx); + request->PageAddress = htole32( + (1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT) | entry_idx); cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; cm->cm_data = NULL; error = mpr_wait_command(sc, &cm, 60, CAN_SLEEP); @@ -736,8 +735,8 @@ int mpr_config_set_dpm_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, request->Header.PageNumber = 0; request->Header.PageVersion = mpi_reply->Header.PageVersion; request->ExtPageLength = mpi_reply->ExtPageLength; - request->PageAddress = 1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; - request->PageAddress |= htole16(entry_idx); + request->PageAddress = htole32( + (1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT) | entry_idx); cm->cm_length = le16toh(mpi_reply->ExtPageLength) * 4; cm->cm_sge = &request->PageBufferSGE; cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION);