From patchwork Thu Nov 23 15:56:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 746743 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="RDHbz7dV" Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567A8D6F for ; Thu, 23 Nov 2023 07:44:40 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cf6bdf8274so14914245ad.1 for ; Thu, 23 Nov 2023 07:44:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1700754280; x=1701359080; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=YfowhzGgEZ203W40qyCXzBz63ugym7ZqRS0xtdWRHl8=; b=RDHbz7dV5EtOZcNoOhWIJ8SE9R0JIed8wds3aQPSOOdDuY0FbSiUcbhsNQ0URmu8HP 8POSvVfLOoUUD/nfaF+Ec+iNDT9ityuga4zbZkLo3UT7kKg27vlU0o4ICXH6LPcSZKDg DD2SZC90ftVA5BXrVJRlhaW7XwmX4H0S3wVvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700754280; x=1701359080; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YfowhzGgEZ203W40qyCXzBz63ugym7ZqRS0xtdWRHl8=; b=FbpkmmEC8fW3GvBLbhpNzJtKgjCNGalVMSR7RJLVEBtelA4M4bSzObTqxlCJaxBTIB osBeXnMCHR/ISsKMtQkQ2UDKfsUUNfuoYM9VQBZ0BKLXvKtRS1hm/YMHHQ0GXNHEb5L7 4VKEzm6XMXPp4cVhwc9uGHEEgIPeyKKGp4c3s1B0a4IVLHK5YgdGLUC0zyrlkoRI1hpL LQdRivJDp2dtLlNnIFy/tD+BK5GQUhhhR8n7Xl3YKZpjiBvT0KV9nv64fwlQjmFET1v+ yWL7rFYqEiu3+di9M81Sy2U8RXe8CbjuB0SXibFiA3wrJ1Hc/eL3HApi5og0re7KzUY/ K8hg== X-Gm-Message-State: AOJu0Yw0NQcIzGINDdP/RWdg5PquwxLGvOYfxNQ/1zogC7ObE/SVjg6P 5mjmvbqv7/8ZnAKd5dbOrtya1A== X-Google-Smtp-Source: AGHT+IF9guMa1E0DMTYqElA/OTrcd+c/XMINAS5HeCCuq/GvAve3qJrrGLzTzFffnM6cuyT54rY5UQ== X-Received: by 2002:a17:90b:4d0f:b0:268:808:8e82 with SMTP id mw15-20020a17090b4d0f00b0026808088e82mr4197745pjb.1.1700754279763; Thu, 23 Nov 2023 07:44:39 -0800 (PST) Received: from dhcp-10-123-20-95.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y13-20020a17090a390d00b0028558e3f507sm1882347pjb.12.2023.11.23.07.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:44:38 -0800 (PST) From: Sumit Saxena To: martin.petersen@broadcom.com Cc: linux-scsi@vger.kernel.org, sathya.prakash@broadcom.com, chandrakanth.patil@broadcom.com, ranjan.kumar@broadcom.com, Sumit Saxena Subject: [PATCH 2/5] mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 Date: Thu, 23 Nov 2023 21:26:01 +0530 Message-Id: <20231123155604.1615-3-sumit.saxena@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231123155604.1615-1-sumit.saxena@broadcom.com> References: <20231123155604.1615-1-sumit.saxena@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Added PCI IDs checks for the cases where SAS5116 diverges from SAS4116 in behavior. Signed-off-by: Sumit Saxena --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 ++- drivers/scsi/mpi3mr/mpi3mr_os.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index f039f1d98647..0d148c39ebcc 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -1892,7 +1892,8 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx) reply_qid = qidx + 1; op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD; - if (!mrioc->pdev->revision) + if ((mrioc->pdev->device == MPI3_MFGPAGE_DEVID_SAS4116) && + !mrioc->pdev->revision) op_reply_q->num_replies = MPI3MR_OP_REP_Q_QD4K; op_reply_q->ci = 0; op_reply_q->ephase = 1; diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index a8d7dbf0159a..91a22e6e5c3f 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -5101,7 +5101,10 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id) mpi3mr_init_drv_cmd(&mrioc->evtack_cmds[i], MPI3MR_HOSTTAG_EVTACKCMD_MIN + i); - if (pdev->revision) + if ((pdev->device == MPI3_MFGPAGE_DEVID_SAS4116) && + !pdev->revision) + mrioc->enable_segqueue = false; + else mrioc->enable_segqueue = true; init_waitqueue_head(&mrioc->reset_waitq); From patchwork Thu Nov 23 15:56:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 746742 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="JphWNKw+" Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE1C3D47 for ; Thu, 23 Nov 2023 07:44:46 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5c1714df2d8so658471a12.2 for ; Thu, 23 Nov 2023 07:44:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1700754286; x=1701359086; darn=vger.kernel.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=XpTyVLjKzlrnSRxuR7shcDYasZno+ohNMEAr2HGr3sw=; b=JphWNKw+CuCeyulfgFyFepRhXCCyZWxqvlCCYqCcJOs1FmGye+kOJhTmv+xzNbQcgp VNxhJOk6SBywpDCKvc8vnfYctQ08oMQo52W+pjvDu9maJnBHuzMduS+X6uQJuRAnk8pW 0LA9K1WiAhgy3vaQrd8hvIRHK1YaPBsAq3iIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700754286; x=1701359086; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XpTyVLjKzlrnSRxuR7shcDYasZno+ohNMEAr2HGr3sw=; b=oBe0lD5NMHNZyjX/GdLduVqrcD8LZYCVtg3zIP34EjPizglrXmHRSlZhDosae6nU6H +pkkXR2Hq9he/MZ+asBQFnGcG+JZpD4cW6P9s3w1ZUVzZDujAH1AaeqULowI1REt3GAK g0POncK3k+KPh7lEw6Hk/PvZs9ulPPcus9oDXLL09ys5sFHBX5gkLToFYSeCKAPVPxDW v0K5rQKWPE09ZhvrpzXEJK1A0laEWQL/5EmNsn+ss+twYhoDTTrHwMymz6917uHl66qQ JRlHfnbeeHSJBCcdvNJ/U8dlrS1d0rkAppkiggikckNb+/duQdP1WWswDCm9hLQy7PBJ RsTA== X-Gm-Message-State: AOJu0Yxh8VYKauvIzZ7Hi0plUDKBk6tpajHTxR6lx1/EPNRMojPJ3oHu epjhq9HOcbfsszBROKbF44dFeg== X-Google-Smtp-Source: AGHT+IFOxXip6wmo3y3vKxqmdYnW2PlLgze5MYvJN6qOxm58osA/MuVFVtp+uSg3r8O4FnOg4pTXyA== X-Received: by 2002:a17:90b:38d2:b0:285:68f3:80d1 with SMTP id nn18-20020a17090b38d200b0028568f380d1mr1561423pjb.31.1700754286168; Thu, 23 Nov 2023 07:44:46 -0800 (PST) Received: from dhcp-10-123-20-95.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y13-20020a17090a390d00b0028558e3f507sm1882347pjb.12.2023.11.23.07.44.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:44:45 -0800 (PST) From: Sumit Saxena To: martin.petersen@broadcom.com Cc: linux-scsi@vger.kernel.org, sathya.prakash@broadcom.com, chandrakanth.patil@broadcom.com, ranjan.kumar@broadcom.com, Sumit Saxena Subject: [PATCH 4/5] mpi3mr: Add support for status reply descriptor Date: Thu, 23 Nov 2023 21:26:03 +0530 Message-Id: <20231123155604.1615-5-sumit.saxena@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20231123155604.1615-1-sumit.saxena@broadcom.com> References: <20231123155604.1615-1-sumit.saxena@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Inform controller firmware that driver supports status reply descriptor. Signed-off-by: Sumit Saxena --- drivers/scsi/mpi3mr/mpi/mpi30_ioc.h | 1 + drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h b/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h index 1e4a60fc655f..0cb24fc03620 100644 --- a/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h +++ b/drivers/scsi/mpi3mr/mpi/mpi30_ioc.h @@ -28,6 +28,7 @@ struct mpi3_ioc_init_request { __le64 driver_information_address; }; +#define MPI3_IOCINIT_MSGFLAGS_SCSIIOSTATUSREPLY_SUPPORTED (0x04) #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_MASK (0x03) #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_NOT_USED (0x00) #define MPI3_IOCINIT_MSGFLAGS_HOSTMETADATA_SEPARATED (0x01) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 0d148c39ebcc..1ad2f88e0528 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -3194,6 +3194,9 @@ static int mpi3mr_issue_iocinit(struct mpi3mr_ioc *mrioc) current_time = ktime_get_real(); iocinit_req.time_stamp = cpu_to_le64(ktime_to_ms(current_time)); + iocinit_req.msg_flags |= + MPI3_IOCINIT_MSGFLAGS_SCSIIOSTATUSREPLY_SUPPORTED; + init_completion(&mrioc->init_cmds.done); retval = mpi3mr_admin_request_post(mrioc, &iocinit_req, sizeof(iocinit_req), 1);