[Bug 271238] mpr (LSI SAS3816) driver not finding all devices in HP D6020 enclosures

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 25 Nov 2024 13:36:35 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271238

--- Comment #6 from Peter Eriksson <pen@lysator.liu.se> ---
Some more interresting details from the lastest boot. At boot all the disks are
detected, however....

Partial output from "mpr show devices"

> 00   101  5000cca2912db98d 0039    0017      SAS Target    12    0002 85    1
> 00   102  5000cca2912e3619 003a    0017      SAS Target    12    0002 86    1
>           5000cca2912d19ed 003b    0017      SAS Target    12    0002 87    1
>           5000cca2912d8bc5 003c    0017      SAS Target    12    0002 88    1

Now looking at the boot output I notice this:

> mpr0: Handle 0x003b SAS Address from SAS device page0 = 5000cca2912d19ed
> mpr0: mprsas_add_device: Target ID for added device is 103.
> mpr0: Found device <401<SspTarg>,End Device> <12.0Gbps> handle<0x003b> enclosureHandle<0x0002> slot 87
> mpr0: At enclosure level 0 and connector name (C1  )
> mpr0: Target id 0x67 added
>
> mpr0: Handle 0x003c SAS Address from SAS device page0 = 5000cca2912d8bc5
> mpr0: mprsas_add_device: Target ID for added device is 104.
> mpr0: Found device <401<SspTarg>,End Device> <12.0Gbps> handle<0x003c> enclosureHandle<0x0002> slot 88
> mpr0: At enclosure level 0 and connector name (C1  )
> mpr0: Target id 0x68 added

Ok here the ..19ed drive is detected and allocated the target id 103 - which it
looks like to be the next number...
(and ...8bc5 gets target it 104.

A bit further down in the boot sequence I find this:

> mpr0: _mapping_find_enc_map_space: Looking for space in the mapping table for added enclosure.
> mpr0: _mapping_find_enc_map_space: Found space in the mapping for enclosure at map index 34.
> mpr0: _mapping_get_dev_info: Initialize 18 map entries for the enclosure, starting at map index  34.
> mpr0: _mapping_flush_dpm_pages: Flushing DPM entry 1.
> 
> mpr0: Handle 0x0062 SAS Address from SAS device page0 = 5000cca25147fc2d
> mpr0: mprsas_add_device: Target ID for added device is 103.
> mpr0: Attempting to reuse target id 103 handle 0x003b
> 
> mpr0: Handle 0x0063 SAS Address from SAS device page0 = 5000cca251470281
> mpr0: mprsas_add_device: Target ID for added device is 104.
> mpr0: Attempting to reuse target id 104 handle 0x003c

If I'm reading this right it looks like the mpr driver overwrites the target
entries for 103 & 104 with some other drive found later in the sequence.
(there are more entries like this).

I wonder if not the code in _mapping_find_enc_map_space() is mistakenly reusing
some mapping table space that already is in use... 

I'll upload the complete outputs from boot and mpr show devices for reference
too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.