Open clumsy-stefan opened 1 year ago
The dkms module seems to still work fine for me on 6.0 - you just need to manually create a symlink in kernel/
and then run patch.sh 6.0
Thanks for reply...
When I run the patch I get the attached output, see the last few lines. hpsa_cmd.h
can't be succesfully patched.
# ./patch.sh 6.0
Patching for kernel 6.0
--2022-12-07 07:42:46-- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/scsi/hpsa.h?h=linux-6.0.y
Auflösen des Hostnamens git.kernel.org (git.kernel.org)… 145.40.68.75, 2604:1380:4601:e00::1
Verbindungsaufbau zu git.kernel.org (git.kernel.org)|145.40.68.75|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 20426 (20K) [text/plain]
Wird in »hpsa.h« gespeichert.
hpsa.h 100%[=============================================================================================================================>] 19.95K --.-KB/s in 0.02s
2022-12-07 07:42:47 (1.13 MB/s) - »hpsa.h« gespeichert [20426/20426]
--2022-12-07 07:42:47-- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/scsi/hpsa.c?h=linux-6.0.y
Auflösen des Hostnamens git.kernel.org (git.kernel.org)… 145.40.68.75, 2604:1380:4601:e00::1
Verbindungsaufbau zu git.kernel.org (git.kernel.org)|145.40.68.75|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 280269 (274K) [text/plain]
Wird in »hpsa.c« gespeichert.
hpsa.c 100%[=============================================================================================================================>] 273.70K --.-KB/s in 0.07s
2022-12-07 07:42:47 (3.74 MB/s) - »hpsa.c« gespeichert [280269/280269]
--2022-12-07 07:42:47-- https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/scsi/hpsa_cmd.h?h=linux-6.0.y
Auflösen des Hostnamens git.kernel.org (git.kernel.org)… 145.40.68.75, 2604:1380:4601:e00::1
Verbindungsaufbau zu git.kernel.org (git.kernel.org)|145.40.68.75|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 29622 (29K) [text/plain]
Wird in »hpsa_cmd.h« gespeichert.
hpsa_cmd.h 100%[=============================================================================================================================>] 28.93K --.-KB/s in 0.02s
2022-12-07 07:42:47 (1.61 MB/s) - »hpsa_cmd.h« gespeichert [29622/29622]
Applying ../../kernel/6.0-patchset-v2/0001-scsi-hpsa-Add-function-to-check-if-device-is-a-disk-.patch
patching file hpsa.c
Hunk #1 succeeded at 775 (offset 10 lines).
Hunk #2 succeeded at 800 (offset 10 lines).
Hunk #3 succeeded at 867 (offset 10 lines).
Hunk #4 succeeded at 1731 (offset 17 lines).
Hunk #5 succeeded at 1784 (offset 16 lines).
Hunk #6 succeeded at 3994 (offset 26 lines).
Applying ../../kernel/6.0-patchset-v2/0002-scsi-hpsa-Support-HBA-mode-on-HP-Smart-Array-P410i-c.patch
patching file hpsa.c
Hunk #2 succeeded at 3087 (offset 18 lines).
Hunk #3 succeeded at 4366 (offset 33 lines).
Hunk #4 succeeded at 4464 (offset 31 lines).
Hunk #5 succeeded at 4554 (offset 31 lines).
patching file hpsa.h
Hunk #1 succeeded at 161 (offset 1 line).
Hunk #2 succeeded at 188 (offset 1 line).
Applying ../../kernel/6.0-patchset-v2/0003-scsi-hpsa-Add-mask-existing-devices-on-rescan-if-vis.patch
patching file hpsa.c
Hunk #1 succeeded at 1553 (offset 17 lines).
Hunk #2 succeeded at 1587 (offset 17 lines).
Applying ../../kernel/6.0-patchset-v2/0004-scsi-hpsa-Ignore-HBA-flag-from-NVRAM-if-logical-devi.patch
patching file hpsa.c
Hunk #1 succeeded at 4398 (offset 33 lines).
Hunk #2 succeeded at 4413 (offset 33 lines).
Hunk #3 succeeded at 4478 (offset 31 lines).
Applying ../../kernel/6.0-patchset-v2/0005-scsi-hpsa-Name-more-fields-in-struct-bmic_identify_c.patch
patching file hpsa_cmd.h
Hunk #1 FAILED at 696.
1 out of 1 hunk FAILED -- saving rejects to file hpsa_cmd.h.rej
Here are the contents... unfortunately I'm not on a level to really interpret or fix this..
--- hpsa_cmd.h
+++ hpsa_cmd.h
@@ -696,11 +696,114 @@ struct hpsa_pci_info {
struct bmic_identify_controller {
u8 configured_logical_drive_count; /* offset 0 */
- u8 pad1[153];
+ __le32 signature;
+ char running_firm_rev[4];
+ char rom_firm_rev[4];
+ u8 hardware_rev;
+ u8 reserved_1[4];
+ __le32 drive_present_bit_map;
+ __le32 external_drive_bit_map;
+ __le32 board_id;
+ u8 reserved_2;
+ __le32 non_disk_map;
+ u8 reserved_3[5];
+ u8 marketing_revision;
+ u8 controller_flags;
+ u8 host_flags;
+ u8 expand_disable_code;
+ u8 scsi_chip_count;
+ u8 reserved_4[4];
+ __le32 ctlr_clock;
+ u8 drives_per_scsi_bus;
+ __le16 big_drive_present_map[8];
+ __le16 big_ext_drive_map[8];
+ __le16 big_non_disk_map[8];
+
+ /* used for FW debugging */
+ __le16 task_flags;
+ /* Bitmap used for ICL between controllers */
+ u8 icl_bus_map;
+ /* See REDUNDANT MODE VALUES */
+ u8 redund_ctlr_modes_support;
+ /* See REDUNDANT MODE VALUES */
+ u8 curr_redund_ctlr_mode;
+ /* See REDUNDANT STATUS FLAG */
+ u8 redund_ctlr_status;
+ /* See REDUNDANT FAILURE VALUES */
+ u8 redund_op_failure_code;
+ u8 unsupported_nile_bus;
+ u8 host_i2c_autorev;
+ u8 cpld_revision;
+ u8 fibre_chip_count;
+ u8 daughterboard_type;
+ u8 reserved_5[2];
+
+ u8 access_module_status;
+ u8 features_supported[12];
+ /* Recovery ROM inactive f/w revision */
+ char rec_rom_inactive_rev[4];
+ /* Recovery ROM flags */
+ u8 rec_rom_flags;
+ u8 pci_to_pci_bridge_status;
+ /* Reserved for future use */
+ u8 reserved_6[4];
+ /* Percent of memory allocated to write cache */
+ u8 percent_write_cache;
+ /* Total cache board size */
+ __le16 daughter_board_cache_size;
+ /* Number of cache batteries */
+ u8 cache_battery_count;
+ /* Total size (MB) of atttached memory */
+ __le16 total_memory_size;
+ /* Additional controller flags byte */
+ u8 more_controller_flags;
+ /* 2nd byte of 3 byte autorev field */
+ u8 x_board_host_i2c_autorev;
+ /* BBWC PIC revision */
+ u8 battery_pic_rev;
+ /* DDFF update engine version */
+ u8 ddff_version[4];
+ /* Maximum logical units supported */
+ __le16 max_logical_units;
+ /* Big num configured logical units */
__le16 extended_logical_unit_count; /* offset 154 */
- u8 pad2[136];
+ /* Maximum physical devices supported */
+ __le16 max_physical_devices;
+ /* Max physical drive per logical unit */
+ __le16 max_phy_drv_per_logical_unit;
+ /* Number of attached enclosures */
+ u8 enclosure_count;
+ /* Number of expanders detected */
+ u8 expander_count;
+ /* Offset to extended drive present map*/
+ __le16 offset_to_edp_bitmap;
+ /* Offset to extended external drive present map */
+ __le16 offset_to_eedp_bitmap;
+ /* Offset to extended non-disk map */
+ __le16 offset_to_end_bitmap;
+ /* Internal port status bytes */
+ u8 internal_port_status[8];
+ /* External port status bytes */
+ u8 external_port_status[8];
+ /* Yet More Controller flags */
+ __le32 yet_more_controller_flags;
+ /* Last lockup code */
+ u8 last_lockup;
+ /* PCI slot according to option ROM*/
+ u8 pci_slot;
+ /* Build number */
+ __le16 build_num;
+ /* Maximum safe full stripe size */
+ __le32 max_safe_full_stripe_size;
+ /* Total structure length */
+ __le32 total_length;
+ /* Vendor ID */
+ char vendor_id[8];
+ /* Product ID */
+ char product_id[16];
+ u8 reserved_7[68];
u8 controller_mode; /* offset 292 */
- u8 pad3[32];
+ u8 reserved_8[32];
};
I did a quick test, the hpsa driver from kernel version 5.18 with the matching patch from here works in kernel 6.0. However it's obviously not the newest hpsa driver available (it seems it had been updated for 6.0)...
So an update for hpsa 6.0 driver would still be appreciated!
Any news on this?
Kernel is already at 6.2. The old 5.18 Version still works, but it seemy there were corrections/additions (hopefully improvments) in the new hpsahba kernel driver, so it would be great to have an updated version! Thanks in advance!
The only issue which prevents patching is that
struct bmic_identify_controller {
....
} __packed
ends with that "packed". Apparently, this is a hint for the compiler which makes it skip padding of the structure in memory such that it aligns nicely with multiples of whatever the CPU can access at once. If you remove the `packed` and then attempt to patch, it will succeed. I'm not particularly sure if this addition hurts anything, as I've just figured this out myself. I will report here once I have it up and running. If I forget, please ping me
EDIT: You can find this file at KRNSRC/drivers/scsi/hpsa_cmd.h EDIT: You also need to replace PCI_DMA_FROMDEVICE with DMA_FROM_DEVICE in the patches before applying EDIT: It built successfully using DKMS on Arch Linux with kernel 6.3.5
SUCCESS:
root@archiso ~/hpsahba/contrib/dkms (git)-[master] # insmod hpsa.ko hpsa_use_nvram_hba_flag=1
root@archiso ~/hpsahba/contrib/dkms (git)-[master] # lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 672M 1 loop /run/archiso/airootfs
sda 8:0 0 279.4G 0 disk
└─sda1 8:1 0 279.4G 0 part
sdb 8:16 1 3.8G 0 disk
├─sdb1 8:17 1 3.7G 0 part
└─sdb2 8:18 1 31.5K 0 part
sdc 8:32 0 279.4G 0 disk
└─sdc1 8:33 0 279.4G 0 part
sr0 11:0 1 790.3M 0 rom /run/archiso/bootmnt
root@archiso ~/hpsahba/contrib/dkms (git)-[master] # uname -a
Linux archiso 6.3.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 30 May 2023 13:44:01 +0000 x86_64 GNU/Linux
root@archiso ~/hpsahba/contrib/dkms (git)-[master] #
Hi, thanks for invetigating.
I just tried it with 6.3.6 and this time patching worked without changing anything in the patch file (I think) at leat I got no errors?!
Still trying to find out though if it successfully patched or just did nothing at all...
EDIT: it seems that from 6.0 to 6.1 the drivers changed again so that the original patch files work again... so the problem probably only exists in 6.0
I can also confirm, that the patch works for 6.3.7 without modification. In my environment only 6.0 seems to be an issue at all... thanks again for investigating!!
Just tested kernel 6.1 with the 5.18 patches and it works ok :)
Got it working on kernel 6.5.0 too.
Worked on proxmox kernel 6.8.4 using 5.18 patches
First thanks for the work provided. Runs very well in a HP ProLiant DL360 G7 with disks in HBA mode.
Any chance the code get updated to work with Linux Driver 6.0. It seems that
hpsa_cmd.h
has changed such that the patch is not working anymore for this file.thanks!!