# Gentoo and HighPoint RocketRAID

## uberDoward

So I'm following the instructions from here:

https://wiki.gentoo.org/wiki/HighPoint_RocketRAID#Supported_cards

I built my own kernel (instead of genkernel), so I may just be missing some option in the kernel config.

Anyway, added layman to the system, added the overlay.  When it came time to 'specify the correct USE flag', I added 'sys-block/rocketraid rr268x' to /etc/portage/package.use/rocketraid, so I think I did that correctly?

Emerge rocketraid, it pulls rr268x-1.9, which fails to emerge with the following:

emerge --info

http://pastebin.com/ZENPDX8e

emerge -pqv

[ebuild  N    ] sys-block/rr268x-1.9 

Build log

http://pastebin.com/FerHwafL

Seems to have errors:

error: 'struct gendisk' has no member named 'driverfs_dev'

error: 'struct inode' has no member named 'i_mutex'

error: 'struct inode' has no member named 'i_mutex'

Am I missing something in my kernel config to properly emerge this RR2680 card?

----------

## frostschutz

Which kernel version are you using? According to this GitHub source https://github.com/dsiggi/RocketRAID it's not been updated to >= 4.7 yet.

Personally I'd get rid of this piece o junk asap...

----------

## ct85711

 *Quote:*   

>  * Found sources for kernel version:
> 
>  *     4.9.6-gentoo-r1-Doward

 

Just doing a quick search, it appears driverfs_dev was in the process of being removed from the kernel about around the 4.8 kernel series.  I don't know for certain if this is did happen or not on that version, but you may need to try an earlier version.

 *Quote:*   

> From	"Williams, Dan J" <>
> 
> Subject	[GIT PULL] ->driverfs_dev removal for 4.8
> 
> Date	Fri, 8 Jul 2016 21:56:57 +0000
> ...

 

----------

## uberDoward

Yeah, that seems to be the case.

I'm working on patching the stupid thing for 4.8  :Sad: 

Not sure who handles the wiki, but might be a good idea to update the RocketRAID wiki to reflect this (stay with kernel <= 4.7)

----------

## frostschutz

Who handles the wiki? You do. Anyone can register and edit... so get to it.  :Laughing: 

I still recommend going with hardware that's actually officially supported by the kernel. Otherwise you will face the very same problem again with your next update. It's nice that there is a driver available at all (let's hope it actually works rock stable) but just not worth the hassle.

----------

## uberDoward

Here's the patch if anyone's interested:

http://pastebin.com/ShHsJRkA

Module appears to load fine, but complains it can't find the controller.  More digging to do...

As for the wiki, didn't realize that!  I'll see what I can do  :Smile: 

*sigh*  For now I'm off to research how to debug a kernel module, see if I can figure out why it's not detecting the card.  lspci sees the card just fine, lol.

dmesg output:

[  422.666487] rr2680:RocketRAID 268x controller driver v2.1 (Mar 10 2017 01:23:19)

[  422.666498] rr2680:no controller detected.

lspci output:

02:00.0 SCSI storage controller: HighPoint Technologies, Inc. Device 2680 (rev 01)

----------

## uberDoward

Ok, so I've rebuilt the kernel module for rr2680.ko with debugging symbols (yay!)

Even set a breakpoint on hpt_detect.

p in gdb shows

$2 = {int (Scsi_Host_Template *)} 0x1a30 <hpt_detect>

It seems that using a separate terminal to try re-loading the module doesn't hit the breakpoint, though.

How do I execute this particular function and have it hit my breakpoint?

----------

## frostschutz

How about you contact the owner of that GitHub project? Last commit was 20 hours ago so seems to be alive, they might be in the best position to provide help (whereas you provide testing with that particular model)

----------

## uberDoward

Ok, I think I found him on Twitter.  Ugh, I never use twitter  :Sad:   'Tweeted' him anyway, see if I get a response.

Good idea, frostschutz  :Smile:   Let's see if it gets somewhere....

Oh, in response to your earlier comment - *shrug*  The driver's open source.  If we can get it working, maybe we can submit a patch upstream to the mainline kernel, and it'll 'just work' out of the box moving forward.

With all the help I've gotten over the years in the *nix community, I'm happy to give back in some small way  :Smile: 

Never know unless you try  :Smile: 

----------

## uberDoward

No word from Daniel.  Figured a bump was in order.

If anyone can point me (or give me a high level overview) of what I'm needing to do to actually hit a gdb breakpoint when loading a kernel module, that'd be a huge help!

----------

## NP-Hardass

See if these help you out

https://github.com/NP-Hardass/np-hardass-overlay/tree/master/sys-block/rocketraid62x/files

----------

## uberDoward

Appreciate that, NP - but it's not the patch itself I'm having issues with, it's how to hit a breakpoint in a kernel module  :Smile: 

----------

## NP-Hardass

 *uberDoward wrote:*   

> Appreciate that, NP - but it's not the patch itself I'm having issues with, it's how to hit a breakpoint in a kernel module 

 

No problem.  Just figured I'd share since I can't vouch for someone else's module unless I've used it.  I know my ebuild/patches work for my rr62x controller, so I figured I'd float it in case the ebuild/patches you were using were the issue.

----------

## uberDoward

Ah, ok, maybe I wasn't clear before - I tried the ebuild, it failed.  As I went down the rabbit hole, I ended up yanking the v2.1 open source drivers from HPT directly, directly patching them, and that's where I'm now stuck trying to debug the actual kernel module.  I don't have any experience using gdb (I'm a Microsoft VS/.NET guy by day), so I'm kind of stuck until I figure that out.

I had hoped to reach out the the local Linux Users Group here in Jacksonville yesterday, but didn't make it due to family obligations.

----------

## dsiggi

 *uberDoward wrote:*   

> No word from Daniel.  Figured a bump was in order.
> 
> If anyone can point me (or give me a high level overview) of what I'm needing to do to actually hit a gdb breakpoint when loading a kernel module, that'd be a huge help!

 

Hi there.

I'm the owner from the github project. I have no twitter so I think you wrote to a wrong person.

Actually I updating all drivers in my overlay.

At the moment this drivers are working with kernels >=4.7:

rr62x

rr64x

rr64xl

rr172x

rr174x

rr222x

rr231x

rr232x

rr2340

The others drivers will follow soon.

dsiggi

----------

## uberDoward

You're probably right  :Smile: 

I ended up just putting a ton of debug statements into the code.

Now finding the controller  :Smile: 

I'd be happy to submit my latest patch if it would help the drivers for the 2680.

----------

## dsiggi

 *uberDoward wrote:*   

> You're probably right 
> 
> I ended up just putting a ton of debug statements into the code.
> 
> Now finding the controller 
> ...

 

Hi uberDoward,

I have updated the rr268x driver. Enjoy   :Very Happy: 

dsiggi

----------

## uberDoward

Hey, thanks!  I'll check it out when I get a free moment  :Smile: 

One note - that patch on GitHub appears to be against the v1.9 drivers - I've been building my patch against the v2.1 drivers.

I think I'd like to get my patch working with the 2.1 HPT drivers first, then I can save that off to the side and then I'll check the latest updates from your ebuild, dsiggi

----------

## uberDoward

Was able to dedicate a little more to this today.

Results from my 2.1 patch:

rr2680:adapter at PCI 2:0:0, IRQ 57

AMD-Vi: Event logged [

IO_PAGE_FAULT device=02:00.0 domain=0x0014 address=0x00000007f839d000 flags=0x0000]

rr2680:port reset not complete success, ignore the port (0)

rr2680:port reset not complete success, ignore the port (1)

scsi host6: rr2680

I can hptraidconf to it, but no devices show up (obviously lol)

rmmod the rr2680 2.1 module, layman -S to sync everything, and hit an emerge --ask rocketraid

Results:

!!! A file listed in the Manifest could not be found: /var/lib/layman/RocketRAID/sys-block/rr268x/files/rr268x-linux-src-v1.9-kernel-3.11.patch

dsiggi, am I missing something with your ebuild?

Anyone, any ideas about the IO_PAGE_FAULT?

*edit*  Nevermind, the IO_PAGE_FAULT is an IOMMU issue - disabling IOMMU in the bios + iommu=soft to the command line = perfectly working Highpoint 2680 v2.1 driver  :Very Happy: 

----------

## uberDoward

dsiggi, do you want me to re-test your ebuild?

Went ahead and dumped my work to github, if anyone cares:

https://github.com/uberDoward/rocketraid_2680

----------

## uberDoward

So side question - is there a way to include the source for this driver in the kernel so I can build a monolithic kernel with the rr2680 support built in?

----------

## Sperion

Would it be possible to add support for the RocketRaid 2340 card?

----------

## uberDoward

I'd be happy to try, but I don't have a card to test with.

Also, seeing these in dmesg:

```

[  159.351768] rr2680:Task file error, StatusReg=0x41, ErrReg=0x4, LBA[0-3]=0x0,LBA[4-7]=0x0.

[  159.351791] rr2680:Request(ffff880856939450) 8a-0-0-0 0-0-9-b8 || 59-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351795] rr2680:Request(ffff880856932220) 8a-0-0-0 0-0-9-b8 || 59-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351797] rr2680:Request(ffff880856936708) 8a-0-0-0 0-0-9-b8 || 58-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351800] rr2680:Request(ffff8808569396f0) 8a-0-0-0 0-0-9-b8 || 58-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351803] rr2680:Request(ffff880856933288) 8a-0-0-0 0-0-9-b8 || 57-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351806] rr2680:Request(ffff8808569395a0) 8a-0-0-0 0-0-9-b8 || 57-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351809] rr2680:Request(ffff880856936cf0) 8a-0-0-0 0-0-9-b8 || 56-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351811] rr2680:Request(ffff880856937620) 8a-0-0-0 0-0-9-b8 || 56-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351814] rr2680:Request(ffff880856932370) 8a-0-0-0 0-0-9-b8 || 55-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351817] rr2680:Request(ffff880856934638) 8a-0-0-0 0-0-9-b8 || 55-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351820] rr2680:Request(ffff880856937d58) 8a-0-0-0 0-0-9-b8 || 54-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351823] rr2680:Request(ffff880856932f40) 8a-0-0-0 0-0-9-b8 || 54-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351826] rr2680:Request(ffff880856931b90) 8a-0-0-0 0-0-9-b8 || 53-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351829] rr2680:Request(ffff880856932df0) 8a-0-0-0 0-0-9-b8 || 52-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351832] rr2680:Request(ffff880856935b38) 8a-0-0-0 0-0-9-b8 || 52-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351835] rr2680:Request(ffff8808569387d8) 8a-0-0-0 0-0-9-b8 || 51-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351837] rr2680:Request(ffff880856938340) 8a-0-0-0 0-0-9-b8 || 51-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351841] rr2680:Request(ffff880856931e30) 8a-0-0-0 0-0-9-b8 || 50-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351844] rr2680:Request(ffff88085693a2c0) 8a-0-0-0 0-0-9-b8 || 50-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351846] rr2680:Request(ffff880856932760) 8a-0-0-0 0-0-9-b8 || 4f-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351849] rr2680:Request(ffff8808569391b0) 8a-0-0-0 0-0-9-b8 || 4f-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351852] rr2680:Request(ffff8808569370e0) 8a-0-0-0 0-0-9-b8 || 4e-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351855] rr2680:Request(ffff880856932808) 8a-0-0-0 0-0-9-b8 || 4e-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351858] rr2680:Request(ffff880856938dc0) 8a-0-0-0 0-0-9-b8 || 4d-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351861] rr2680:Request(ffff8808569383e8) 8a-0-0-0 0-0-9-b8 || 4d-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351864] rr2680:Request(ffff8808569356a0) 8a-0-0-0 0-0-9-b8 || 4c-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351867] rr2680:Request(ffff880856939f78) 8a-0-0-0 0-0-9-b8 || 4c-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351870] rr2680:Request(ffff880856930150) 8a-0-0-0 0-0-9-b8 || 4b-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351873] rr2680:Request(ffff880856934050) 8a-0-0-0 0-0-9-b8 || 4b-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351876] rr2680:Request(ffff880856939798) 8a-0-0-0 0-0-9-b8 || 4a-b8-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.351879] rr2680:Request(ffff880856935898) 8a-0-0-0 0-0-9-b8 || 4a-38-0-0 0-80-0-0 to device S0/0 failed as status 6

[  159.792500] rr2680:Request(ffff880856932d48) 8a-0-0-0 0-0-9-b8 || 6e-38-0-0 0-80-0-0 to device S0/0 failed as status 21

```

Strange thing is, if I move the drive to the on-board SATA, I don't have these errors.  I'm trying to see what might be causing these issues.  Anyone know where I can find these status codes?  Searching the linux source code and HPT source code hasn't been fruitful thus far...

[Moderator edit: added [code] tags to preserve output layout. -Hu]

*edit*  Thanks, Hu!

Also, just for S&G I checked the hardware layout, and realized I had the ASMedia USB 3.1 card in the bottom PCIe slot, and the RocketRAID 2680SGL in the slot immediately above it.  Moved the RocketRAID card up to the 2nd PCIe slot, enabled x8/x8 mode in the BIOS, and am now running ~30% faster, and no more errors as above *knock on wood*  I thought we were beyond the days of having to specify which slots are 'stable' for what things, but I guess the more things change, the more they stay the same LOL

```

[   11.743874] md: bind<sdh1>

[   11.746828] md: bind<sdc1>

[   11.749700] md: bind<sdg1>

[   11.753627] md: bind<sdd1>

[   11.759417] md: bind<sda1>

[   11.782284] md: bind<sdb1>

[   11.789523] md/raid:md0: device sdb1 operational as raid disk 1

[   11.789527] md/raid:md0: device sda1 operational as raid disk 0

[   11.789530] md/raid:md0: device sdd1 operational as raid disk 3

[   11.789532] md/raid:md0: device sdc1 operational as raid disk 2

[   11.789534] md/raid:md0: device sdh1 operational as raid disk 4

[   11.790882] md/raid:md0: allocated 6442kB

[   11.791025] md/raid:md0: raid level 5 active with 5 out of 6 devices, algorithm 2

[   11.791027] RAID conf printout:

[   11.791029]  --- level:5 rd:6 wd:5

[   11.791032]  disk 0, o:1, dev:sda1

[   11.791035]  disk 1, o:1, dev:sdb1

[   11.791037]  disk 2, o:1, dev:sdc1

[   11.791039]  disk 3, o:1, dev:sdd1

[   11.791041]  disk 4, o:1, dev:sdh1

[   11.791043]  disk 5, o:1, dev:sdg1

[   11.791310] created bitmap (15 pages) for device md0

[   11.792289] md0: bitmap initialized from disk: read 1 pages, set 0 of 29805 bits

[   11.859217] md0: detected capacity change from 0 to 10000893214720

[   11.859262] RAID conf printout:

[   11.859268]  --- level:5 rd:6 wd:5

[   11.859272]  disk 0, o:1, dev:sda1

[   11.859275]  disk 1, o:1, dev:sdb1

[   11.859277]  disk 2, o:1, dev:sdc1

[   11.859279]  disk 3, o:1, dev:sdd1

[   11.859282]  disk 4, o:1, dev:sdh1

[   11.859284]  disk 5, o:1, dev:sdg1

[   11.859286] RAID conf printout:

[   11.859287]  --- level:5 rd:6 wd:5

[   11.859289]  disk 0, o:1, dev:sda1

[   11.859291]  disk 1, o:1, dev:sdb1

[   11.859293]  disk 2, o:1, dev:sdc1

[   11.859295]  disk 3, o:1, dev:sdd1

[   11.859297]  disk 4, o:1, dev:sdh1

[   11.859299]  disk 5, o:1, dev:sdg1

[   11.859514] md: recovery of RAID array md0

[   11.859519] md: minimum _guaranteed_  speed: 1000 KB/sec/disk.

[   11.859521] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for recovery.

[   11.859570] md: using 128k window, over a total of 1953299456k.

[   11.859572] md: resuming recovery of md0 from checkpoint.

[   12.089115] EXT4-fs (sde4): re-mounted. Opts: (null)

[   12.280940] Adding 2097148k swap on /dev/sde3.  Priority:-1 extents:1 across:2097148k SSFS

[   12.371426] EXT4-fs (sde2): mounting ext2 file system using the ext4 subsystem

[   12.376300] EXT4-fs (sde2): mounted filesystem without journal. Opts: (null)

[   16.031693] IPv6: ADDRCONF(NETDEV_UP): enp5s0f0: link is not ready

[   17.876407] igb 0000:05:00.0 enp5s0f0: igb: enp5s0f0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX

[   17.876724] IPv6: ADDRCONF(NETDEV_CHANGE): enp5s0f0: link becomes ready
```

Lookin' much better now...

```
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] 

md0 : active raid5 sdb1[1] sda1[0] sdd1[3] sdg1[6] sdc1[2] sdh1[4]

      9766497280 blocks super 1.2 level 5, 512k chunk, algorithm 2 [6/5] [UUUUU_]

      [====>................]  recovery = 24.4% (477049340/1953299456) finish=185.8min speed=132382K/sec

      bitmap: 0/15 pages [0KB], 65536KB chunk

unused devices: <none>
```

I'll let the rebuild run overnight, and see in the morning what the outcome was  :Smile: 

*edit2* Can I not have more than one [code] block?

[Moderator edit: fixed non-functional [code] tags added by OP after my first edit.

To answer your question: you can have multiple code blocks, but the forum is picky about nesting.  Since you added your blocks below my prior comment, and my comment had an open code block and no close code block, the tags were unbalanced beginning at my first blue line and continuing throughout the post.  That imbalance broke the parser.  I modified my initial comment to restore balance, so now your tags work.  You could also have made them work by moving them above my first blue line.

-Hu]

----------

## uberDoward

Been a few days - zero issues here  :Smile: 

dsiggi, are you interested in patching the drivers from 1.9 to 2.1?

----------

