From owner-svn-src-head@freebsd.org Wed Dec 26 10:39:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7818E134C2FA; Wed, 26 Dec 2018 10:39:23 +0000 (UTC) (envelope-from kadesai@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 1FCB77431C; Wed, 26 Dec 2018 10:39:23 +0000 (UTC) (envelope-from kadesai@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 127CF225D2; Wed, 26 Dec 2018 10:39:23 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAdM5p035476; Wed, 26 Dec 2018 10:39:22 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAdMPP035475; Wed, 26 Dec 2018 10:39:22 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261039.wBQAdMPP035475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342528 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FCB77431C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 26 Dec 2018 10:39:23 -0000 Author: kadesai Date: Wed Dec 26 10:39:22 2018 New Revision: 342528 URL: https://svnweb.freebsd.org/changeset/base/342528 Log: Copy back the Sense data at proper location expected by the application typedef struct mps_pass_thru { uint64_t PtrRequest; uint64_t PtrReply; uint64_t PtrData; uint32_t RequestSize; uint32_t ReplySize; uint32_t DataSize; uint32_t DataDirection; uint64_t PtrDataOut; uint32_t DataOutSize; uint32_t Timeout; } mps_pass_thru_t, * ptrmpssas_pass_thru_t; In the above mps_pass_thru structure; Application expects PrtReply buffer should contain both MPI reply followed by sense data. So, updated driver to copy sense data at PtrReply + sizeof(MPI2 reply) location where application wants the driver to copy back the sense data info. Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:38:51 2018 (r342527) +++ head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:39:22 2018 (r342528) @@ -1106,7 +1106,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru SenseCount)), sizeof(struct scsi_sense_data)); mpr_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, + copyout(cm->cm_sense, + (PTRIN(data->PtrReply + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mpr_lock(sc); } @@ -1140,7 +1141,9 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru sz = MIN(le32toh(nvme_error_reply->ErrorResponseCount), NVME_ERROR_RESPONSE_SIZE); mpr_unlock(sc); - copyout(cm->cm_sense, cm->nvme_error_response, sz); + copyout(cm->cm_sense, + (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sz); mpr_lock(sc); } }