svn commit: r319446 - in stable/11: share/man/man4 sys/dev/mpr sys/dev/mps

2017-06-01 Thread Stephen McConnell
Author: slm
Date: Thu Jun  1 16:55:03 2017
New Revision: 319446
URL: https://svnweb.freebsd.org/changeset/base/319446

Log:
  MFC r318895: Fix several problems with mapping code in mps(4).
  MFC r318896: Fix several problems with mapping code in mpr(4).
  
  -Add several comments describing what the mapping code is doing.
  -Added a callout timer to improve check for missing devices when discovery has
   completed so that missing counts are incremented correctly.
  -Fix problems with missing counts not being saved to the HBA.
  -Update man pages mps(4) and mpr(4) to include a description of the use
   use_phy_num sysctl variable.
  -Remove channel field in the mapping structure because it's not used.
  -Improve logging by using mps_dprint or mpr_dprint instead of printf and 
adding
   more logging where appropriate.
  -Add check for a bad index before writing mapping entries to controller.
  -The high missing count check in the mapping table was using the incorrect
   initial value, which could lead to a bad result.
  -The usage of the IN_USE flag for volume mapping was changed to be more
   intuitive, and was not being used correctly.
  -The check for a free DPM entry was changed, as this was completely wrong.
  -Updates to the missing count for volumes were not being done correctly, so 
this
   function was completely rewritten.
  -_mapping_add_to_removal_table() was overly complicated and incorrectly used, 
so
   this function was rewritten.
  -Missing counts for all devices were not being incremented properly, so this
   functionality was added.
  -The search for space in the mapping table for missing enclosures was not
   calculating the found space correctly due to not breaking out of a loop when
   required, and the num_found variable was not being reset when needed.
  -Retries when a device fails to get added due to a full mapping table were
   removed because this is unneccessary.
  -mps_mapping_is_reinit_required() and mpr_mapping_is_reinit_required() were
   removed because they were not being used.
  -Some functions were renamed to avoid confusion between Target IDs and SAS 
IDs.
  -_mapping_check_update_ir_mt_idx() was removed because it was overly
   complicating volume mapping.
  -The setting of the maxtargets variable was changed to include max volumes.
  -The setting of the initiator_id variable was changed to be the invalid target
   ID after all targets, including volumes. Previously, this was set to the last
   valid target ID.
  -Don't exclude target IDs of RAID components or check for a reuse of a target 
ID
   for RAID components.
  -Some endienness was added.
  
  Approved by:  ken, mav

Modified:
  stable/11/share/man/man4/mpr.4
  stable/11/share/man/man4/mps.4
  stable/11/sys/dev/mpr/mpr.c
  stable/11/sys/dev/mpr/mpr_mapping.c
  stable/11/sys/dev/mpr/mpr_sas.c
  stable/11/sys/dev/mpr/mpr_sas_lsi.c
  stable/11/sys/dev/mpr/mpr_user.c
  stable/11/sys/dev/mpr/mprvar.h
  stable/11/sys/dev/mps/mps.c
  stable/11/sys/dev/mps/mps_mapping.c
  stable/11/sys/dev/mps/mps_sas.c
  stable/11/sys/dev/mps/mps_sas_lsi.c
  stable/11/sys/dev/mps/mps_user.c
  stable/11/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/mpr.4
==
--- stable/11/share/man/man4/mpr.4  Thu Jun  1 16:54:10 2017
(r319445)
+++ stable/11/share/man/man4/mpr.4  Thu Jun  1 16:55:03 2017
(r319446)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2017 Avago Technologies
-.\" Copyright (c) 2017 Broadcom Ltd.
+.\" Copyright (c) 2015-2017 Avago Technologies
+.\" Copyright (c) 2015-2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd May 17, 2017
+.Dd May 25, 2017
 .Dt MPR 4
 .Os
 .Sh NAME

Modified: stable/11/share/man/man4/mps.4
==
--- stable/11/share/man/man4/mps.4  Thu Jun  1 16:54:10 2017
(r319445)
+++ stable/11/share/man/man4/mps.4  Thu Jun  1 16:55:03 2017
(r319446)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2016 Avago Technologies
-.\" Copyright (c) 2016 Broadcom Ltd.
+.\" Copyright (c) 2015-2017 Avago Technologies
+.\" Copyright (c) 2015-2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd July 5, 2016
+.Dd May 25, 2017
 .Dt MPS 4
 .Os
 .Sh NAME
@@ -243,13 +243,13 @@ Send SSU to HDDs, but not to SSDs.
 Send SSU to both HDDs and SSDs.
 .El
 .Pp
-To control the feature for a specific adapter, set this tunable value in
+To control this 

svn commit: r319445 - in stable/10: share/man/man4 sys/dev/mpr sys/dev/mps

2017-06-01 Thread Stephen McConnell
Author: slm
Date: Thu Jun  1 16:54:10 2017
New Revision: 319445
URL: https://svnweb.freebsd.org/changeset/base/319445

Log:
  MFC r318895: Fix several problems with mapping code in mps(4).
  MFC r318896: Fix several problems with mapping code in mpr(4).
  
  -Add several comments describing what the mapping code is doing.
  -Added a callout timer to improve check for missing devices when discovery has
   completed so that missing counts are incremented correctly.
  -Fix problems with missing counts not being saved to the HBA.
  -Update man pages mps(4) and mpr(4) to include a description of the use
   use_phy_num sysctl variable.
  -Remove channel field in the mapping structure because it's not used.
  -Improve logging by using mps_dprint or mpr_dprint instead of printf and 
adding
   more logging where appropriate.
  -Add check for a bad index before writing mapping entries to controller.
  -The high missing count check in the mapping table was using the incorrect
   initial value, which could lead to a bad result.
  -The usage of the IN_USE flag for volume mapping was changed to be more
   intuitive, and was not being used correctly.
  -The check for a free DPM entry was changed, as this was completely wrong.
  -Updates to the missing count for volumes were not being done correctly, so 
this
   function was completely rewritten.
  -_mapping_add_to_removal_table() was overly complicated and incorrectly used, 
so
   this function was rewritten.
  -Missing counts for all devices were not being incremented properly, so this
   functionality was added.
  -The search for space in the mapping table for missing enclosures was not
   calculating the found space correctly due to not breaking out of a loop when
   required, and the num_found variable was not being reset when needed.
  -Retries when a device fails to get added due to a full mapping table were
   removed because this is unneccessary.
  -mps_mapping_is_reinit_required() and mpr_mapping_is_reinit_required() were
   removed because they were not being used.
  -Some functions were renamed to avoid confusion between Target IDs and SAS 
IDs.
  -_mapping_check_update_ir_mt_idx() was removed because it was overly
   complicating volume mapping.
  -The setting of the maxtargets variable was changed to include max volumes.
  -The setting of the initiator_id variable was changed to be the invalid target
   ID after all targets, including volumes. Previously, this was set to the last
   valid target ID.
  -Don't exclude target IDs of RAID components or check for a reuse of a target 
ID
   for RAID components.
  -Some endienness was added.
  
  Approved by:  ken, mav

Modified:
  stable/10/share/man/man4/mpr.4
  stable/10/share/man/man4/mps.4
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_mapping.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mpr_sas_lsi.c
  stable/10/sys/dev/mpr/mpr_user.c
  stable/10/sys/dev/mpr/mprvar.h
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_mapping.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mps_sas_lsi.c
  stable/10/sys/dev/mps/mps_user.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/mpr.4
==
--- stable/10/share/man/man4/mpr.4  Thu Jun  1 16:49:48 2017
(r319444)
+++ stable/10/share/man/man4/mpr.4  Thu Jun  1 16:54:10 2017
(r319445)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2017 Avago Technologies
-.\" Copyright (c) 2017 Broadcom Ltd.
+.\" Copyright (c) 2015-2017 Avago Technologies
+.\" Copyright (c) 2015-2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd May 17, 2017
+.Dd May 25, 2017
 .Dt MPR 4
 .Os
 .Sh NAME

Modified: stable/10/share/man/man4/mps.4
==
--- stable/10/share/man/man4/mps.4  Thu Jun  1 16:49:48 2017
(r319444)
+++ stable/10/share/man/man4/mps.4  Thu Jun  1 16:54:10 2017
(r319445)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2016 Avago Technologies
-.\" Copyright (c) 2016 Broadcom Ltd.
+.\" Copyright (c) 2015-2017 Avago Technologies
+.\" Copyright (c) 2015-2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd July 5, 2016
+.Dd May 25, 2017
 .Dt MPS 4
 .Os
 .Sh NAME
@@ -243,13 +243,13 @@ Send SSU to HDDs, but not to SSDs.
 Send SSU to both HDDs and SSDs.
 .El
 .Pp
-To control the feature for a specific adapter, set this tunable value in
+To control this 

svn commit: r319436 - in stable/10: share/man/man4 sys/dev/mpr sys/dev/mpr/mpi sys/dev/mps

2017-06-01 Thread Stephen McConnell
Author: slm
Date: Thu Jun  1 15:43:24 2017
New Revision: 319436
URL: https://svnweb.freebsd.org/changeset/base/319436

Log:
  MFC r286567, r286568, r289426, r289429, r295113, r295286, r299367, r299369,
  r308217, r308301, r311958, r312437, r318188, r318427, r318679
  
  r286567:
  Remove some unused code.
  
  Obtained from:Netflix, Inx.
  
  r286568:
  Remove mps_request_polled(), it's redundant to mps_wait_command()
  
  Obtained from:Netflix, Inc.
  
  r289426:
  Remove _FreeBSD_version check for something that was only an issue with
  9-CURRENT.
  
  Obtained from:  Netlfix, Inc
  MFC after:  3 days
  
  r289429:
  Revert an extra hunk that crept into the last commit.
  
  Submitted by: emax
  Obtained from:Netflix, Inc.
  MFC after:3 days
  
  r295113:
  Clean up unused-but-set-variable spotted by gcc-4.9.
  
  Reviewed by:  mav, slm
  Approved by:  rodrigc (mentor)
  MFC after:2 weeks
  Sponsored by: gandi.net
  
  r295286:
  Add sysctls for dumping out the device mapping tables.  I'm finding this
  useful for debugging device-target translation bugs.
  
  MFC after:3 days
  Sponsored by: Netflix
  
  r299367:
  Remove NULL checks after M_WAITOK allocations from mps(4).
  
  Reviewed by:  asomers@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6296
  
  r299369:
  Remove NULL checks after M_WAITOK allocations from mpr(4).
  
  Reviewed by:  asomers@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D6297
  
  r308217:
  Add a fallback to the device mapper logic.  We've seen systems in the field
  that are apparently misconfigured by the manufacturer and cause the mapping
  logic to fail.  The fallback allows drive numbers to be assigned based on the
  PHY number that they're attached to.  Add sysctls and tunables to overrid
  this new behavior, but they should be considered only necessary for debugging.
  
  Reviewed by:   imp, smh
  Obtained from:Netflix
  MFC after:3 days
  Sponsored by: D8403
  
  r308301:
  Record the LogInfo field when reporting the IOCStatus.  Helps in
  debugging errors.
  
  Submitted by: slm
  Obtained from:Netflix
  MFC after:3 days
  
  r311958:
  Print out the number of queues/MSIx vectors.
  
  Sponsored by: Netflix
  
  r312437:
  Rework the debug print API. Event printing no longer gets special handling.
  All of the printing from the tables file now has wrappers so that the
  handling is cleaner and it's possible to print something out (say, during
  development) without having to fight the global debug flags. This re-org
  will also make it easier to have the tables be compiled out at build time
  if desired.
  
  Other than fixing some minor bugs, there are no user-visible changes from
  this change
  
  Sponsored by: Netflix, Inc.
  Differential Revision:D9238
  
  r318188:
  Improve error messages during command timeout for the mpr and mps
  drivers.
  
  Sponsored by: Netflix
  
  r318427:
  Add tri-mode support (SAS/SATA/PCIe).
  
  This includes NVMe device support and adds support for the following adapters:
  SAS 3408
  SAS 3416
  SAS 3508
  SAS 3516
  SAS 3616
  SAS 3708
  SAS 3716
  
  Reviewed by:ken, scottl, asomers, mav
  Approved by:  ken, scottl, mav
  MFC after:  2 weeks
  Relnotes: yes
  Differential Revision: https://reviews.freebsd.org/D10095
  
  r318679:
  Fix powerpc compiler error.
  
  Approved by:  ken

Added:
  stable/10/sys/dev/mpr/mpi/mpi2_pci.h
 - copied unchanged from r318427, head/sys/dev/mpr/mpi/mpi2_pci.h
Modified:
  stable/10/share/man/man4/mpr.4
  stable/10/sys/dev/mpr/mpi/mpi2.h
  stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h
  stable/10/sys/dev/mpr/mpi/mpi2_hbd.h
  stable/10/sys/dev/mpr/mpi/mpi2_history.txt
  stable/10/sys/dev/mpr/mpi/mpi2_init.h
  stable/10/sys/dev/mpr/mpi/mpi2_ioc.h
  stable/10/sys/dev/mpr/mpi/mpi2_tool.h
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_config.c
  stable/10/sys/dev/mpr/mpr_mapping.c
  stable/10/sys/dev/mpr/mpr_mapping.h
  stable/10/sys/dev/mpr/mpr_pci.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mpr_sas.h
  stable/10/sys/dev/mpr/mpr_sas_lsi.c
  stable/10/sys/dev/mpr/mpr_table.c
  stable/10/sys/dev/mpr/mpr_table.h
  stable/10/sys/dev/mpr/mpr_user.c
  stable/10/sys/dev/mpr/mprvar.h
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_config.c
  stable/10/sys/dev/mps/mps_mapping.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mps_sas_lsi.c
  stable/10/sys/dev/mps/mps_table.c
  stable/10/sys/dev/mps/mps_table.h
  stable/10/sys/dev/mps/mps_user.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/mpr.4
==
--- stable/10/share/man/man4/mpr.4  Thu Jun  1 

svn commit: r319435 - in stable/11: share/man/man4 sys/dev/mpr sys/dev/mpr/mpi sys/dev/mps

2017-06-01 Thread Stephen McConnell
Author: slm
Date: Thu Jun  1 15:39:09 2017
New Revision: 319435
URL: https://svnweb.freebsd.org/changeset/base/319435

Log:
  MFC r308217, r308301, r311958, r312437, r318188, r318427, r318679
  
  r308217:
  Add a fallback to the device mapper logic.  We've seen systems in the field
  that are apparently misconfigured by the manufacturer and cause the mapping
  logic to fail.  The fallback allows drive numbers to be assigned based on the
  PHY number that they're attached to.  Add sysctls and tunables to overrid
  this new behavior, but they should be considered only necessary for debugging.
  
  Reviewed by:   imp, smh
  Obtained from:Netflix
  MFC after:3 days
  Sponsored by: D8403
  
  r308301:
  Record the LogInfo field when reporting the IOCStatus.  Helps in
  debugging errors.
  
  Submitted by: slm
  Obtained from:Netflix
  MFC after:3 days
  
  r311958:
  Print out the number of queues/MSIx vectors.
  
  Sponsored by: Netflix
  
  r312437:
  Rework the debug print API. Event printing no longer gets special handling.
  All of the printing from the tables file now has wrappers so that the
  handling is cleaner and it's possible to print something out (say, during
  development) without having to fight the global debug flags. This re-org
  will also make it easier to have the tables be compiled out at build time
  if desired.
  
  Other than fixing some minor bugs, there are no user-visible changes from
  this change
  
  Sponsored by: Netflix, Inc.
  Differential Revision:D9238
  
  r318188:
  Improve error messages during command timeout for the mpr and mps
  drivers.
  
  Sponsored by: Netflix
  
  r318427:
  Add tri-mode support (SAS/SATA/PCIe).
  
  This includes NVMe device support and adds support for the following adapters:
  SAS 3408
  SAS 3416
  SAS 3508
  SAS 3516
  SAS 3616
  SAS 3708
  SAS 3716
  
  Reviewed by:ken, scottl, asomers, mav
  Approved by:  ken, scottl, mav
  MFC after:  2 weeks
  Relnotes: yes
  Differential Revision: https://reviews.freebsd.org/D10095
  
  r318679:
  Fix powerpc compiler error.
  
  Approved by:  ken

Added:
  stable/11/sys/dev/mpr/mpi/mpi2_pci.h
 - copied unchanged from r318427, head/sys/dev/mpr/mpi/mpi2_pci.h
Modified:
  stable/11/share/man/man4/mpr.4
  stable/11/sys/dev/mpr/mpi/mpi2.h
  stable/11/sys/dev/mpr/mpi/mpi2_cnfg.h
  stable/11/sys/dev/mpr/mpi/mpi2_hbd.h
  stable/11/sys/dev/mpr/mpi/mpi2_history.txt
  stable/11/sys/dev/mpr/mpi/mpi2_init.h
  stable/11/sys/dev/mpr/mpi/mpi2_ioc.h
  stable/11/sys/dev/mpr/mpi/mpi2_tool.h
  stable/11/sys/dev/mpr/mpr.c
  stable/11/sys/dev/mpr/mpr_config.c
  stable/11/sys/dev/mpr/mpr_mapping.c
  stable/11/sys/dev/mpr/mpr_mapping.h
  stable/11/sys/dev/mpr/mpr_pci.c
  stable/11/sys/dev/mpr/mpr_sas.c
  stable/11/sys/dev/mpr/mpr_sas.h
  stable/11/sys/dev/mpr/mpr_sas_lsi.c
  stable/11/sys/dev/mpr/mpr_table.c
  stable/11/sys/dev/mpr/mpr_table.h
  stable/11/sys/dev/mpr/mpr_user.c
  stable/11/sys/dev/mpr/mprvar.h
  stable/11/sys/dev/mps/mps.c
  stable/11/sys/dev/mps/mps_sas.c
  stable/11/sys/dev/mps/mps_sas_lsi.c
  stable/11/sys/dev/mps/mps_table.c
  stable/11/sys/dev/mps/mps_table.h
  stable/11/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/mpr.4
==
--- stable/11/share/man/man4/mpr.4  Thu Jun  1 15:12:51 2017
(r319434)
+++ stable/11/share/man/man4/mpr.4  Thu Jun  1 15:39:09 2017
(r319435)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2016 Avago Technologies
-.\" Copyright (c) 2016 Broadcom Ltd.
+.\" Copyright (c) 2017 Avago Technologies
+.\" Copyright (c) 2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,12 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd July 6, 2016
+.Dd May 17, 2017
 .Dt MPR 4
 .Os
 .Sh NAME
 .Nm mpr
-.Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver"
+.Nd "LSI Fusion-MPT 3/3.5 IT/IR 12Gb/s Serial Attached SCSI/SATA/PCIe driver"
 .Sh SYNOPSIS
 To compile this driver into the kernel, place these lines in the kernel
 configuration file:
@@ -62,8 +62,8 @@ mpr_load="YES"
 The
 .Nm
 driver provides support for Broadcom Ltd./Avago Tech (LSI)
-Fusion-MPT 3 IT/IR
-.Tn SAS
+Fusion-MPT 3/3.5 IT/IR
+.Tn SAS/PCIe
 controllers.
 .Sh HARDWARE
 These controllers are supported by the
@@ -81,6 +81,24 @@ Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS)
 Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS)
 .It
 Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3316 (16 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3324 (24 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3408 (8 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3416 (16 Port SAS/PCIe)
+.It

RE: svn commit: r318895 - in head: share/man/man4 sys/dev/mps

2017-05-30 Thread Stephen Mcconnell via svn-src-all
> -Original Message-
> From: Alexey Dokuchaev [mailto:da...@freebsd.org]
> Sent: Thursday, May 25, 2017 1:17 PM
> To: Stephen McConnell
> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-
> h...@freebsd.org
> Subject: Re: svn commit: r318895 - in head: share/man/man4 sys/dev/mps
>
> On Thu, May 25, 2017 at 07:14:44PM +, Stephen McConnell wrote:
> > New Revision: 318895
> > URL: https://svnweb.freebsd.org/changeset/base/318895
> >
> > Log:
> >   Fix several problems with mapping code.
> >
> >   Reviewed by:ken, scottl, asomers, ambrisko, mav
> >   Approved by:  ken, mav
> >   MFC after:  1 week
> >   Differential Revision: https://reviews.freebsd.org/D10878
>
> It would be nice to mention, at least briefly, what were those problems
in the
> commit log.

You're right. Normally I would have done that. Not sure why I didn't this
time.

>
> ./danfe
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318896 - in head: share/man/man4 sys/dev/mpr

2017-05-25 Thread Stephen McConnell
Author: slm
Date: Thu May 25 19:20:06 2017
New Revision: 318896
URL: https://svnweb.freebsd.org/changeset/base/318896

Log:
  Fix several problems with mapping code.
  
  Reviewed by:ken, scottl, asomers, ambrisko, mav
  Approved by:  ken, mav
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D10861

Modified:
  head/share/man/man4/mpr.4
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/share/man/man4/mpr.4
==
--- head/share/man/man4/mpr.4   Thu May 25 19:14:44 2017(r318895)
+++ head/share/man/man4/mpr.4   Thu May 25 19:20:06 2017(r318896)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2017 Avago Technologies
-.\" Copyright (c) 2017 Broadcom Ltd.
+.\" Copyright (c) 2015-2017 Avago Technologies
+.\" Copyright (c) 2015-2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd May 17, 2017
+.Dd May 25, 2017
 .Dt MPR 4
 .Os
 .Sh NAME

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Thu May 25 19:14:44 2017(r318895)
+++ head/sys/dev/mpr/mpr.c  Thu May 25 19:20:06 2017(r318896)
@@ -520,7 +520,8 @@ mpr_iocfacts_allocate(struct mpr_softc *
 */
if (reallocating) {
mpr_iocfacts_free(sc);
-   mprsas_realloc_targets(sc, saved_facts.MaxTargets);
+   mprsas_realloc_targets(sc, saved_facts.MaxTargets +
+   saved_facts.MaxVolumes);
}
 
/*
@@ -1663,6 +1664,7 @@ mpr_attach(struct mpr_softc *sc)
 
mtx_init(>mpr_mtx, "MPR lock", NULL, MTX_DEF);
callout_init_mtx(>periodic, >mpr_mtx, 0);
+   callout_init_mtx(>device_check_callout, >mpr_mtx, 0);
TAILQ_INIT(>event_list);
timevalclear(>lastfail);
 
@@ -1832,6 +1834,7 @@ mpr_free(struct mpr_softc *sc)
mpr_unlock(sc);
/* Lock must not be held for this */
callout_drain(>periodic);
+   callout_drain(>device_check_callout);
 
if (((error = mpr_detach_log(sc)) != 0) ||
((error = mpr_detach_sas(sc)) != 0))

Modified: head/sys/dev/mpr/mpr_mapping.c
==
--- head/sys/dev/mpr/mpr_mapping.c  Thu May 25 19:14:44 2017
(r318895)
+++ head/sys/dev/mpr/mpr_mapping.c  Thu May 25 19:20:06 2017
(r318896)
@@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 /**
- * _mapping_clear_entry - Clear a particular mapping entry.
+ * _mapping_clear_map_entry - Clear a particular mapping entry.
  * @map_entry: map table entry
  *
  * Returns nothing.
@@ -73,7 +73,6 @@ _mapping_clear_map_entry(struct dev_mapp
map_entry->phy_bits = 0;
map_entry->dpm_entry_num = MPR_DPM_BAD_IDX;
map_entry->dev_handle = 0;
-   map_entry->channel = -1;
map_entry->id = -1;
map_entry->missing_count = 0;
map_entry->init_complete = 0;
@@ -140,12 +139,15 @@ _mapping_commit_enc_entry(struct mpr_sof
dpm_entry->PhysicalBitsMapping = htole32(et_entry->phy_bits);
dpm_entry->Reserved1 = 0;
 
+   mpr_dprint(sc, MPR_MAPPING, "%s: Writing DPM entry %d for enclosure.\n",
+   __func__, et_entry->dpm_entry_num);
memcpy(_page.Entry, (u8 *)dpm_entry,
sizeof(Mpi2DriverMap0Entry_t));
if (mpr_config_set_dpm_pg0(sc, _reply, _page,
et_entry->dpm_entry_num)) {
-   printf("%s: write of dpm entry %d for enclosure failed\n",
-   __func__, et_entry->dpm_entry_num);
+   mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: Write of DPM "
+   "entry %d for enclosure failed.\n", __func__,
+   et_entry->dpm_entry_num);
dpm_entry->MappingInformation = le16toh(dpm_entry->
MappingInformation);
dpm_entry->DeviceIndex = le16toh(dpm_entry->DeviceIndex);
@@ -164,7 +166,7 @@ _mapping_commit_enc_entry(struct mpr_sof
 /**
  * _mapping_commit_map_entry - write a particular map table entry in DPM page0.
  * @sc: per adapter object
- * @enc_entry: enclosure table entry
+ * @mt_entry: mapping table entry
  *
  * Returns 0 for success, non-zero for failure.
  */
@@ -180,6 +182,19 @@ _mapping_commit_map_entry(struct mpr_sof
if (!sc->is_dpm_enable)
return 0;
 
+   /*
+* It's possible that this Map Entry points to a BAD DPM index. This
+* can happen if the Map Entry is a for a missing device and the DPM
+* entry that was being used by this device is now being used by 

svn commit: r318895 - in head: share/man/man4 sys/dev/mps

2017-05-25 Thread Stephen McConnell
Author: slm
Date: Thu May 25 19:14:44 2017
New Revision: 318895
URL: https://svnweb.freebsd.org/changeset/base/318895

Log:
  Fix several problems with mapping code.
  
  Reviewed by:ken, scottl, asomers, ambrisko, mav
  Approved by:  ken, mav
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D10878

Modified:
  head/share/man/man4/mps.4
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_mapping.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas_lsi.c
  head/sys/dev/mps/mps_user.c
  head/sys/dev/mps/mpsvar.h

Modified: head/share/man/man4/mps.4
==
--- head/share/man/man4/mps.4   Thu May 25 19:02:54 2017(r318894)
+++ head/share/man/man4/mps.4   Thu May 25 19:14:44 2017(r318895)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2016 Avago Technologies
-.\" Copyright (c) 2016 Broadcom Ltd.
+.\" Copyright (c) 2015-2017 Avago Technologies
+.\" Copyright (c) 2015-2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,7 @@
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd July 5, 2016
+.Dd May 25, 2017
 .Dt MPS 4
 .Os
 .Sh NAME
@@ -241,13 +241,13 @@ Send SSU to HDDs, but not to SSDs.
 Send SSU to both HDDs and SSDs.
 .El
 .Pp
-To control the feature for a specific adapter, set this tunable value in
+To control this feature for a specific adapter, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mps.X.enable_ssu
 .Ed
 .Pp
-The same set of values are valid when setting this tunable for all adapters.
+The same set of values are valid as when setting this tunable for all adapters.
 .Pp
 SATA disks that take several seconds to spin up and fail the SATA Identify
 command might not be discovered by the driver.
@@ -273,6 +273,45 @@ dev.mps.X.spinup_wait_time=
 tunable.
  is the number of seconds to wait for SATA devices to spin up when they 
fail
 the initial SATA Identify command.
+.Pp
+The driver can map devices discovered by the adapter so that target IDs
+corresponding to a specific device persist across resets and reboots.
+In some cases it is possible for devices to lose their mapped IDs due to
+unexpected behavior from certain hardware, such as some types of enclosures.
+To overcome this problem, a tunable is provided that will force the driver to
+map devices using the Phy number associated with the device.
+This feature is not recommended if the topology includes multiple
+enclosures/expanders.
+If multiple enclosures/expanders are present in the topology, Phy numbers are
+repeated, causing all devices at these Phy numbers except the first device to
+fail enumeration.
+To control this feature for all adapters, set the
+.Bd -literal -offset indent
+hw.mps.use_phy_num
+.Ed
+.Pp
+tunable in
+.Xr loader.conf 5
+to one of these values:
+.Bl -tag -width 6n -offset indent
+.It -1
+Only use Phy numbers to map devices and bypass the driver's mapping logic.
+.It 0
+Never use Phy numbers to map devices.
+.It 1
+Use Phy numbers to map devices, but only if the driver's mapping logic fails
+to map the device that is being enumerated.
+This is the default value.
+.El
+.Pp
+To control this feature for a specific adapter, set this tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mps.X.use_phy_num
+.Ed
+.Pp
+The same set of values are valid as when setting this tunable for all adapters.
+.Pp
 .Sh DEBUGGING
 To enable debugging prints from the
 .Nm

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Thu May 25 19:02:54 2017(r318894)
+++ head/sys/dev/mps/mps.c  Thu May 25 19:14:44 2017(r318895)
@@ -505,7 +505,8 @@ mps_iocfacts_allocate(struct mps_softc *
 */
if (reallocating) {
mps_iocfacts_free(sc);
-   mpssas_realloc_targets(sc, saved_facts.MaxTargets);
+   mpssas_realloc_targets(sc, saved_facts.MaxTargets +
+   saved_facts.MaxVolumes);
}
 
/*
@@ -1518,6 +1519,7 @@ mps_attach(struct mps_softc *sc)
 
mtx_init(>mps_mtx, "MPT2SAS lock", NULL, MTX_DEF);
callout_init_mtx(>periodic, >mps_mtx, 0);
+   callout_init_mtx(>device_check_callout, >mps_mtx, 0);
TAILQ_INIT(>event_list);
timevalclear(>lastfail);
 
@@ -1682,6 +1684,7 @@ mps_free(struct mps_softc *sc)
mps_unlock(sc);
/* Lock must not be held for this */
callout_drain(>periodic);
+   callout_drain(>device_check_callout);
 
if (((error = mps_detach_log(sc)) != 0) ||
((error = mps_detach_sas(sc)) != 0))

Modified: head/sys/dev/mps/mps_mapping.c
==
--- 

RE: svn commit: r318427 - in head: share/man/man4 sys/dev/mpr sys/dev/mpr/mpi

2017-05-22 Thread Stephen Mcconnell via svn-src-all
> -Original Message-
> From: Konstantin Belousov [mailto:kostik...@gmail.com]
> Sent: Monday, May 22, 2017 8:57 AM
> To: Stephen McConnell
> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-
> h...@freebsd.org
> Subject: Re: svn commit: r318427 - in head: share/man/man4 sys/dev/mpr
> sys/dev/mpr/mpi
>
> On Wed, May 17, 2017 at 09:33:37PM +, Stephen McConnell wrote:
> > Author: slm
> > Date: Wed May 17 21:33:37 2017
> > New Revision: 318427
> > URL: https://svnweb.freebsd.org/changeset/base/318427
> >
> > Log:
> >   Add tri-mode support (SAS/SATA/PCIe).
> >
> >   This includes NVMe device support and adds support for the following
> adapters:
> >   SAS 3408
> >   SAS 3416
> >   SAS 3508
> >   SAS 3516
> >   SAS 3616
> >   SAS 3708
> >   SAS 3716
> >
> >   Reviewed by:ken, scottl, asomers, mav
> >   Approved by:  ken, scottl, mav
> >   MFC after:  2 weeks
> >   Relnotes: yes
> >   Differential Revision: https://reviews.freebsd.org/D10095
>
> It seems that this commit causes the following compilation issue:
>
> cc1: warnings being treated as errors
> /scratch/tmp/kib/ino64/sys/dev/mpr/mpr_sas.c: In function
> 'mprsas_build_nvme_unm
> ap':
> /scratch/tmp/kib/ino64/sys/dev/mpr/mpr_sas.c:1839: warning: cast to
pointer
> from  integer of different size [-Wint-to-pointer-cast]
> --- mpr_sas.o ---
> *** [mpr_sas.o] Error code 1
>
> at least on powerpc.

Fixed in r318679
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318679 - head/sys/dev/mpr

2017-05-22 Thread Stephen McConnell
Author: slm
Date: Mon May 22 20:27:29 2017
New Revision: 318679
URL: https://svnweb.freebsd.org/changeset/base/318679

Log:
  Fix powerpc compiler error.
  
  Approved by:  ken

Modified:
  head/sys/dev/mpr/mpr_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon May 22 20:11:40 2017(r318678)
+++ head/sys/dev/mpr/mpr_sas.c  Mon May 22 20:27:29 2017(r318679)
@@ -1836,8 +1836,8 @@ mprsas_build_nvme_unmap(struct mpr_softc
mprsas_log_command(cm, MPR_XINFO, "%s cm %p ccb %p outstanding %u\n",
__func__, cm, ccb, targ->outstanding);
 
-   mpr_build_nvme_prp(sc, cm, req, (void *)nvme_dsm_ranges_dma_handle, 0,
-   data_length);
+   mpr_build_nvme_prp(sc, cm, req,
+   (void *)(uintptr_t)nvme_dsm_ranges_dma_handle, 0, data_length);
mpr_map_command(sc, cm);
 
 out:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


RE: svn commit: r318427 - in head: share/man/man4 sys/dev/mpr sys/dev/mpr/mpi

2017-05-22 Thread Stephen Mcconnell via svn-src-all
> -Original Message-
> From: Konstantin Belousov [mailto:kostik...@gmail.com]
> Sent: Monday, May 22, 2017 8:57 AM
> To: Stephen McConnell
> Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src-
> h...@freebsd.org
> Subject: Re: svn commit: r318427 - in head: share/man/man4 sys/dev/mpr
> sys/dev/mpr/mpi
>
> On Wed, May 17, 2017 at 09:33:37PM +, Stephen McConnell wrote:
> > Author: slm
> > Date: Wed May 17 21:33:37 2017
> > New Revision: 318427
> > URL: https://svnweb.freebsd.org/changeset/base/318427
> >
> > Log:
> >   Add tri-mode support (SAS/SATA/PCIe).
> >
> >   This includes NVMe device support and adds support for the following
> adapters:
> >   SAS 3408
> >   SAS 3416
> >   SAS 3508
> >   SAS 3516
> >   SAS 3616
> >   SAS 3708
> >   SAS 3716
> >
> >   Reviewed by:ken, scottl, asomers, mav
> >   Approved by:  ken, scottl, mav
> >   MFC after:  2 weeks
> >   Relnotes: yes
> >   Differential Revision: https://reviews.freebsd.org/D10095
>
> It seems that this commit causes the following compilation issue:
>
> cc1: warnings being treated as errors
> /scratch/tmp/kib/ino64/sys/dev/mpr/mpr_sas.c: In function
> 'mprsas_build_nvme_unm
> ap':
> /scratch/tmp/kib/ino64/sys/dev/mpr/mpr_sas.c:1839: warning: cast to
pointer
> from  integer of different size [-Wint-to-pointer-cast]
> --- mpr_sas.o ---
> *** [mpr_sas.o] Error code 1
>
> at least on powerpc.

Thanks. I'll take a look.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r318427 - in head: share/man/man4 sys/dev/mpr sys/dev/mpr/mpi

2017-05-17 Thread Stephen McConnell
Author: slm
Date: Wed May 17 21:33:37 2017
New Revision: 318427
URL: https://svnweb.freebsd.org/changeset/base/318427

Log:
  Add tri-mode support (SAS/SATA/PCIe).
  
  This includes NVMe device support and adds support for the following adapters:
  SAS 3408
  SAS 3416
  SAS 3508
  SAS 3516
  SAS 3616
  SAS 3708
  SAS 3716
  
  Reviewed by:ken, scottl, asomers, mav
  Approved by:  ken, scottl, mav
  MFC after:  2 weeks
  Relnotes: yes
  Differential Revision: https://reviews.freebsd.org/D10095

Added:
  head/sys/dev/mpr/mpi/mpi2_pci.h   (contents, props changed)
Modified:
  head/share/man/man4/mpr.4
  head/sys/dev/mpr/mpi/mpi2.h
  head/sys/dev/mpr/mpi/mpi2_cnfg.h
  head/sys/dev/mpr/mpi/mpi2_hbd.h
  head/sys/dev/mpr/mpi/mpi2_history.txt
  head/sys/dev/mpr/mpi/mpi2_init.h
  head/sys/dev/mpr/mpi/mpi2_ioc.h
  head/sys/dev/mpr/mpi/mpi2_tool.h
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_mapping.h
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_table.c
  head/sys/dev/mpr/mpr_table.h
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/share/man/man4/mpr.4
==
--- head/share/man/man4/mpr.4   Wed May 17 21:14:27 2017(r318426)
+++ head/share/man/man4/mpr.4   Wed May 17 21:33:37 2017(r318427)
@@ -1,8 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
-.\" Copyright (c) 2016 Avago Technologies
-.\" Copyright (c) 2016 Broadcom Ltd.
+.\" Copyright (c) 2017 Avago Technologies
+.\" Copyright (c) 2017 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,12 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd July 6, 2016
+.Dd May 17, 2017
 .Dt MPR 4
 .Os
 .Sh NAME
 .Nm mpr
-.Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver"
+.Nd "LSI Fusion-MPT 3/3.5 IT/IR 12Gb/s Serial Attached SCSI/SATA/PCIe driver"
 .Sh SYNOPSIS
 To compile this driver into the kernel, place these lines in the kernel
 configuration file:
@@ -62,8 +62,8 @@ mpr_load="YES"
 The
 .Nm
 driver provides support for Broadcom Ltd./Avago Tech (LSI)
-Fusion-MPT 3 IT/IR
-.Tn SAS
+Fusion-MPT 3/3.5 IT/IR
+.Tn SAS/PCIe
 controllers.
 .Sh HARDWARE
 These controllers are supported by the
@@ -81,6 +81,24 @@ Broadcom Ltd./Avago Tech (LSI) SAS 3108 
 Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS)
 .It
 Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3316 (16 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3324 (24 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3408 (8 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3416 (16 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3508 (8 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3516 (16 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3616 (16 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3708 (8 Port SAS/PCIe)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3716 (16 Port SAS/PCIe)
 .El
 .Sh CONFIGURATION
 In all tunable descriptions below, X represents the adapter number.
@@ -156,6 +174,24 @@ dev.mpr.X.io_cmds_active
 .Xr sysctl 8
 variable.
 .Pp
+The current number of free PRP pages is stored in the
+dev.mpr.X.prp_pages_free
+.Xr sysctl 8
+variable.
+PRP pages are used by NVMe devices for I/O transfers, much like Scatter/Gather
+lists.
+.Pp
+The lowest number of free PRP pages seen since boot is stored in the
+dev.mpr.X.prp_pages_free_lowwater
+.Xr sysctl 8
+variable.
+.Pp
+The number of times that PRP page allocations have failed since boot is
+stored in the
+dev.mpr.X.prp_page_alloc_fail
+.Xr sysctl 8
+variable.
+.Pp
 To set the maximum number of pages that will be used per I/O for all adapters,
 set this tunable in
 .Xr loader.conf 5 :
@@ -229,13 +265,13 @@ Send SSU to HDDs, but not to SSDs.
 Send SSU to both HDDs and SSDs.
 .El
 .Pp
-To control the feature for a specific adapter, set this tunable value in
+To control this feature for a specific adapter, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.enable_ssu
 .Ed
 .Pp
-The same set of values are valid when setting this tunable for all adapters.
+The same set of values are valid as when setting this tunable for all adapters.
 .Pp
 SATA disks that take several seconds to spin up and fail the SATA Identify
 command might not be discovered by the driver.
@@ -261,6 +297,45 @@ dev.mpr.X.spinup_wait_time=
 tunable.
  is the number of seconds to wait for SATA devices to spin up when they 
fail
 the initial SATA Identify command.
+.Pp
+The driver can map devices discovered by the adapter so that target IDs
+corresponding to a specific device persist across resets and reboots.
+In some cases it is 

svn commit: r303089 - in stable/10: share/man/man4 sys/dev/mpr sys/dev/mps

2016-07-20 Thread Stephen McConnell
Author: slm
Date: Wed Jul 20 14:38:02 2016
New Revision: 303089
URL: https://svnweb.freebsd.org/changeset/base/303089

Log:
  MFC r302673
  Use real values to calculate Max I/O size instead of guessing.
  
  Reviewed by:  ken, scottl
  Approved by:  ken, scottl, ambrisko (mentors)
  Differential Revision:https://reviews.freebsd.org/D7043

Modified:
  stable/10/share/man/man4/mpr.4
  stable/10/share/man/man4/mps.4
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mprvar.h
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/mpr.4
==
--- stable/10/share/man/man4/mpr.4  Wed Jul 20 12:46:21 2016
(r303088)
+++ stable/10/share/man/man4/mpr.4  Wed Jul 20 14:38:02 2016
(r303089)
@@ -29,7 +29,7 @@
 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGES.
-.\" 
+.\"
 .\" mpr driver man page.
 .\"
 .\" Author: Ken Merry <k...@freebsd.org>
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2016
+.Dd July 6, 2016
 .Dt MPR 4
 .Os
 .Sh NAME
@@ -156,6 +156,29 @@ The current number of active I/O command
 dev.mpr.X.io_cmds_active
 .Xr sysctl 8
 variable.
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for all adapters,
+set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.max_io_pages=
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for a specific
+adapter, set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.max_io_pages=
+.Ed
+.Pp
+The default max_io_pages value is -1, meaning that the maximum I/O size that
+will be used per I/O will be calculated using the IOCFacts values stored in
+the controller.
+The lowest value that the driver will use for max_io_pages is 1, otherwise
+IOCFacts will be used to calculate the maximum I/O size.
+The smaller I/O size calculated from either max_io_pages or IOCFacts will be 
the
+maximum I/O size used by the driver.
 .Pp
 The highest number of active I/O commands seen since boot is stored in the
 dev.mpr.X.io_cmds_highwater
@@ -220,7 +243,7 @@ SATA disks that take several seconds to 
 command might not be discovered by the driver.
 This problem can sometimes be overcome by increasing the value of the spinup
 wait time in
-.Xr loader.conf 5 :
+.Xr loader.conf 5
 with the
 .Bd -literal -offset indent
 hw.mpr.spinup_wait_time=
@@ -250,7 +273,7 @@ hw.mpr.X.debug_level
 .Pp
 tunable, either in
 .Xr loader.conf 5
-or by using  
+or by using
 .Xr sysctl 8 .
 These bits have the described effects:
 .Bd -literal -offset indent

Modified: stable/10/share/man/man4/mps.4
==
--- stable/10/share/man/man4/mps.4  Wed Jul 20 12:46:21 2016
(r303088)
+++ stable/10/share/man/man4/mps.4  Wed Jul 20 14:38:02 2016
(r303089)
@@ -1,5 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
+.\" Copyright (c) 2014 LSI Corp
+.\" Copyright (c) 2016 Avago Technologies
+.\" Copyright (c) 2016 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -30,25 +33,27 @@
 .\" mps driver man page.
 .\"
 .\" Author: Ken Merry <k...@freebsd.org>
+.\" Author: Stephen McConnell <s...@freebsd.org>
 .\"
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd December 9, 2015
+.Dd July 5, 2016
 .Dt MPS 4
 .Os
 .Sh NAME
 .Nm mps
-.Nd LSI Fusion-MPT 2 Serial Attached SCSI driver
+.Nd "LSI Fusion-MPT 2 IT/IR 6Gb/s Serial Attached SCSI/SATA driver"
 .Sh SYNOPSIS
-To compile this driver into your kernel,
-place the following lines in your kernel configuration file:
+To compile this driver into the kernel, place these lines in the kernel
+configuration file:
 .Bd -ragged -offset indent
+.Cd "device pci"
 .Cd "device scbus"
 .Cd "device mps"
 .Ed
 .Pp
-Or, to load the driver as a module at boot, place the following line in
+The driver can be loaded as a module at boot time by placing this line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 mps_load="YES"
@@ -56,35 +61,30 @@ mps_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for LSI Logic Fusion-MPT 2
+driver provides support for Broadcom Ltd./Avago Tech (LSI)
+Fusion-MPT 2 IT/IR
 .Tn SAS
 controllers and WarpDrive solid state storage cards.
 .Sh HARDWARE
-The
+These controllers are supported by the
 .Nm
-driver supports the following hardware

svn commit: r303029 - in stable/11: share/man/man4 sys/dev/mpr sys/dev/mps

2016-07-19 Thread Stephen McConnell
Author: slm
Date: Tue Jul 19 16:46:27 2016
New Revision: 303029
URL: https://svnweb.freebsd.org/changeset/base/303029

Log:
  MFC r302673
  Use real values to calculate Max I/O size instead of guessing.
  
  Reviewed by:  ken, scottl
  Approved by:  re(gjb), ken, scottl, ambrisko (mentors)
  Differential Revision:https://reviews.freebsd.org/D7043

Modified:
  stable/11/share/man/man4/mpr.4
  stable/11/share/man/man4/mps.4
  stable/11/sys/dev/mpr/mpr.c
  stable/11/sys/dev/mpr/mpr_sas.c
  stable/11/sys/dev/mpr/mprvar.h
  stable/11/sys/dev/mps/mps.c
  stable/11/sys/dev/mps/mps_sas.c
  stable/11/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/mpr.4
==
--- stable/11/share/man/man4/mpr.4  Tue Jul 19 16:34:49 2016
(r303028)
+++ stable/11/share/man/man4/mpr.4  Tue Jul 19 16:46:27 2016
(r303029)
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2016
+.Dd July 6, 2016
 .Dt MPR 4
 .Os
 .Sh NAME
@@ -156,6 +156,29 @@ The current number of active I/O command
 dev.mpr.X.io_cmds_active
 .Xr sysctl 8
 variable.
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for all adapters,
+set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.max_io_pages=
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for a specific
+adapter, set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.max_io_pages=
+.Ed
+.Pp
+The default max_io_pages value is -1, meaning that the maximum I/O size that
+will be used per I/O will be calculated using the IOCFacts values stored in
+the controller.
+The lowest value that the driver will use for max_io_pages is 1, otherwise
+IOCFacts will be used to calculate the maximum I/O size.
+The smaller I/O size calculated from either max_io_pages or IOCFacts will be 
the
+maximum I/O size used by the driver.
 .Pp
 The highest number of active I/O commands seen since boot is stored in the
 dev.mpr.X.io_cmds_highwater
@@ -220,7 +243,7 @@ SATA disks that take several seconds to 
 command might not be discovered by the driver.
 This problem can sometimes be overcome by increasing the value of the spinup
 wait time in
-.Xr loader.conf 5 :
+.Xr loader.conf 5
 with the
 .Bd -literal -offset indent
 hw.mpr.spinup_wait_time=

Modified: stable/11/share/man/man4/mps.4
==
--- stable/11/share/man/man4/mps.4  Tue Jul 19 16:34:49 2016
(r303028)
+++ stable/11/share/man/man4/mps.4  Tue Jul 19 16:46:27 2016
(r303029)
@@ -1,5 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
+.\" Copyright (c) 2014 LSI Corp
+.\" Copyright (c) 2016 Avago Technologies
+.\" Copyright (c) 2016 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -30,25 +33,27 @@
 .\" mps driver man page.
 .\"
 .\" Author: Ken Merry <k...@freebsd.org>
+.\" Author: Stephen McConnell <s...@freebsd.org>
 .\"
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd December 9, 2015
+.Dd July 5, 2016
 .Dt MPS 4
 .Os
 .Sh NAME
 .Nm mps
-.Nd LSI Fusion-MPT 2 Serial Attached SCSI driver
+.Nd "LSI Fusion-MPT 2 IT/IR 6Gb/s Serial Attached SCSI/SATA driver"
 .Sh SYNOPSIS
-To compile this driver into your kernel,
-place the following lines in your kernel configuration file:
+To compile this driver into the kernel, place these lines in the kernel
+configuration file:
 .Bd -ragged -offset indent
+.Cd "device pci"
 .Cd "device scbus"
 .Cd "device mps"
 .Ed
 .Pp
-Or, to load the driver as a module at boot, place the following line in
+The driver can be loaded as a module at boot time by placing this line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 mps_load="YES"
@@ -56,35 +61,30 @@ mps_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for LSI Logic Fusion-MPT 2
+driver provides support for Broadcom Ltd./Avago Tech (LSI)
+Fusion-MPT 2 IT/IR
 .Tn SAS
 controllers and WarpDrive solid state storage cards.
 .Sh HARDWARE
-The
+These controllers are supported by the
 .Nm
-driver supports the following hardware:
+driver:
 .Pp
 .Bl -bullet -compact
 .It
-LSI Logic SAS2004 (4 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2004 (4 Port SAS)
 .It
-LSI Logic SAS2008 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2008 (8 Port SAS)
 .It
-LSI Logic SAS2108 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2108 (8 Port SAS)
 .It
-LSI Logic SAS2116 (16 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2116 (16 Port SAS)
 .It
-LSI Logic SAS2208 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2208 (8 Port

svn commit: r302673 - in head: share/man/man4 sys/dev/mpr sys/dev/mps

2016-07-12 Thread Stephen McConnell
Author: slm
Date: Tue Jul 12 19:34:10 2016
New Revision: 302673
URL: https://svnweb.freebsd.org/changeset/base/302673

Log:
  Use real values to calculate Max I/O size instead of guessing.
  
  Reviewed by:  ken, scottl
  Approved by:  ken, scottl, ambrisko (mentors)
  MFC after:3 days
  Differential Revision:https://reviews.freebsd.org/D7043

Modified:
  head/share/man/man4/mpr.4
  head/share/man/man4/mps.4
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mprvar.h
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mpsvar.h

Modified: head/share/man/man4/mpr.4
==
--- head/share/man/man4/mpr.4   Tue Jul 12 19:27:05 2016(r302672)
+++ head/share/man/man4/mpr.4   Tue Jul 12 19:34:10 2016(r302673)
@@ -38,7 +38,7 @@
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2016
+.Dd July 6, 2016
 .Dt MPR 4
 .Os
 .Sh NAME
@@ -156,6 +156,29 @@ The current number of active I/O command
 dev.mpr.X.io_cmds_active
 .Xr sysctl 8
 variable.
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for all adapters,
+set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.max_io_pages=
+.Ed
+.Pp
+To set the maximum number of pages that will be used per I/O for a specific
+adapter, set this tunable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.max_io_pages=
+.Ed
+.Pp
+The default max_io_pages value is -1, meaning that the maximum I/O size that
+will be used per I/O will be calculated using the IOCFacts values stored in
+the controller.
+The lowest value that the driver will use for max_io_pages is 1, otherwise
+IOCFacts will be used to calculate the maximum I/O size.
+The smaller I/O size calculated from either max_io_pages or IOCFacts will be 
the
+maximum I/O size used by the driver.
 .Pp
 The highest number of active I/O commands seen since boot is stored in the
 dev.mpr.X.io_cmds_highwater
@@ -220,7 +243,7 @@ SATA disks that take several seconds to 
 command might not be discovered by the driver.
 This problem can sometimes be overcome by increasing the value of the spinup
 wait time in
-.Xr loader.conf 5 :
+.Xr loader.conf 5
 with the
 .Bd -literal -offset indent
 hw.mpr.spinup_wait_time=

Modified: head/share/man/man4/mps.4
==
--- head/share/man/man4/mps.4   Tue Jul 12 19:27:05 2016(r302672)
+++ head/share/man/man4/mps.4   Tue Jul 12 19:34:10 2016(r302673)
@@ -1,5 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
+.\" Copyright (c) 2014 LSI Corp
+.\" Copyright (c) 2016 Avago Technologies
+.\" Copyright (c) 2016 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -30,25 +33,27 @@
 .\" mps driver man page.
 .\"
 .\" Author: Ken Merry <k...@freebsd.org>
+.\" Author: Stephen McConnell <s...@freebsd.org>
 .\"
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd December 9, 2015
+.Dd July 5, 2016
 .Dt MPS 4
 .Os
 .Sh NAME
 .Nm mps
-.Nd LSI Fusion-MPT 2 Serial Attached SCSI driver
+.Nd "LSI Fusion-MPT 2 IT/IR 6Gb/s Serial Attached SCSI/SATA driver"
 .Sh SYNOPSIS
-To compile this driver into your kernel,
-place the following lines in your kernel configuration file:
+To compile this driver into the kernel, place these lines in the kernel
+configuration file:
 .Bd -ragged -offset indent
+.Cd "device pci"
 .Cd "device scbus"
 .Cd "device mps"
 .Ed
 .Pp
-Or, to load the driver as a module at boot, place the following line in
+The driver can be loaded as a module at boot time by placing this line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 mps_load="YES"
@@ -56,35 +61,30 @@ mps_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for LSI Logic Fusion-MPT 2
+driver provides support for Broadcom Ltd./Avago Tech (LSI)
+Fusion-MPT 2 IT/IR
 .Tn SAS
 controllers and WarpDrive solid state storage cards.
 .Sh HARDWARE
-The
+These controllers are supported by the
 .Nm
-driver supports the following hardware:
+driver:
 .Pp
 .Bl -bullet -compact
 .It
-LSI Logic SAS2004 (4 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2004 (4 Port SAS)
 .It
-LSI Logic SAS2008 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2008 (8 Port SAS)
 .It
-LSI Logic SAS2108 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2108 (8 Port SAS)
 .It
-LSI Logic SAS2116 (16 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2116 (16 Port SAS)
 .It
-LSI Logic SAS2208 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2208 (8 Port SAS)
 .It
-LSI Logic SAS2308 (8 Port
-.Tn SAS )
+Broadcom Ltd./Avago Tech (LSI) SAS 2308 (8 Port SAS)
 .It
-LSI Logic SSS6200 Solid State

svn commit: r302225 - stable/10/sys/dev/mps

2016-06-27 Thread Stephen McConnell
Author: slm
Date: Mon Jun 27 17:01:26 2016
New Revision: 302225
URL: https://svnweb.freebsd.org/changeset/base/302225

Log:
  MFC r302031
  
  - No log bit in IOCStatus and endian-safe changes.
  
  Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
  make a few more things endian-safe.
  
  - Fix possible use of invalid pointer.
  
  It was possible to use an invalid pointer to get the target ID value. To fix
  this, initialize a local Target ID variable to an invalid value and change 
that
  variable to a valid value only if the pointer to the Target ID is not NULL.
  
  - No need to set the MPSSAS_SHUTDOWN flag because it's never used.
  
  - done_ccb pointer can be used if it is NULL.
  
  To prevent this, move check for done_ccb == NULL to before done_ccb is used in
  mpssas_stop_unit_done().
  
  - Disks can go missing until a reboot is done in some cases.
  
  This is due to the DevHandle not being released, which causes the Firmware to
  not allow that disk to be re-added.
  
  Approved by:  ken, scottl, ambrisko (mentors)

Modified:
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_config.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mps_sas_lsi.c
  stable/10/sys/dev/mps/mps_user.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mps/mps.c
==
--- stable/10/sys/dev/mps/mps.c Mon Jun 27 16:14:54 2016(r302224)
+++ stable/10/sys/dev/mps/mps.c Mon Jun 27 17:01:26 2016(r302225)
@@ -1916,9 +1916,10 @@ mps_intr_locked(void *data)
 */
rel_rep =
(MPI2_DIAG_RELEASE_REPLY *)reply;
-   if (le16toh(rel_rep->IOCStatus) ==
+   if ((le16toh(rel_rep->IOCStatus) &
+   MPI2_IOCSTATUS_MASK) ==
MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED)
-   {
+   {
pBuffer =
>fw_diag_buffer_list[
rel_rep->BufferType];

Modified: stable/10/sys/dev/mps/mps_config.c
==
--- stable/10/sys/dev/mps/mps_config.c  Mon Jun 27 16:14:54 2016
(r302224)
+++ stable/10/sys/dev/mps/mps_config.c  Mon Jun 27 17:01:26 2016
(r302225)
@@ -499,7 +499,8 @@ mps_wd_config_pages(struct mps_softc *sc
 */
if (mps_config_get_raid_volume_pg0(sc, _reply,
raid_vol_pg0, (u32)raid_vol_pg0->DevHandle)) {
-   if (mpi_reply.IOCStatus !=
+   if ((le16toh(mpi_reply.IOCStatus) &
+   MPI2_IOCSTATUS_MASK) !=
MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) {
mps_dprint(sc, MPS_FAULT,
"Multiple RAID Volume Page0! Direct Drive "

Modified: stable/10/sys/dev/mps/mps_sas.c
==
--- stable/10/sys/dev/mps/mps_sas.c Mon Jun 27 16:14:54 2016
(r302224)
+++ stable/10/sys/dev/mps/mps_sas.c Mon Jun 27 17:01:26 2016
(r302225)
@@ -241,6 +241,8 @@ mpssas_alloc_tm(struct mps_softc *sc)
 void
 mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm)
 {
+   int target_id = 0x;
+ 
if (tm == NULL)
return;
 
@@ -251,10 +253,11 @@ mpssas_free_tm(struct mps_softc *sc, str
 */
if (tm->cm_targ != NULL) {
tm->cm_targ->flags &= ~MPSSAS_TARGET_INRESET;
+   target_id = tm->cm_targ->tid;
}
if (tm->cm_ccb) {
mps_dprint(sc, MPS_INFO, "Unfreezing devq for target ID %d\n",
-   tm->cm_targ->tid);
+   target_id);
xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE);
xpt_free_path(tm->cm_ccb->ccb_h.path);
xpt_free_ccb(tm->cm_ccb);
@@ -372,12 +375,11 @@ mpssas_remove_volume(struct mps_softc *s
return;
}
 
-   if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) {
-   mps_dprint(sc, MPS_FAULT,
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+   MPI2_IOCSTATUS_SUCCESS) {
+   mps_dprint(sc, MPS_ERROR,
   "IOCStatus = 0x%x while resetting device 0x%x\n",
-  reply->IOCStatus, handle);
-   mpssas_free_tm(sc, tm);
-   return;
+  le16toh(reply->IOCStatus), handle);
}
 
mps_dprint(sc, MPS_XINFO,
@@ 

svn commit: r302031 - head/sys/dev/mps

2016-06-20 Thread Stephen McConnell
Author: slm
Date: Mon Jun 20 18:14:51 2016
New Revision: 302031
URL: https://svnweb.freebsd.org/changeset/base/302031

Log:
  - No log bit in IOCStatus and endian-safe changes.
  
  Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
  make a few more things endian-safe.
  
  - Fix possible use of invalid pointer.
  
  It was possible to use an invalid pointer to get the target ID value. To fix
  this, initialize a local Target ID variable to an invalid value and change 
that
  variable to a valid value only if the pointer to the Target ID is not NULL.
  
  - No need to set the MPSSAS_SHUTDOWN flag because it's never used.
  
  - done_ccb pointer can be used if it is NULL.
  
  To prevent this, move check for done_ccb == NULL to before done_ccb is used in
  mpssas_stop_unit_done().
  
  - Disks can go missing until a reboot is done in some cases.
  
  This is due to the DevHandle not being released, which causes the Firmware to
  not allow that disk to be re-added.
  
  Reviewed by:  ken
  Approved by:  re (gjb), ken, scottl, ambrisko (mentors)
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D6872

Modified:
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_config.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas_lsi.c
  head/sys/dev/mps/mps_user.c
  head/sys/dev/mps/mpsvar.h

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Mon Jun 20 16:12:27 2016(r302030)
+++ head/sys/dev/mps/mps.c  Mon Jun 20 18:14:51 2016(r302031)
@@ -1922,9 +1922,10 @@ mps_intr_locked(void *data)
 */
rel_rep =
(MPI2_DIAG_RELEASE_REPLY *)reply;
-   if (le16toh(rel_rep->IOCStatus) ==
+   if ((le16toh(rel_rep->IOCStatus) &
+   MPI2_IOCSTATUS_MASK) ==
MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED)
-   {
+   {
pBuffer =
>fw_diag_buffer_list[
rel_rep->BufferType];

Modified: head/sys/dev/mps/mps_config.c
==
--- head/sys/dev/mps/mps_config.c   Mon Jun 20 16:12:27 2016
(r302030)
+++ head/sys/dev/mps/mps_config.c   Mon Jun 20 18:14:51 2016
(r302031)
@@ -499,7 +499,8 @@ mps_wd_config_pages(struct mps_softc *sc
 */
if (mps_config_get_raid_volume_pg0(sc, _reply,
raid_vol_pg0, (u32)raid_vol_pg0->DevHandle)) {
-   if (mpi_reply.IOCStatus !=
+   if ((le16toh(mpi_reply.IOCStatus) &
+   MPI2_IOCSTATUS_MASK) !=
MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) {
mps_dprint(sc, MPS_FAULT,
"Multiple RAID Volume Page0! Direct Drive "

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Mon Jun 20 16:12:27 2016(r302030)
+++ head/sys/dev/mps/mps_sas.c  Mon Jun 20 18:14:51 2016(r302031)
@@ -241,6 +241,8 @@ mpssas_alloc_tm(struct mps_softc *sc)
 void
 mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm)
 {
+   int target_id = 0x;
+ 
if (tm == NULL)
return;
 
@@ -251,10 +253,11 @@ mpssas_free_tm(struct mps_softc *sc, str
 */
if (tm->cm_targ != NULL) {
tm->cm_targ->flags &= ~MPSSAS_TARGET_INRESET;
+   target_id = tm->cm_targ->tid;
}
if (tm->cm_ccb) {
mps_dprint(sc, MPS_INFO, "Unfreezing devq for target ID %d\n",
-   tm->cm_targ->tid);
+   target_id);
xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE);
xpt_free_path(tm->cm_ccb->ccb_h.path);
xpt_free_ccb(tm->cm_ccb);
@@ -372,12 +375,11 @@ mpssas_remove_volume(struct mps_softc *s
return;
}
 
-   if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) {
-   mps_dprint(sc, MPS_FAULT,
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+   MPI2_IOCSTATUS_SUCCESS) {
+   mps_dprint(sc, MPS_ERROR,
   "IOCStatus = 0x%x while resetting device 0x%x\n",
-  reply->IOCStatus, handle);
-   mpssas_free_tm(sc, tm);
-   return;
+  le16toh(reply->IOCStatus), handle);
}
 
mps_dprint(sc, MPS_XINFO,
@@ -394,7 +396,8 @@ 

svn commit: r299967 - stable/10/share/man/man4

2016-05-16 Thread Stephen McConnell
Author: slm
Date: Mon May 16 19:32:38 2016
New Revision: 299967
URL: https://svnweb.freebsd.org/changeset/base/299967

Log:
  MFC r299276
  
  Updates to mpr driver man page.
  
  - Add 3216 and 3224 support.
  - Add SSU, chain_alloc_fail, and spinup_wait_time information.
  - Clear up some sentences.
  - Correct some typos.

Modified:
  stable/10/share/man/man4/mpr.4
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man4/mpr.4
==
--- stable/10/share/man/man4/mpr.4  Mon May 16 19:30:27 2016
(r299966)
+++ stable/10/share/man/man4/mpr.4  Mon May 16 19:32:38 2016
(r299967)
@@ -1,6 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
+.\" Copyright (c) 2016 Avago Technologies
+.\" Copyright (c) 2016 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -31,55 +33,62 @@
 .\" mpr driver man page.
 .\"
 .\" Author: Ken Merry <k...@freebsd.org>
-.\" Author: Stephen McConnell <stephen.mcconn...@lsi.com>
+.\" Author: Stephen McConnell <s...@freebsd.org>
 .\"
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd May 2, 2014
+.Dd April 29, 2016
 .Dt MPR 4
 .Os
 .Sh NAME
 .Nm mpr
 .Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver"
 .Sh SYNOPSIS
-To compile this driver into the kernel, place the following lines in your
-kernel configuration file:
+To compile this driver into the kernel, place these lines in the kernel
+configuration file:
 .Bd -ragged -offset indent
 .Cd "device pci"
 .Cd "device scbus"
 .Cd "device mpr"
 .Ed
 .Pp
-Alternatively, to load the driver as a
-module at boot time, place the following line in
+The driver can be loaded as a module at boot time by placing this line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 mpr_load="YES"
 .Ed
 .Sh DESCRIPTION
 The
-.Nm 
-driver provides support for LSI Fusion-MPT 3 IT/IR
+.Nm
+driver provides support for Broadcom Ltd./Avago Tech (LSI)
+Fusion-MPT 3 IT/IR
 .Tn SAS
 controllers.
 .Sh HARDWARE
-The following controllers are supported by the
+These controllers are supported by the
 .Nm
 driver:
 .Pp
 .Bl -bullet -compact
 .It
-LSI SAS 3004 (4 Port SAS)
+Broadcom Ltd./Avago Tech (LSI) SAS 3004 (4 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3008 (8 Port SAS)
 .It
-LSI SAS 3008 (8 Port SAS)
+Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS)
 .It
-LSI SAS 3108 (8 Port SAS)
+Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS)
 .El
 .Sh CONFIGURATION
+.Pp
+In all tunable descriptions below, X represents the adapter number.
+.Pp
 To disable MSI interrupts for all
 .Nm
-driver instances, set the following tunable value in
+driver instances, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 hw.mpr.disable_msi=1
@@ -87,17 +96,15 @@ hw.mpr.disable_msi=1
 .Pp
 To disable MSI interrupts for a specific
 .Nm
-driver instance, set the following tunable value in
+driver instance, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.disable_msi=1
 .Ed
 .Pp
-where X is the adapter number.
-.Pp
 To disable MSI-X interrupts for all
 .Nm
-driver instances, set the following tunable value in
+driver instances, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 hw.mpr.disable_msix=1
@@ -105,73 +112,134 @@ hw.mpr.disable_msix=1
 .Pp
 To disable MSI-X interrupts for a specific
 .Nm
-driver instance, set the following tunable value in
+driver instance, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.disable_msix=1
 .Ed
 .Pp
 To set the maximum number of DMA chains allocated for all adapters, set
-the following variable in
+this tunable in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 hw.mpr.max_chains=
 .Ed
 .Pp
 To set the maximum number of DMA chains allocated for a specific adapter,
-set the following variable in
+set this tunable in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.max_chains=
 .Ed
 .Pp
-This variable may also be viewed via
-.Xr sysctl 8
-to see the maximum set for a given adapter.
+The default max_chains value is 2048.
 .Pp
-The current number of free chain frames may be seen via the
+The current number of free chain frames is stored in the
 dev.mpr.X.chain_free
 .Xr sysctl 8
 variable.
 .Pp
-The lowest number of free chain frames may be seen via the
+The lowest number of free chain frames seen since boot is stored in the
 dev.mpr.X.chain_free_lowwater
 .Xr sysctl 8
 variable.
 .Pp
+The number of times that chain frame allocations have failed since boot is
+stored in the
+dev.mpr.X.chain_alloc_fail
+.Xr sysctl 8
+variable.
+This c

svn commit: r299962 - in stable/10/sys/dev/mpr: . mpi

2016-05-16 Thread Stephen McConnell
Author: slm
Date: Mon May 16 18:47:53 2016
New Revision: 299962
URL: https://svnweb.freebsd.org/changeset/base/299962

Log:
  MFC r299263, r299265, r299266, r299267, r299268, r299269, r299270, r299271,
  r299272, r299274, r299275
  
  - (r299263) Update MPI headers to version 42.
  - (r299265) Several style changes and add copyrights for 2016.
  - (r299266) Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port 
HBA's.
  - (r299267) No log bit in IOCStatus and endian-safe changes.
  
  Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
  make a few more things endian-safe.
  
  - (r299268) Change logging level for a debug string to use MPR_LOG instead of
  MPR_INFO.
  
  - (r299269) Fix possible use of invalid pointer.
  
  It was possible to use an invalid pointer to get the target ID value. To fix
  this, initialize a local Target ID variable to an invalid value and change 
that
  variable to a valid value only if the pointer to the Target ID is not NULL.
  
  - (r299270) No need to set the MPRSAS_SHUTDOWN flag because it's never used.
  - (r299271) Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver
  is >= 129
  
  - (r299272) done_ccb pointer can be used if it is NULL.
  
  To prevent this, move check for done_ccb == NULL to before done_ccb is used in
  mprsas_stop_unit_done().
  
  - (r299274) Disks can go missing until a reboot is done in some cases.
  
  This is due to the DevHandle not being released, which causes the Firmware to
  not allow that disk to be re-added.
  
  - (r299275) Bump version of mpr driver to 13.00.00.00-fbsd

Modified:
  stable/10/sys/dev/mpr/mpi/mpi2.h
  stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h
  stable/10/sys/dev/mpr/mpi/mpi2_hbd.h
  stable/10/sys/dev/mpr/mpi/mpi2_history.txt
  stable/10/sys/dev/mpr/mpi/mpi2_init.h
  stable/10/sys/dev/mpr/mpi/mpi2_ioc.h
  stable/10/sys/dev/mpr/mpi/mpi2_ra.h
  stable/10/sys/dev/mpr/mpi/mpi2_raid.h
  stable/10/sys/dev/mpr/mpi/mpi2_sas.h
  stable/10/sys/dev/mpr/mpi/mpi2_targ.h
  stable/10/sys/dev/mpr/mpi/mpi2_tool.h
  stable/10/sys/dev/mpr/mpi/mpi2_type.h
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_config.c
  stable/10/sys/dev/mpr/mpr_ioctl.h
  stable/10/sys/dev/mpr/mpr_mapping.c
  stable/10/sys/dev/mpr/mpr_mapping.h
  stable/10/sys/dev/mpr/mpr_pci.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mpr_sas.h
  stable/10/sys/dev/mpr/mpr_sas_lsi.c
  stable/10/sys/dev/mpr/mpr_table.c
  stable/10/sys/dev/mpr/mpr_user.c
  stable/10/sys/dev/mpr/mprvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mpr/mpi/mpi2.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2.hMon May 16 18:11:53 2016
(r299961)
+++ stable/10/sys/dev/mpr/mpi/mpi2.hMon May 16 18:47:53 2016
(r299962)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013-2016 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,8 @@
 
 /*
  *  Copyright (c) 2000-2015 LSI Corporation.
- *  Copyright (c) 2013-2015 Avago Technologies
+ *  Copyright (c) 2013-2016 Avago Technologies
+ *  All rights reserved.
  *
  *
  *   Name:  mpi2.h
@@ -43,7 +44,7 @@
  *  scatter/gather formats.
  *  Creation Date:  June 21, 2006
  *
- *  mpi2.h Version:  02.00.33
+ *  mpi2.h Version:  02.00.42
  *
  *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *prefix are for use only on MPI v2.5 products, and must not be used
@@ -125,6 +126,22 @@
  *  04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
  *  08-19-13  02.00.32  Bumped MPI2_HEADER_VERSION_UNIT.
  *  12-05-13  02.00.33  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  01-08-14  02.00.34  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  06-13-14  02.00.35  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  11-18-14  02.00.36  Updated copyright information.
+ *  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  03-16-15  02.00.37  Updated for MPI v2.6.
+ *  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  Added Scratchpad registers to
+ *  MPI2_SYSTEM_INTERFACE_REGS.
+ *  Added MPI2_DIAG_SBR_RELOAD.
+ *  Added MPI2_IOCSTATUS_INSUFFICIENT_POWER.
+ *  03-19-15  02.00.38  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  05-25-15  02.00.39  Bumped MPI2_HEADER_VERSION_UNIT
+ *  08-25-15  02.00.40  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  Added V7 HostDiagnostic register defines
+ *  12-15-15  02.00.41  Bumped MPI_HEADER_VERSION_UNIT
+ *  01-01-16  02.00.42  Bumped MPI_HEADER_VERSION_UNIT
  *  --
  */
 
@@ -160,8 +177,15 @@
 #define MPI2_VERSION_02_05  (0x0205)
 
 
+/* minor version for MPI v2.6 compatible products */

svn commit: r299276 - head/share/man/man4

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:42:46 2016
New Revision: 299276
URL: https://svnweb.freebsd.org/changeset/base/299276

Log:
  Updates to mpr driver man page.
  
  - Add 3216 and 3224 support.
  - Add SSU, chain_alloc_fail, and spinup_wait_time information.
  - Clear up some sentences.
  - Correct some typos.
  
  Reviewed by:ken, scottl, ambrisko, asomers, wblock
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6104

Modified:
  head/share/man/man4/mpr.4

Modified: head/share/man/man4/mpr.4
==
--- head/share/man/man4/mpr.4   Mon May  9 16:38:51 2016(r299275)
+++ head/share/man/man4/mpr.4   Mon May  9 16:42:46 2016(r299276)
@@ -1,6 +1,8 @@
 .\"
 .\" Copyright (c) 2010 Spectra Logic Corporation
 .\" Copyright (c) 2014 LSI Corp
+.\" Copyright (c) 2016 Avago Technologies
+.\" Copyright (c) 2016 Broadcom Ltd.
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -31,28 +33,27 @@
 .\" mpr driver man page.
 .\"
 .\" Author: Ken Merry <k...@freebsd.org>
-.\" Author: Stephen McConnell <stephen.mcconn...@lsi.com>
+.\" Author: Stephen McConnell <s...@freebsd.org>
 .\"
 .\" $Id$
 .\" $FreeBSD$
 .\"
-.Dd May 2, 2014
+.Dd April 29, 2016
 .Dt MPR 4
 .Os
 .Sh NAME
 .Nm mpr
 .Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver"
 .Sh SYNOPSIS
-To compile this driver into the kernel, place the following lines in your
-kernel configuration file:
+To compile this driver into the kernel, place these lines in the kernel
+configuration file:
 .Bd -ragged -offset indent
 .Cd "device pci"
 .Cd "device scbus"
 .Cd "device mpr"
 .Ed
 .Pp
-Alternatively, to load the driver as a
-module at boot time, place the following line in
+The driver can be loaded as a module at boot time by placing this line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 mpr_load="YES"
@@ -60,26 +61,34 @@ mpr_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for LSI Fusion-MPT 3 IT/IR
+driver provides support for Broadcom Ltd./Avago Tech (LSI)
+Fusion-MPT 3 IT/IR
 .Tn SAS
 controllers.
 .Sh HARDWARE
-The following controllers are supported by the
+These controllers are supported by the
 .Nm
 driver:
 .Pp
 .Bl -bullet -compact
 .It
-LSI SAS 3004 (4 Port SAS)
+Broadcom Ltd./Avago Tech (LSI) SAS 3004 (4 Port SAS)
 .It
-LSI SAS 3008 (8 Port SAS)
+Broadcom Ltd./Avago Tech (LSI) SAS 3008 (8 Port SAS)
 .It
-LSI SAS 3108 (8 Port SAS)
+Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS)
+.It
+Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS)
 .El
 .Sh CONFIGURATION
+.Pp
+In all tunable descriptions below, X represents the adapter number.
+.Pp
 To disable MSI interrupts for all
 .Nm
-driver instances, set the following tunable value in
+driver instances, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 hw.mpr.disable_msi=1
@@ -87,17 +96,15 @@ hw.mpr.disable_msi=1
 .Pp
 To disable MSI interrupts for a specific
 .Nm
-driver instance, set the following tunable value in
+driver instance, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.disable_msi=1
 .Ed
 .Pp
-where X is the adapter number.
-.Pp
 To disable MSI-X interrupts for all
 .Nm
-driver instances, set the following tunable value in
+driver instances, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 hw.mpr.disable_msix=1
@@ -105,73 +112,134 @@ hw.mpr.disable_msix=1
 .Pp
 To disable MSI-X interrupts for a specific
 .Nm
-driver instance, set the following tunable value in
+driver instance, set this tunable value in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.disable_msix=1
 .Ed
 .Pp
 To set the maximum number of DMA chains allocated for all adapters, set
-the following variable in
+this tunable in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 hw.mpr.max_chains=
 .Ed
 .Pp
 To set the maximum number of DMA chains allocated for a specific adapter,
-set the following variable in
+set this tunable in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 dev.mpr.X.max_chains=
 .Ed
 .Pp
-This variable may also be viewed via
-.Xr sysctl 8
-to see the maximum set for a given adapter.
+The default max_chains value is 2048.
 .Pp
-The current number of free chain frames may be seen via the
+The current number of free chain frames is stored in the
 dev.mpr.X.chain_free
 .Xr sysctl 8
 variable.
 .Pp
-The lowest number of free chain frames may be seen via the
+The lowest number of free chain frames seen since boot is stored in the
 dev.mpr.X.chain_free_lowwater
 .Xr sysctl 8
 variable.
 .Pp
+The number of times that chain frame allocations

svn commit: r299275 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:38:51 2016
New Revision: 299275
URL: https://svnweb.freebsd.org/changeset/base/299275

Log:
  Bump version of mpr driver to 13.00.00.00-fbsd
  
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week

Modified:
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mprvar.h
==
--- head/sys/dev/mpr/mprvar.h   Mon May  9 16:36:40 2016(r299274)
+++ head/sys/dev/mpr/mprvar.h   Mon May  9 16:38:51 2016(r299275)
@@ -33,7 +33,7 @@
 #ifndef _MPRVAR_H
 #define _MPRVAR_H
 
-#define MPR_DRIVER_VERSION "09.255.01.00-fbsd"
+#define MPR_DRIVER_VERSION "13.00.00.00-fbsd"
 
 #define MPR_DB_MAX_WAIT2500
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299274 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:36:40 2016
New Revision: 299274
URL: https://svnweb.freebsd.org/changeset/base/299274

Log:
  Disks can go missing until a reboot is done in some cases.
  
  This is due to the DevHandle not being released, which causes the Firmware to
  not allow that disk to be re-added.
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6102

Modified:
  head/sys/dev/mpr/mpr_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:35:05 2016(r299273)
+++ head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:36:40 2016(r299274)
@@ -377,10 +377,8 @@ mprsas_remove_volume(struct mpr_softc *s
 
if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
MPI2_IOCSTATUS_SUCCESS) {
-   mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting "
+   mpr_dprint(sc, MPR_ERROR, "IOCStatus = 0x%x while resetting "
"device 0x%x\n", le16toh(reply->IOCStatus), handle);
-   mprsas_free_tm(sc, tm);
-   return;
}
 
mpr_dprint(sc, MPR_XINFO, "Reset aborted %u commands\n",
@@ -566,8 +564,6 @@ mprsas_remove_device(struct mpr_softc *s
mpr_dprint(sc, MPR_ERROR, "%s: cm_flags = %#x for remove of "
"handle %#04x! This should not happen!\n", __func__,
tm->cm_flags, handle);
-   mprsas_free_tm(sc, tm);
-   return;
}
 
if (reply == NULL) {
@@ -580,10 +576,8 @@ mprsas_remove_device(struct mpr_softc *s
 
if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
MPI2_IOCSTATUS_SUCCESS) {
-   mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting "
+   mpr_dprint(sc, MPR_ERROR, "IOCStatus = 0x%x while resetting "
"device 0x%x\n", le16toh(reply->IOCStatus), handle);
-   mprsas_free_tm(sc, tm);
-   return;
}
 
mpr_dprint(sc, MPR_XINFO, "Reset aborted %u commands\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299272 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:34:06 2016
New Revision: 299272
URL: https://svnweb.freebsd.org/changeset/base/299272

Log:
  done_ccb pointer can be used if it is NULL.
  
  To prevent this, move check for done_ccb == NULL to before done_ccb is used in
  mprsas_stop_unit_done().
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6099

Modified:
  head/sys/dev/mpr/mpr_sas_lsi.c

Modified: head/sys/dev/mpr/mpr_sas_lsi.c
==
--- head/sys/dev/mpr/mpr_sas_lsi.c  Mon May  9 16:31:43 2016
(r299271)
+++ head/sys/dev/mpr/mpr_sas_lsi.c  Mon May  9 16:34:06 2016
(r299272)
@@ -1272,15 +1272,15 @@ mprsas_stop_unit_done(struct cam_periph 
struct mprsas_softc *sassc;
char path_str[64];
 
+   if (done_ccb == NULL)
+   return;
+
sassc = (struct mprsas_softc *)done_ccb->ccb_h.ppriv_ptr1;
 
xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str));
mpr_dprint(sassc->sc, MPR_INFO, "Completing stop unit for %s\n",
path_str);
 
-   if (done_ccb == NULL)
-   return;
-
/*
 * Nothing more to do except free the CCB and path.  If the command
 * timed out, an abort reset, then target reset will be issued during
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299271 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:31:43 2016
New Revision: 299271
URL: https://svnweb.freebsd.org/changeset/base/299271

Log:
  Use callout_reset_sbt() instead of callout_reset() if FreeBSD ver is >= 
129
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6101

Modified:
  head/sys/dev/mpr/mpr_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:29:25 2016(r299270)
+++ head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:31:43 2016(r299271)
@@ -1929,8 +1929,13 @@ mprsas_action_scsiio(struct mprsas_softc
cm->cm_desc.SCSIIO.DevHandle = htole16(targ->handle);
}
 
+#if __FreeBSD_version >= 129
callout_reset_sbt(>cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0,
mprsas_scsiio_timeout, cm, 0);
+#else //__FreeBSD_version < 129
+   callout_reset(>cm_callout, (ccb->ccb_h.timeout * hz) / 1000,
+   mprsas_scsiio_timeout, cm);
+#endif //__FreeBSD_version >= 129
 
targ->issued++;
targ->outstanding++;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299270 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:29:25 2016
New Revision: 299270
URL: https://svnweb.freebsd.org/changeset/base/299270

Log:
  No need to set the MPRSAS_SHUTDOWN flag because it's never used.
  
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week

Modified:
  head/sys/dev/mpr/mpr_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:26:34 2016(r299269)
+++ head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:29:25 2016(r299270)
@@ -931,7 +931,6 @@ mpr_detach_sas(struct mpr_softc *sc)
cam_sim_free(sassc->sim, FALSE);
}
 
-   sassc->flags |= MPRSAS_SHUTDOWN;
mpr_unlock(sc);
 
if (sassc->devq != NULL)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299269 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:26:34 2016
New Revision: 299269
URL: https://svnweb.freebsd.org/changeset/base/299269

Log:
  Fix possible use of invalid pointer.
  
  It was possible to use an invalid pointer to get the target ID value. To fix
  this, initialize a local Target ID variable to an invalid value and change 
that
  variable to a valid value only if the pointer to the Target ID is not NULL.
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6100

Modified:
  head/sys/dev/mpr/mpr_sas.c

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:24:16 2016(r299268)
+++ head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:26:34 2016(r299269)
@@ -243,6 +243,8 @@ mprsas_alloc_tm(struct mpr_softc *sc)
 void
 mprsas_free_tm(struct mpr_softc *sc, struct mpr_command *tm)
 {
+   int target_id = 0x;
+
MPR_FUNCTRACE(sc);
if (tm == NULL)
return;
@@ -254,10 +256,11 @@ mprsas_free_tm(struct mpr_softc *sc, str
 */
if (tm->cm_targ != NULL) {
tm->cm_targ->flags &= ~MPRSAS_TARGET_INRESET;
+   target_id = tm->cm_targ->tid;
}
if (tm->cm_ccb) {
mpr_dprint(sc, MPR_INFO, "Unfreezing devq for target ID %d\n",
-   tm->cm_targ->tid);
+   target_id);
xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE);
xpt_free_path(tm->cm_ccb->ccb_h.path);
xpt_free_ccb(tm->cm_ccb);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299268 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:24:16 2016
New Revision: 299268
URL: https://svnweb.freebsd.org/changeset/base/299268

Log:
  Change logging level for a debug string to use MPR_LOG instead of MPR_INFO.
  
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week

Modified:
  head/sys/dev/mpr/mpr.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Mon May  9 16:21:14 2016(r299267)
+++ head/sys/dev/mpr/mpr.c  Mon May  9 16:24:16 2016(r299268)
@@ -1791,7 +1791,7 @@ mpr_sas_log_info(struct mpr_softc *sc , 
break;
}
  
-   mpr_dprint(sc, MPR_INFO, "log_info(0x%08x): originator(%s), "
+   mpr_dprint(sc, MPR_LOG, "log_info(0x%08x): originator(%s), "
"code(0x%02x), sub_code(0x%04x)\n", log_info, originator_str,
sas_loginfo.dw.code, sas_loginfo.dw.subcode);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r299267 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:21:14 2016
New Revision: 299267
URL: https://svnweb.freebsd.org/changeset/base/299267

Log:
  No log bit in IOCStatus and endian-safe changes.
  
  Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and
  make a few more things endian-safe.
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6097

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_user.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Mon May  9 16:19:13 2016(r299266)
+++ head/sys/dev/mpr/mpr.c  Mon May  9 16:21:14 2016(r299267)
@@ -1942,9 +1942,10 @@ mpr_intr_locked(void *data)
 */
rel_rep =
(MPI2_DIAG_RELEASE_REPLY *)reply;
-   if (le16toh(rel_rep->IOCStatus) ==
+   if ((le16toh(rel_rep->IOCStatus) &
+   MPI2_IOCSTATUS_MASK) ==
MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED)
-   {
+   {
pBuffer =
>fw_diag_buffer_list[
rel_rep->BufferType];

Modified: head/sys/dev/mpr/mpr_sas.c
==
--- head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:19:13 2016(r299266)
+++ head/sys/dev/mpr/mpr_sas.c  Mon May  9 16:21:14 2016(r299267)
@@ -372,15 +372,16 @@ mprsas_remove_volume(struct mpr_softc *s
return;
}
 
-   if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) {
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+   MPI2_IOCSTATUS_SUCCESS) {
mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting "
-   "device 0x%x\n", reply->IOCStatus, handle);
+   "device 0x%x\n", le16toh(reply->IOCStatus), handle);
mprsas_free_tm(sc, tm);
return;
}
 
mpr_dprint(sc, MPR_XINFO, "Reset aborted %u commands\n",
-   reply->TerminationCount);
+   le32toh(reply->TerminationCount));
mpr_free_reply(sc, tm->cm_reply_data);
tm->cm_reply = NULL;/* Ensures the reply won't get re-freed */
 
@@ -393,7 +394,8 @@ mprsas_remove_volume(struct mpr_softc *s
 * this target id if possible, and so we can assign the same target id
 * to this device if it comes back in the future.
 */
-   if (reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) {
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) ==
+   MPI2_IOCSTATUS_SUCCESS) {
targ = tm->cm_targ;
targ->handle = 0x0;
targ->encl_handle = 0x0;
@@ -573,7 +575,8 @@ mprsas_remove_device(struct mpr_softc *s
return;
}
 
-   if (le16toh(reply->IOCStatus) != MPI2_IOCSTATUS_SUCCESS) {
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+   MPI2_IOCSTATUS_SUCCESS) {
mpr_dprint(sc, MPR_FAULT, "IOCStatus = 0x%x while resetting "
"device 0x%x\n", le16toh(reply->IOCStatus), handle);
mprsas_free_tm(sc, tm);
@@ -658,7 +661,8 @@ mprsas_remove_complete(struct mpr_softc 
 * this target id if possible, and so we can assign the same target id
 * to this device if it comes back in the future.
 */
-   if (le16toh(reply->IOCStatus) == MPI2_IOCSTATUS_SUCCESS) {
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) ==
+   MPI2_IOCSTATUS_SUCCESS) {
targ = tm->cm_targ;
targ->handle = 0x0;
targ->encl_handle = 0x0;

Modified: head/sys/dev/mpr/mpr_user.c
==
--- head/sys/dev/mpr/mpr_user.c Mon May  9 16:19:13 2016(r299266)
+++ head/sys/dev/mpr/mpr_user.c Mon May  9 16:21:14 2016(r299267)
@@ -1255,12 +1255,14 @@ mpr_post_fw_diag_buffer(struct mpr_softc
 * Process POST reply.
 */
reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply;
-   if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) {
+   if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) !=
+   MPI2_IOCSTATUS_SUCCESS) {
status = MPR_DIAG_FAILURE;
mpr_dprint(sc, MPR_FAULT, "%s: post of FW  Diag Buffer failed "
"with IOCStatus = 0x%x, IOCLogInfo = 0x%x and "
-   "TransferLength = 0x%x\n", 

svn commit: r299266 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:19:13 2016
New Revision: 299266
URL: https://svnweb.freebsd.org/changeset/base/299266

Log:
  Add support for the Broadcom (Avago/LSI) 9305 16 and 24 port HBA's.
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Relnotes:   yes
  Differential Revision: https://reviews.freebsd.org/D6098

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Mon May  9 16:16:00 2016(r299265)
+++ head/sys/dev/mpr/mpr.c  Mon May  9 16:19:13 2016(r299266)
@@ -441,6 +441,8 @@ mpr_iocfacts_allocate(struct mpr_softc *
(saved_facts.IOCCapabilities != sc->facts->IOCCapabilities) ||
(saved_facts.IOCRequestFrameSize !=
sc->facts->IOCRequestFrameSize) ||
+   (saved_facts.IOCMaxChainSegmentSize !=
+   sc->facts->IOCMaxChainSegmentSize) ||
(saved_facts.MaxTargets != sc->facts->MaxTargets) ||
(saved_facts.MaxSasExpanders != sc->facts->MaxSasExpanders) ||
(saved_facts.MaxEnclosures != sc->facts->MaxEnclosures) ||
@@ -1188,7 +1190,28 @@ mpr_alloc_requests(struct mpr_softc *sc)
 bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize,
mpr_memaddr_cb, >req_busaddr, 0);
 
-   rsize = sc->facts->IOCRequestFrameSize * sc->max_chains * 4;
+   /*
+* Gen3 and beyond uses the IOCMaxChainSegmentSize from IOC Facts to
+* get the size of a Chain Frame.  Previous versions use the size as a
+* Request Frame for the Chain Frame size.  If IOCMaxChainSegmentSize
+* is 0, use the default value.  The IOCMaxChainSegmentSize is the
+* number of 16-byte elelements that can fit in a Chain Frame, which is
+* the size of an IEEE Simple SGE.
+*/
+   if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) {
+   sc->chain_seg_size =
+   htole16(sc->facts->IOCMaxChainSegmentSize);
+   if (sc->chain_seg_size == 0) {
+   sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE *
+   MPR_MAX_CHAIN_ELEMENT_SIZE;
+   } else {
+   sc->chain_frame_size = sc->chain_seg_size *
+   MPR_MAX_CHAIN_ELEMENT_SIZE;
+   }
+   } else {
+   sc->chain_frame_size = sc->facts->IOCRequestFrameSize * 4;
+   }
+   rsize = sc->chain_frame_size * sc->max_chains;
 if (bus_dma_tag_create( sc->mpr_parent_dmat,/* parent */
16, 0,  /* algnmnt, boundary */
BUS_SPACE_MAXADDR,  /* lowaddr */
@@ -1246,9 +1269,9 @@ mpr_alloc_requests(struct mpr_softc *sc)
for (i = 0; i < sc->max_chains; i++) {
chain = >chains[i];
chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames +
-   i * sc->facts->IOCRequestFrameSize * 4);
+   i * sc->chain_frame_size);
chain->chain_busaddr = sc->chain_busaddr +
-   i * sc->facts->IOCRequestFrameSize * 4;
+   i * sc->chain_frame_size;
mpr_free_chain(sc, chain);
sc->chain_free_lowwater++;
}
@@ -2169,7 +2192,7 @@ mpr_add_chain(struct mpr_command *cm, in
MPI2_REQUEST_HEADER *req;
MPI25_IEEE_SGE_CHAIN64 *ieee_sgc;
struct mpr_chain *chain;
-   int space, sgc_size, current_segs, rem_segs, segs_per_frame;
+   int sgc_size, current_segs, rem_segs, segs_per_frame;
uint8_t next_chain_offset = 0;
 
/*
@@ -2191,8 +2214,6 @@ mpr_add_chain(struct mpr_command *cm, in
if (chain == NULL)
return (ENOBUFS);
 
-   space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4;
-
/*
 * Note: a double-linked list is used to make it easier to walk for
 * debugging.
@@ -2218,13 +2239,14 @@ mpr_add_chain(struct mpr_command *cm, in
 */
current_segs = (cm->cm_sglsize / sgc_size) - 1;
rem_segs = segsleft - current_segs;
-   segs_per_frame = space / sgc_size;
+   segs_per_frame = sc->chain_frame_size / sgc_size;
if (rem_segs > segs_per_frame) {
next_chain_offset = segs_per_frame - 1;
}
}
ieee_sgc = &((MPI25_SGE_IO_UNION *)cm->cm_sge)->IeeeChain;
-   ieee_sgc->Length = next_chain_offset ? htole32((uint32_t)space) :
+   ieee_sgc->Length = next_chain_offset ?
+   htole32((uint32_t)sc->chain_frame_size) :
htole32((uint32_t)rem_segs * (uint32_t)sgc_size);
ieee_sgc->NextChainOffset = 

svn commit: r299263 - head/sys/dev/mpr/mpi

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:12:32 2016
New Revision: 299263
URL: https://svnweb.freebsd.org/changeset/base/299263

Log:
  Update MPI headers to version 42.
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6096

Modified:
  head/sys/dev/mpr/mpi/mpi2.h
  head/sys/dev/mpr/mpi/mpi2_cnfg.h
  head/sys/dev/mpr/mpi/mpi2_hbd.h
  head/sys/dev/mpr/mpi/mpi2_history.txt
  head/sys/dev/mpr/mpi/mpi2_init.h
  head/sys/dev/mpr/mpi/mpi2_ioc.h
  head/sys/dev/mpr/mpi/mpi2_ra.h
  head/sys/dev/mpr/mpi/mpi2_raid.h
  head/sys/dev/mpr/mpi/mpi2_sas.h
  head/sys/dev/mpr/mpi/mpi2_targ.h
  head/sys/dev/mpr/mpi/mpi2_tool.h
  head/sys/dev/mpr/mpi/mpi2_type.h

Modified: head/sys/dev/mpr/mpi/mpi2.h
==
--- head/sys/dev/mpr/mpi/mpi2.h Mon May  9 14:10:29 2016(r299262)
+++ head/sys/dev/mpr/mpi/mpi2.h Mon May  9 16:12:32 2016(r299263)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013-2016 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,8 @@
 
 /*
  *  Copyright (c) 2000-2015 LSI Corporation.
- *  Copyright (c) 2013-2015 Avago Technologies
+ *  Copyright (c) 2013-2016 Avago Technologies
+ *  All rights reserved.
  *
  *
  *   Name:  mpi2.h
@@ -43,7 +44,7 @@
  *  scatter/gather formats.
  *  Creation Date:  June 21, 2006
  *
- *  mpi2.h Version:  02.00.33
+ *  mpi2.h Version:  02.00.42
  *
  *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
  *prefix are for use only on MPI v2.5 products, and must not be used
@@ -125,6 +126,22 @@
  *  04-17-13  02.00.31  Bumped MPI2_HEADER_VERSION_UNIT.
  *  08-19-13  02.00.32  Bumped MPI2_HEADER_VERSION_UNIT.
  *  12-05-13  02.00.33  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  01-08-14  02.00.34  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  06-13-14  02.00.35  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  11-18-14  02.00.36  Updated copyright information.
+ *  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  03-16-15  02.00.37  Updated for MPI v2.6.
+ *  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  Added Scratchpad registers to
+ *  MPI2_SYSTEM_INTERFACE_REGS.
+ *  Added MPI2_DIAG_SBR_RELOAD.
+ *  Added MPI2_IOCSTATUS_INSUFFICIENT_POWER.
+ *  03-19-15  02.00.38  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  05-25-15  02.00.39  Bumped MPI2_HEADER_VERSION_UNIT
+ *  08-25-15  02.00.40  Bumped MPI2_HEADER_VERSION_UNIT.
+ *  Added V7 HostDiagnostic register defines
+ *  12-15-15  02.00.41  Bumped MPI_HEADER_VERSION_UNIT
+ *  01-01-16  02.00.42  Bumped MPI_HEADER_VERSION_UNIT
  *  --
  */
 
@@ -160,8 +177,15 @@
 #define MPI2_VERSION_02_05  (0x0205)
 
 
+/* minor version for MPI v2.6 compatible products */
+#define MPI26_VERSION_MINOR (0x06)
+#define MPI26_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) |   \
+  MPI26_VERSION_MINOR)
+#define MPI2_VERSION_02_06  (0x0206)
+
+
 /* Unit and Dev versioning for this MPI header set */
-#define MPI2_HEADER_VERSION_UNIT(0x21)
+#define MPI2_HEADER_VERSION_UNIT(0x2A)
 #define MPI2_HEADER_VERSION_DEV (0x00)
 #define MPI2_HEADER_VERSION_UNIT_MASK   (0xFF00)
 #define MPI2_HEADER_VERSION_UNIT_SHIFT  (8)
@@ -217,7 +241,8 @@ typedef volatile struct _MPI2_SYSTEM_INT
 U32 HCBSize;/* 0x74 */
 U32 HCBAddressLow;  /* 0x78 */
 U32 HCBAddressHigh; /* 0x7C */
-U32 Reserved6[16];  /* 0x80 */
+U32 Reserved6[12];  /* 0x80 */
+U32 Scratchpad[4];  /* 0xB0 */
 U32 RequestDescriptorPostLow;   /* 0xC0 */
 U32 RequestDescriptorPostHigh;  /* 0xC4 */
 U32 Reserved7[14];  /* 0xC8 */
@@ -261,10 +286,17 @@ typedef volatile struct _MPI2_SYSTEM_INT
  */
 #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x0008)
 
+#define MPI2_DIAG_SBR_RELOAD(0x2000)
+
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK   (0x1800)
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT(0x)
 #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW   (0x0800)
 
+/* Defines for V7A/V7R HostDiagnostic Register */
+#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH64(0x)
+#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW64 (0x0800)
+#define MPI26_DIAG_BOOT_DEVICE_SELECT_FLASH32(0x1000)
+#define MPI26_DIAG_BOOT_DEVICE_SELECT_HCDW32 (0x1800)
 #define 

svn commit: r299265 - head/sys/dev/mpr

2016-05-09 Thread Stephen McConnell
Author: slm
Date: Mon May  9 16:16:00 2016
New Revision: 299265
URL: https://svnweb.freebsd.org/changeset/base/299265

Log:
  Several style changes and add copyrights for 2016.
  
  Reviewed by:ken, scottl, ambrisko, asomers
  Approved by:  ken, scottl, ambrisko
  MFC after:  1 week
  Differential Revision: https://reviews.freebsd.org/D6103

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_ioctl.h
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_mapping.h
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_table.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Mon May  9 16:15:52 2016(r299264)
+++ head/sys/dev/mpr/mpr.c  Mon May  9 16:16:00 2016(r299265)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2009 Yahoo! Inc.
  * Copyright (c) 2011-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013-2016 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -92,14 +92,11 @@ static __inline void mpr_complete_comman
 struct mpr_command *cm);
 static void mpr_dispatch_event(struct mpr_softc *sc, uintptr_t data,
 MPI2_EVENT_NOTIFICATION_REPLY *reply);
-static void mpr_config_complete(struct mpr_softc *sc,
-struct mpr_command *cm);
+static void mpr_config_complete(struct mpr_softc *sc, struct mpr_command *cm);
 static void mpr_periodic(void *);
 static int mpr_reregister_events(struct mpr_softc *sc);
-static void mpr_enqueue_request(struct mpr_softc *sc,
-struct mpr_command *cm);
-static int mpr_get_iocfacts(struct mpr_softc *sc,
-MPI2_IOC_FACTS_REPLY *facts);
+static void mpr_enqueue_request(struct mpr_softc *sc, struct mpr_command *cm);
+static int mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts);
 static int mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int sleep_flag);
 SYSCTL_NODE(_hw, OID_AUTO, mpr, CTLFLAG_RD, 0, "MPR Driver Parameters");
 
@@ -550,8 +547,8 @@ mpr_iocfacts_allocate(struct mpr_softc *
error = mpr_transition_operational(sc);
if (error != 0) {
if (attaching) {
-   mpr_printf(sc, "%s failed to transition to "
-   "operational with error %d\n", __func__, error);
+   mpr_printf(sc, "%s failed to transition to operational "
+   "with error %d\n", __func__, error);
mpr_free(sc);
return (error);
} else {
@@ -685,7 +682,7 @@ mpr_reinit(struct mpr_softc *sc)
 
if (sc->mpr_flags & MPR_FLAGS_DIAGRESET) {
mpr_dprint(sc, MPR_INIT, "%s reset already in progress\n",
-  __func__);
+   __func__);
return 0;
}
 
@@ -1712,9 +1709,9 @@ mpr_complete_command(struct mpr_softc *s
 
if (cm->cm_complete != NULL) {
mpr_dprint(sc, MPR_TRACE,
-  "%s cm %p calling cm_complete %p data %p reply %p\n",
-  __func__, cm, cm->cm_complete, cm->cm_complete_data,
-  cm->cm_reply);
+   "%s cm %p calling cm_complete %p data %p reply %p\n",
+   __func__, cm, cm->cm_complete, cm->cm_complete_data,
+   cm->cm_reply);
cm->cm_complete(sc, cm);
}
 
@@ -1772,9 +1769,8 @@ mpr_sas_log_info(struct mpr_softc *sc , 
}
  
mpr_dprint(sc, MPR_INFO, "log_info(0x%08x): originator(%s), "
-   "code(0x%02x), sub_code(0x%04x)\n", log_info,
-   originator_str, sas_loginfo.dw.code,
-   sas_loginfo.dw.subcode);
+   "code(0x%02x), sub_code(0x%04x)\n", log_info, originator_str,
+   sas_loginfo.dw.code, sas_loginfo.dw.subcode);
 }
 
 static void
@@ -2463,10 +2459,9 @@ mpr_data_cb(void *arg, bus_dma_segment_t
 * user they did the wrong thing.
 */
if ((cm->cm_max_segs != 0) && (nsegs > cm->cm_max_segs)) {
-   mpr_dprint(sc, MPR_ERROR,
-  "%s: warning: busdma returned %d segments, "
-  "more than the %d allowed\n", __func__, nsegs,
-  cm->cm_max_segs);
+   mpr_dprint(sc, MPR_ERROR, "%s: warning: busdma returned %d "
+   "segments, more than the %d allowed\n", __func__, nsegs,
+   cm->cm_max_segs);
}
 
/*
@@ -2663,8 +2658,8 @@ mpr_request_polled(struct mpr_softc *sc,
if (error) {
mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__);
rc = mpr_reinit(sc);
-   mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ?
-   

svn commit: r283990 - in stable/10/sys/dev/mpr: . mpi

2015-06-04 Thread Stephen McConnell
Author: slm
Date: Thu Jun  4 16:27:18 2015
New Revision: 283990
URL: https://svnweb.freebsd.org/changeset/base/283990

Log:
  MFC: r283661
  - Updated all files with 2015 Avago copyright, and updated LSI's copyright
dates.
  
  - Changed all of the PCI device strings from LSI to Avago Technologies (LSI).
  
  - Added a sysctl variable to control how StartStopUnit behavior works. User 
can
select to spin down disks based on if disk is SSD or HDD.
  
  - Inquiry data is required to tell if a disk will support SSU at shutdown or
not. Due to the addition of mprssas_async, which gets Advanced Info but not
Inquiry data, the setting of supports_SSU was moved to the
mprsas_scsiio_complete function, which snoops for any Inquiry commands. And,
since disks are shutdown as a target and not a LUN, this process was
simplified by basing it on targets and not LUNs.
  
  - Added a sysctl variable that sets the amount of time to retry after sending 
a
failed SATA ID command. This helps with some bad disks and large disks that
require a lot of time to spin up. Part of this change was to add a callout 
to
handle timeouts with the SATA ID command. The callout function is called
mprsas_ata_id_timeout(). (Fixes PR 191348)
  
  - Changed the way resets work by allowing I/O to continue to devices that are
not currently under a reset condition. This uses devq's instead of simq's 
and
makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a 
function
called mprsas_prepare_tm().
  
  - Some changes were made to reduce code duplication when getting a SAS address
for a SATA disk.
  
  - Fixed some formatting and whitespace.
  
  - Bump version of mpr driver to 9.255.01.00-fbsd
  
  PR:   191348

Modified:
  stable/10/sys/dev/mpr/mpi/mpi2.h
  stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h
  stable/10/sys/dev/mpr/mpi/mpi2_hbd.h
  stable/10/sys/dev/mpr/mpi/mpi2_history.txt
  stable/10/sys/dev/mpr/mpi/mpi2_init.h
  stable/10/sys/dev/mpr/mpi/mpi2_ioc.h
  stable/10/sys/dev/mpr/mpi/mpi2_ra.h
  stable/10/sys/dev/mpr/mpi/mpi2_raid.h
  stable/10/sys/dev/mpr/mpi/mpi2_sas.h
  stable/10/sys/dev/mpr/mpi/mpi2_targ.h
  stable/10/sys/dev/mpr/mpi/mpi2_tool.h
  stable/10/sys/dev/mpr/mpi/mpi2_type.h
  stable/10/sys/dev/mpr/mpr.c
  stable/10/sys/dev/mpr/mpr_config.c
  stable/10/sys/dev/mpr/mpr_ioctl.h
  stable/10/sys/dev/mpr/mpr_mapping.c
  stable/10/sys/dev/mpr/mpr_mapping.h
  stable/10/sys/dev/mpr/mpr_pci.c
  stable/10/sys/dev/mpr/mpr_sas.c
  stable/10/sys/dev/mpr/mpr_sas.h
  stable/10/sys/dev/mpr/mpr_sas_lsi.c
  stable/10/sys/dev/mpr/mpr_user.c
  stable/10/sys/dev/mpr/mprvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mpr/mpi/mpi2.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2.hThu Jun  4 15:02:05 2015
(r283989)
+++ stable/10/sys/dev/mpr/mpi/mpi2.hThu Jun  4 16:27:18 2015
(r283990)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h   Thu Jun  4 15:02:05 2015
(r283989)
+++ stable/10/sys/dev/mpr/mpi/mpi2_cnfg.h   Thu Jun  4 16:27:18 2015
(r283990)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: stable/10/sys/dev/mpr/mpi/mpi2_hbd.h
==
--- stable/10/sys/dev/mpr/mpi/mpi2_hbd.hThu Jun  4 15:02:05 2015
(r283989)
+++ stable/10/sys/dev/mpr/mpi/mpi2_hbd.hThu Jun  4 16:27:18 2015
(r283990)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * 

svn commit: r283661 - in head/sys/dev/mpr: . mpi

2015-05-28 Thread Stephen McConnell
Author: slm
Date: Thu May 28 18:24:22 2015
New Revision: 283661
URL: https://svnweb.freebsd.org/changeset/base/283661

Log:
  The wrong commit message was given with r283632.  This is the correct message.
  
  - Updated all files with 2015 Avago copyright, and updated LSI's copyright
dates.
  
  - Changed all of the PCI device strings from LSI to Avago Technologies (LSI).
  
  - Added a sysctl variable to control how StartStopUnit behavior works. User 
can
select to spin down disks based on if disk is SSD or HDD.
  
  - Inquiry data is required to tell if a disk will support SSU at shutdown or
not. Due to the addition of mpssas_async, which gets Advanced Info but not
Inquiry data, the setting of supports_SSU was moved to the
mpssas_scsiio_complete function, which snoops for any Inquiry commands. And,
since disks are shutdown as a target and not a LUN, this process was
simplified by basing it on targets and not LUNs.
  
  - Added a sysctl variable that sets the amount of time to retry after sending 
a
failed SATA ID command. This helps with some bad disks and large disks that
require a lot of time to spin up. Part of this change was to add a callout 
to
handle timeouts with the SATA ID command. The callout function is called
mpssas_ata_id_timeout(). (Fixes PR 191348)
  
  - Changed the way resets work by allowing I/O to continue to devices that are
not currently under a reset condition. This uses devq's instead of simq's 
and
makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a 
function
called mpssas_prepare_tm().
  
  - Some changes were made to reduce code duplication when getting a SAS address
for a SATA disk.
  
  - Fixed some formatting and whitespace.
  
  - Bump version of mps driver to 9.255.01.00-fbsd
  
  PR:   191348
  Reviewed by:  ken, scottl
  Approved by:  ken, scottl
  MFC after:1 week

Modified:
  head/sys/dev/mpr/mpi/mpi2.h
  head/sys/dev/mpr/mpi/mpi2_cnfg.h
  head/sys/dev/mpr/mpi/mpi2_hbd.h
  head/sys/dev/mpr/mpi/mpi2_history.txt
  head/sys/dev/mpr/mpi/mpi2_init.h
  head/sys/dev/mpr/mpi/mpi2_ioc.h
  head/sys/dev/mpr/mpi/mpi2_ra.h
  head/sys/dev/mpr/mpi/mpi2_raid.h
  head/sys/dev/mpr/mpi/mpi2_sas.h
  head/sys/dev/mpr/mpi/mpi2_targ.h
  head/sys/dev/mpr/mpi/mpi2_tool.h
  head/sys/dev/mpr/mpi/mpi2_type.h
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_ioctl.h
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_mapping.h
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpi/mpi2.h
==
--- head/sys/dev/mpr/mpi/mpi2.h Thu May 28 18:14:55 2015(r283660)
+++ head/sys/dev/mpr/mpi/mpi2.h Thu May 28 18:24:22 2015(r283661)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h
==
--- head/sys/dev/mpr/mpi/mpi2_cnfg.hThu May 28 18:14:55 2015
(r283660)
+++ head/sys/dev/mpr/mpi/mpi2_cnfg.hThu May 28 18:24:22 2015
(r283661)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: head/sys/dev/mpr/mpi/mpi2_hbd.h
==
--- head/sys/dev/mpr/mpi/mpi2_hbd.h Thu May 28 18:14:55 2015
(r283660)
+++ head/sys/dev/mpr/mpi/mpi2_hbd.h Thu May 28 18:24:22 2015
(r283661)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All 

svn commit: r283660 - in head/sys/dev/mpr: . mpi

2015-05-28 Thread Stephen McConnell
Author: slm
Date: Thu May 28 18:14:55 2015
New Revision: 283660
URL: https://svnweb.freebsd.org/changeset/base/283660

Log:
  The wrong commit message was given with r283632. To get the correct commit
  message synced to the changes in r283632, those changes are now backed out.
  Another commit will be done that is exactly the same as r283632 except it will
  have to correct commit message.
  
  Approved by:  ken, scottl, asomers, gibbs

Modified:
  head/sys/dev/mpr/mpi/mpi2.h
  head/sys/dev/mpr/mpi/mpi2_cnfg.h
  head/sys/dev/mpr/mpi/mpi2_hbd.h
  head/sys/dev/mpr/mpi/mpi2_history.txt
  head/sys/dev/mpr/mpi/mpi2_init.h
  head/sys/dev/mpr/mpi/mpi2_ioc.h
  head/sys/dev/mpr/mpi/mpi2_ra.h
  head/sys/dev/mpr/mpi/mpi2_raid.h
  head/sys/dev/mpr/mpi/mpi2_sas.h
  head/sys/dev/mpr/mpi/mpi2_targ.h
  head/sys/dev/mpr/mpi/mpi2_tool.h
  head/sys/dev/mpr/mpi/mpi2_type.h
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_ioctl.h
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_mapping.h
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpi/mpi2.h
==
--- head/sys/dev/mpr/mpi/mpi2.h Thu May 28 18:06:03 2015(r283659)
+++ head/sys/dev/mpr/mpi/mpi2.h Thu May 28 18:14:55 2015(r283660)
@@ -1,6 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013 LSI Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,14 +26,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * LSI MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2015 LSI Corporation.
- *  Copyright (c) 2013-2015 Avago Technologies
+ *  Copyright (c) 2000-2013 LSI Corporation.
  *
  *
  *   Name:  mpi2.h

Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h
==
--- head/sys/dev/mpr/mpi/mpi2_cnfg.hThu May 28 18:06:03 2015
(r283659)
+++ head/sys/dev/mpr/mpi/mpi2_cnfg.hThu May 28 18:14:55 2015
(r283660)
@@ -1,6 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013 LSI Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,14 +26,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * LSI MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2015 LSI Corporation.
- *  Copyright (c) 2013-2015 Avago Technologies
+ *  Copyright (c) 2000-2013 LSI Corporation.
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: head/sys/dev/mpr/mpi/mpi2_hbd.h
==
--- head/sys/dev/mpr/mpi/mpi2_hbd.h Thu May 28 18:06:03 2015
(r283659)
+++ head/sys/dev/mpr/mpi/mpi2_hbd.h Thu May 28 18:14:55 2015
(r283660)
@@ -1,6 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013 LSI Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,14 +26,13 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * LSI MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2009-2015 LSI Corporation.
- *  Copyright (c) 2013-2015 Avago Technologies
+ *  Copyright (c) 2009-2011 LSI Corporation.
  *
  *
  *   Name:  mpi2_hbd.h

Modified: head/sys/dev/mpr/mpi/mpi2_history.txt
==
--- head/sys/dev/mpr/mpi/mpi2_history.txt   Thu May 28 18:06:03 2015
(r283659)
+++ head/sys/dev/mpr/mpi/mpi2_history.txt   Thu May 28 18:14:55 2015
(r283660)
@@ -1,6 +1,5 @@
 /*-
- * Copyright (c) 2012-2015 LSI Corp.
- * Copyright (c) 2013-2015 Avago Technologies
+ * Copyright (c) 2013 LSI Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
+ * LSI MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
@@ -36,8 +35,7 @@
  Fusion-MPT MPI 2.0 / 2.5 Header File Change History
  ==
 
- Copyright (c) 2000-2015 LSI Corporation.
- Copyright (c) 2013-2015 

svn commit: r283632 - in head/sys/dev/mpr: . mpi

2015-05-27 Thread Stephen McConnell
Author: slm
Date: Wed May 27 20:37:34 2015
New Revision: 283632
URL: https://svnweb.freebsd.org/changeset/base/283632

Log:
  This setting of stop_at_shutdown should have been removed with r279253
  
  Approved by:  ken
  MFC after:1 week

Modified:
  head/sys/dev/mpr/mpi/mpi2.h
  head/sys/dev/mpr/mpi/mpi2_cnfg.h
  head/sys/dev/mpr/mpi/mpi2_hbd.h
  head/sys/dev/mpr/mpi/mpi2_history.txt
  head/sys/dev/mpr/mpi/mpi2_init.h
  head/sys/dev/mpr/mpi/mpi2_ioc.h
  head/sys/dev/mpr/mpi/mpi2_ra.h
  head/sys/dev/mpr/mpi/mpi2_raid.h
  head/sys/dev/mpr/mpi/mpi2_sas.h
  head/sys/dev/mpr/mpi/mpi2_targ.h
  head/sys/dev/mpr/mpi/mpi2_tool.h
  head/sys/dev/mpr/mpi/mpi2_type.h
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mpr/mpr_config.c
  head/sys/dev/mpr/mpr_ioctl.h
  head/sys/dev/mpr/mpr_mapping.c
  head/sys/dev/mpr/mpr_mapping.h
  head/sys/dev/mpr/mpr_pci.c
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/mpr/mpr_sas.h
  head/sys/dev/mpr/mpr_sas_lsi.c
  head/sys/dev/mpr/mpr_user.c
  head/sys/dev/mpr/mprvar.h

Modified: head/sys/dev/mpr/mpi/mpi2.h
==
--- head/sys/dev/mpr/mpi/mpi2.h Wed May 27 20:26:41 2015(r283631)
+++ head/sys/dev/mpr/mpi/mpi2.h Wed May 27 20:37:34 2015(r283632)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h
==
--- head/sys/dev/mpr/mpi/mpi2_cnfg.hWed May 27 20:26:41 2015
(r283631)
+++ head/sys/dev/mpr/mpi/mpi2_cnfg.hWed May 27 20:37:34 2015
(r283632)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2013 LSI Corporation.
+ *  Copyright (c) 2000-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: head/sys/dev/mpr/mpi/mpi2_hbd.h
==
--- head/sys/dev/mpr/mpi/mpi2_hbd.h Wed May 27 20:26:41 2015
(r283631)
+++ head/sys/dev/mpr/mpi/mpi2_hbd.h Wed May 27 20:37:34 2015
(r283632)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,13 +27,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2009-2011 LSI Corporation.
+ *  Copyright (c) 2009-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_hbd.h

Modified: head/sys/dev/mpr/mpi/mpi2_history.txt
==
--- head/sys/dev/mpr/mpi/mpi2_history.txt   Wed May 27 20:26:41 2015
(r283631)
+++ head/sys/dev/mpr/mpi/mpi2_history.txt   Wed May 27 20:37:34 2015
(r283632)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2013 LSI Corp.
+ * Copyright (c) 2012-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
@@ -35,7 +36,8 @@
  Fusion-MPT MPI 2.0 / 2.5 Header File Change History
  ==
 
- Copyright (c) 2000-2013 LSI Corporation.
+ Copyright (c) 2000-2015 LSI Corporation.
+ Copyright (c) 2013-2015 Avago Technologies
 
  ---
  Header Set Release Version:02.00.33

Modified: head/sys/dev/mpr/mpi/mpi2_init.h

svn commit: r281564 - in stable/10/sys/dev/mps: . mpi

2015-04-15 Thread Stephen McConnell
Author: slm
Date: Wed Apr 15 21:47:15 2015
New Revision: 281564
URL: https://svnweb.freebsd.org/changeset/base/281564

Log:
  MFI r257381:
  Adjust to handle either a 32-bit or 64-bit lun_id_t in printf.
  
  MFC r266615:
  Increase taskqueue thread priority from idle to PRIBIO.
  
  MFC r279253:
  - Copyright to Avago
  - SSU changes
  - SATA ID timeout handling (PR 191348)
  - reset handling changes
  - Bump version to 20.00.00.00-fbsd
  
  MFC r279695:
  Change that should have been done with r279253

Modified:
  stable/10/sys/dev/mps/mpi/mpi2.h
  stable/10/sys/dev/mps/mpi/mpi2_cnfg.h
  stable/10/sys/dev/mps/mpi/mpi2_hbd.h
  stable/10/sys/dev/mps/mpi/mpi2_history.txt
  stable/10/sys/dev/mps/mpi/mpi2_init.h
  stable/10/sys/dev/mps/mpi/mpi2_ioc.h
  stable/10/sys/dev/mps/mpi/mpi2_ra.h
  stable/10/sys/dev/mps/mpi/mpi2_raid.h
  stable/10/sys/dev/mps/mpi/mpi2_sas.h
  stable/10/sys/dev/mps/mpi/mpi2_targ.h
  stable/10/sys/dev/mps/mpi/mpi2_tool.h
  stable/10/sys/dev/mps/mpi/mpi2_type.h
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_config.c
  stable/10/sys/dev/mps/mps_ioctl.h
  stable/10/sys/dev/mps/mps_mapping.c
  stable/10/sys/dev/mps/mps_mapping.h
  stable/10/sys/dev/mps/mps_pci.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mps_sas.h
  stable/10/sys/dev/mps/mps_sas_lsi.c
  stable/10/sys/dev/mps/mps_user.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mps/mpi/mpi2.h
==
--- stable/10/sys/dev/mps/mpi/mpi2.hWed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2.hWed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2006-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2012 LSI Corporation.
+ *  Copyright (c) 2006-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: stable/10/sys/dev/mps/mpi/mpi2_cnfg.h
==
--- stable/10/sys/dev/mps/mpi/mpi2_cnfg.h   Wed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2_cnfg.h   Wed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2006-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2012 LSI Corporation.
+ *  Copyright (c) 2006-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: stable/10/sys/dev/mps/mpi/mpi2_hbd.h
==
--- stable/10/sys/dev/mps/mpi/mpi2_hbd.hWed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2_hbd.hWed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2009-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2009-2012 LSI Corporation.
+ *  Copyright (c) 2009-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_hbd.h

Modified: stable/10/sys/dev/mps/mpi/mpi2_history.txt
==
--- stable/10/sys/dev/mps/mpi/mpi2_history.txt  Wed Apr 15 20:55:43 2015
(r281563)
+++ stable/10/sys/dev/mps/mpi/mpi2_history.txt  Wed Apr 15 21:47:15 2015
(r281564)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2000-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +24,7 @@
  * OUT OF THE USE OF THIS 

svn commit: r279695 - head/sys/dev/mps

2015-03-06 Thread Stephen McConnell
Author: slm
Date: Fri Mar  6 16:17:08 2015
New Revision: 279695
URL: https://svnweb.freebsd.org/changeset/base/279695

Log:
  This setting of stop_at_shutdown should have been removed with r279253
  
  Approved by:  ken
  MFC after:1 week

Modified:
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Fri Mar  6 16:09:33 2015(r279694)
+++ head/sys/dev/mps/mps_sas.c  Fri Mar  6 16:17:08 2015(r279695)
@@ -3406,19 +3406,6 @@ mpssas_check_eedp(struct mps_softc *sc, 
 
xpt_path_string(local_path, path_str, sizeof(path_str));
 
-   /*
-* If this is a SATA direct-access end device,
-* mark it so that a SCSI StartStopUnit command
-* will be sent to it when the driver is being
-* shutdown.
-*/
-   if ((cgd.inq_data.device == T_DIRECT)  
-   (target-devinfo  MPI2_SAS_DEVICE_INFO_SATA_DEVICE) 
-   ((target-devinfo  MPI2_SAS_DEVICE_INFO_MASK_DEVICE_TYPE) ==
-   MPI2_SAS_DEVICE_INFO_END_DEVICE)) {
-   lun-stop_at_shutdown = TRUE;
-   }
-
mps_dprint(sc, MPS_INFO, Sending read cap: path %s handle %d\n,
path_str, target-handle);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r279253 - in head/sys/dev/mps: . mpi

2015-02-24 Thread Stephen McConnell
Author: slm
Date: Tue Feb 24 22:07:42 2015
New Revision: 279253
URL: https://svnweb.freebsd.org/changeset/base/279253

Log:
  - Updated all files with 2015 Avago copyright, and updated LSI's copyright
dates.
  
  - Changed all of the PCI device strings from LSI to Avago Technologies (LSI).
  
  - Added a sysctl variable to control how StartStopUnit behavior works. User 
can
select to spin down disks based on if disk is SSD or HDD.
  
  - Inquiry data is required to tell if a disk will support SSU at shutdown or
not. Due to the addition of mpssas_async, which gets Advanced Info but not
Inquiry data, the setting of supports_SSU was moved to the
mpssas_scsiio_complete function, which snoops for any Inquiry commands. And,
since disks are shutdown as a target and not a LUN, this process was
simplified by basing it on targets and not LUNs.
  
  - Added a sysctl variable that sets the amount of time to retry after sending 
a
failed SATA ID command. This helps with some bad disks and large disks that
require a lot of time to spin up. Part of this change was to add a callout 
to
handle timeouts with the SATA ID command. The callout function is called
mpssas_ata_id_timeout(). (Fixes PR 191348)
  
  - Changed the way resets work by allowing I/O to continue to devices that are
not currently under a reset condition. This uses devq's instead of simq's 
and
makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a 
function
called mpssas_prepare_tm().
  
  - Some changes were made to reduce code duplication when getting a SAS address
for a SATA disk.
  
  - Fixed some formatting and whitespace.
  
  - Bump version of mps driver to 20.00.00.00-fbsd
  
  PR:   191348
  Reviewed by:  ken, scottl
  Approved by:  ken, scottl
  MFC after:2 weeks

Modified:
  head/sys/dev/mps/mpi/mpi2.h
  head/sys/dev/mps/mpi/mpi2_cnfg.h
  head/sys/dev/mps/mpi/mpi2_hbd.h
  head/sys/dev/mps/mpi/mpi2_history.txt
  head/sys/dev/mps/mpi/mpi2_init.h
  head/sys/dev/mps/mpi/mpi2_ioc.h
  head/sys/dev/mps/mpi/mpi2_ra.h
  head/sys/dev/mps/mpi/mpi2_raid.h
  head/sys/dev/mps/mpi/mpi2_sas.h
  head/sys/dev/mps/mpi/mpi2_targ.h
  head/sys/dev/mps/mpi/mpi2_tool.h
  head/sys/dev/mps/mpi/mpi2_type.h
  head/sys/dev/mps/mps.c
  head/sys/dev/mps/mps_config.c
  head/sys/dev/mps/mps_ioctl.h
  head/sys/dev/mps/mps_mapping.c
  head/sys/dev/mps/mps_mapping.h
  head/sys/dev/mps/mps_pci.c
  head/sys/dev/mps/mps_sas.c
  head/sys/dev/mps/mps_sas.h
  head/sys/dev/mps/mps_sas_lsi.c
  head/sys/dev/mps/mps_user.c
  head/sys/dev/mps/mpsvar.h

Modified: head/sys/dev/mps/mpi/mpi2.h
==
--- head/sys/dev/mps/mpi/mpi2.h Tue Feb 24 21:37:20 2015(r279252)
+++ head/sys/dev/mps/mpi/mpi2.h Tue Feb 24 22:07:42 2015(r279253)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2006-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2012 LSI Corporation.
+ *  Copyright (c) 2006-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2.h

Modified: head/sys/dev/mps/mpi/mpi2_cnfg.h
==
--- head/sys/dev/mps/mpi/mpi2_cnfg.hTue Feb 24 21:37:20 2015
(r279252)
+++ head/sys/dev/mps/mpi/mpi2_cnfg.hTue Feb 24 22:07:42 2015
(r279253)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2006-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,13 +24,14 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * LSI MPT-Fusion Host Adapter FreeBSD
+ * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
  *
  * $FreeBSD$
  */
 
 /*
- *  Copyright (c) 2000-2012 LSI Corporation.
+ *  Copyright (c) 2006-2015 LSI Corporation.
+ *  Copyright (c) 2013-2015 Avago Technologies
  *
  *
  *   Name:  mpi2_cnfg.h

Modified: head/sys/dev/mps/mpi/mpi2_hbd.h
==
--- head/sys/dev/mps/mpi/mpi2_hbd.h Tue Feb 24 21:37:20 2015
(r279252)
+++ head/sys/dev/mps/mpi/mpi2_hbd.h Tue Feb 24 22:07:42 2015
(r279253)
@@ -1,5 +1,6 @@
 /*-
- * Copyright (c) 2011, 2012 LSI Corp.
+ * Copyright (c) 2009-2015 LSI Corp.
+ * Copyright (c) 2013-2015 Avago Technologies
  * All rights reserved.
  *
  * Redistribution and use in source and 

svn commit: r270250 - stable/10/sys/dev/mps

2014-08-20 Thread Stephen McConnell
Author: slm
Date: Wed Aug 20 23:09:27 2014
New Revision: 270250
URL: http://svnweb.freebsd.org/changeset/base/270250

Log:
  MFC r269314 and r269316
  
  r269314:
  Bring in LSI's phase16 - phase18 changes
  * Implements Start Stop Unit for SATA direct-attach devices in IR mode to 
avoid
data corruption.
  * Use CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT and CAM_TID_INVALID
  
  r269316:
  Bring in LSI's phase19 changes
  * Removed unused mpssas_discovery_timeout function.
  * Don't alter mapping boundaries if not raid firmware.
  * Check free_busaddr instead of post_busaddr (diff minimisation really)
  
  Approved by:  ken (co-mentor) and smh

Modified:
  stable/10/sys/dev/mps/mps.c
  stable/10/sys/dev/mps/mps_mapping.c
  stable/10/sys/dev/mps/mps_sas.c
  stable/10/sys/dev/mps/mps_sas.h
  stable/10/sys/dev/mps/mps_sas_lsi.c
  stable/10/sys/dev/mps/mpsvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/mps/mps.c
==
--- stable/10/sys/dev/mps/mps.c Wed Aug 20 22:58:12 2014(r270249)
+++ stable/10/sys/dev/mps/mps.c Wed Aug 20 23:09:27 2014(r270250)
@@ -140,6 +140,7 @@ mps_diag_reset(struct mps_softc *sc,int 
 {
uint32_t reg;
int i, error, tries = 0;
+   uint8_t first_wait_done = FALSE;
 
mps_dprint(sc, MPS_TRACE, %s\n, __func__);
 
@@ -182,15 +183,32 @@ mps_diag_reset(struct mps_softc *sc,int 
 
/* Wait up to 300 seconds in 50ms intervals */
error = ETIMEDOUT;
-   for (i = 0; i  6; i++) {
-   /* wait 50 msec */
-   if (mtx_owned(sc-mps_mtx)  sleep_flag == CAN_SLEEP)
-   msleep(sc-msleep_fake_chan, sc-mps_mtx, 0,
-   mpsdiag, hz/20);
-   else if (sleep_flag == CAN_SLEEP)
-   pause(mpsdiag, hz/20);
-   else
-   DELAY(50 * 1000);
+   for (i = 0; i  6000; i++) {
+   /*
+* Wait 50 msec. If this is the first time through, wait 256
+* msec to satisfy Diag Reset timing requirements.
+*/
+   if (first_wait_done) {
+   if (mtx_owned(sc-mps_mtx)  sleep_flag == CAN_SLEEP)
+   msleep(sc-msleep_fake_chan, sc-mps_mtx, 0,
+   mpsdiag, hz/20);
+   else if (sleep_flag == CAN_SLEEP)
+   pause(mpsdiag, hz/20);
+   else
+   DELAY(50 * 1000);
+   } else {
+   DELAY(256 * 1000);
+   first_wait_done = TRUE;
+   }
+   /*
+* Check for the RESET_ADAPTER bit to be cleared first, then
+* wait for the RESET state to be cleared, which takes a little
+* longer.
+*/
+   reg = mps_regread(sc, MPI2_HOST_DIAGNOSTIC_OFFSET);
+   if (reg  MPI2_DIAG_RESET_ADAPTER) {
+   continue;
+   }
reg = mps_regread(sc, MPI2_DOORBELL_OFFSET);
if ((reg  MPI2_IOC_STATE_MASK) != MPI2_IOC_STATE_RESET) {
error = 0;
@@ -236,7 +254,7 @@ mps_transition_ready(struct mps_softc *s
sleep_flags = (sc-mps_flags  MPS_FLAGS_ATTACH_DONE)
? CAN_SLEEP:NO_SLEEP;
error = 0;
-   while (tries++  5) {
+   while (tries++  1200) {
reg = mps_regread(sc, MPI2_DOORBELL_OFFSET);
mps_dprint(sc, MPS_INIT, Doorbell= 0x%x\n, reg);
 
@@ -592,7 +610,7 @@ mps_iocfacts_free(struct mps_softc *sc)
 
mps_dprint(sc, MPS_TRACE, %s\n, __func__);
 
-   if (sc-post_busaddr != 0)
+   if (sc-free_busaddr != 0)
bus_dmamap_unload(sc-queues_dmat, sc-queues_map);
if (sc-free_queue != NULL)
bus_dmamem_free(sc-queues_dmat, sc-free_queue,
@@ -656,6 +674,9 @@ int
 mps_reinit(struct mps_softc *sc)
 {
int error;
+   struct mpssas_softc *sassc;
+
+   sassc = sc-sassc;
 
MPS_FUNCTRACE(sc);
 
@@ -736,6 +757,8 @@ mps_reinit(struct mps_softc *sc)
mps_dprint(sc, MPS_INFO, %s finished sc %p post %u free %u\n, 
__func__, sc, sc-replypostindex, sc-replyfreeindex);
 
+   mpssas_release_simq_reinit(sassc);
+
return 0;
 }
 
@@ -2510,6 +2533,7 @@ int
 mps_request_polled(struct mps_softc *sc, struct mps_command *cm)
 {
int error, timeout = 0, rc;
+   struct timeval cur_time, start_time;
 
error = 0;
 
@@ -2517,22 +2541,33 @@ mps_request_polled(struct mps_softc *sc,
cm-cm_complete = NULL;
mps_map_command(sc, cm);
 
+   getmicrotime(start_time);
while ((cm-cm_flags  MPS_CM_FLAGS_COMPLETE) == 0) {
mps_intr_locked(sc);
 
-   DELAY(50 * 1000);
-   

svn commit: r266480 - head/share/misc

2014-05-20 Thread Stephen McConnell
Author: slm
Date: Tue May 20 22:11:52 2014
New Revision: 266480
URL: http://svnweb.freebsd.org/changeset/base/266480

Log:
  - Add myself to committers-src.dot
  
  Approved by:  ken/scottl (mentors)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Tue May 20 21:24:15 2014
(r266479)
+++ head/share/misc/committers-src.dot  Tue May 20 22:11:52 2014
(r266480)
@@ -270,6 +270,7 @@ sephe [label=Sepherosa Ziehau\nsephe@Fr
 sepotvin [label=Stephane E. Potvin\nsepot...@freebsd.org\n2007/02/15]
 simon [label=Simon L. Nielsen\nsi...@freebsd.org\n2006/03/07]
 sjg [label=Simon J. Gerraty\n...@freebsd.org\n2012/10/23]
+slm [label=Stephen McConnell\n...@freebsd.org\n2014/05/07]
 smh [label=Steven Hartland\n...@freebsd.org\n2012/11/12]
 sobomax [label=Maxim Sobolev\nsobo...@freebsd.org\n2001/07/25]
 sos [label=Soren Schmidt\n...@freebsd.org\n/??/??]
@@ -525,6 +526,7 @@ julian - mp
 kan - kib
 
 ken - asomers
+ken - slm
 
 kib - ae
 kib - dchagin
@@ -664,6 +666,7 @@ scottl - jimharris
 scottl - pjd
 scottl - sah
 scottl - sbruno
+scottl - slm
 scottl - yongari
 
 sheldonh - dwmalone
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org