Opened 2 years ago

Closed 2 years ago

#1594 closed enhancement (fixed)

Enhance LBA range for jmb39x and jms56x device types

Reported by: Alois Owned by: Christian Franke
Priority: minor Milestone: Release 7.4
Component: all Version: 7.3
Keywords: jmicron jmb39x jms56x Cc:

Description

Hello,

I recently bought jmicron controllers to put away some duplication load (for mdraid level 1) from the system to those controllers.
I have one jmb56x and two jmb39x attached, smart readings work well besides one thing which makes me stomachache: I need to force on one of them for a sector as its boot record is stored there.

with "hdparm --read-sector" I searched for a free one on this device and could not find one in the range of 33 <= LBA <= 62

Is there a specific reason why it is limited to this range? My partiton tables start at 2048, so there would be much sectors before which are free (and zero-filled).
I tried with jmraidcon implementation, as I do not know how to e.g. mask 2047 in the command {READ_CMD, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x01, 0x00};
I just swapped 0x21 with 0xfe - LBA sector 254 which is also zero-filled on this device and it succeeds as well with this, so I assume the limited range is not caused by the JMicron controller not accepting the commands there?

I read all sectors until 2048 and from sector 105 starting they are all zero-filled (attached the txt of the affected drive). I would prefer to avoid always overwriting and restoring parts of my bootrecord, but as I am not sure why the limit is currently implemented this way, I would like to clarify this first. :-)

Thank you so much!

Best regards
Alois

Attachments (1)

sectors.zip (86.9 KB ) - added by Alois 2 years ago.

Download all attachments as: .zip

Change History (5)

by Alois, 2 years ago

Attachment: sectors.zip added

comment:1 by Christian Franke, 2 years ago

Keywords: jmicron jmb39x jms56x added
Milestone: undecided
Summary: question regarding LBA restrictions in dev_jmb39x_raid.cppEnhance LBA range for jmb39x and jms56x device types
Type: taskenhancement
Version: 7.3

The current code is limited to 8-bit LBA, so we could enhance the LBA range to 1-255 if this would help.

Please test this patch if possible:

  • dev_jmb39x_raid.cpp

     
    729729    force = true;
    730730    n1 += n2;
    731731  }
    732   if (!(n1 == len && port <= 4 && 33 <= lba && lba <= 62)) {
    733     set_err(EINVAL, "Option -d %s,N[,sLBA][,force] must have 0 <= N <= 4 [, 33 <= LBA <= 62]", prefix);
     732  if (!(n1 == len && port <= 4 && 1 <= lba && lba <= 255)) {
     733    set_err(EINVAL, "Option -d %s,N[,sLBA][,force] must have 0 <= N <= 4 [, 1 <= LBA <= 255]", prefix);
    734734    return 0;
    735735  }

comment:2 by Alois, 2 years ago

Hello Christian,

thanks - the patch works flawless and helps, I can use now a free sector :-)

compiled and tested on debian bullseye x64:
smartctl pre-7.4 2022-04-24 r5362 [x86_64-linux-5.10.0-13-amd64] (local build)

with controller type jms56x and jmb39x
and various sectors between 1 and 255

thank you!

Best regards
Alois

Last edited 2 years ago by Alois (previous) (diff)

comment:3 by Christian Franke, 2 years ago

Milestone: undecidedRelease 7.4
Owner: set to Christian Franke
Status: newaccepted

Thanks for quick testing. Patch will be applied soon.

comment:4 by Christian Franke, 2 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.