Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udisks_drive_get_size returns 0 for drive connected to Qualcomm PCIe controller #1280

Closed
TuxThePenguin0 opened this issue May 14, 2024 · 1 comment

Comments

@TuxThePenguin0
Copy link

TuxThePenguin0 commented May 14, 2024

When a drive is inserted into the M.2 slot of my laptop, udisks_drive_get_size always returns 0 instead of the actual capacity, udisksctl info seems to report the correct value. Multiple drives have been tested to have this issue when inserted into the M.2 slot of this laptop, the same drives don't have the issue when put in a USB enclosure.

Disk size also seems to be reported correctly in sysfs and I haven't found any other similar issues.

The issue only seems to be cosmetic, it results in software like gnome-disks reporting the size as a blank value or gnome-control-center showing "Unknown" for the disk capacity but they appear to work as expected otherwise.

The laptop is a Lenovo Thinkpad X13s using a Qualcomm Snapdragon 8cx gen 3 SOC.

Relevant lshw output
     *-pci:0
          description: PCI bridge
          product: SC8280XP PCI Express Root Port
          vendor: Qualcomm Technologies, Inc
          physical id: 100
          bus info: pci@0002:00:00.0
          version: 00
          width: 32 bits
          clock: 33MHz
          capabilities: pci normal_decode bus_master cap_list
          configuration: driver=pcieport
          resources: irq:213 memory:3c400000-3c400fff memory:3c300000-3c3fffff
        *-nvme
             description: NVMe device
             product: PNY CS2142 1TB SSD
             vendor: Phison Electronics Corporation
             physical id: 0
             bus info: pci@0002:01:00.0
             logical name: /dev/nvme0
             version: CS214C10
             serial: PNY4323002D5
             width: 64 bits
             clock: 33MHz
             capabilities: nvme nvm_express bus_master cap_list
             configuration: driver=nvme latency=0 nqn=nqn.2020-11.com.phison:nvme:PS5021:PNY4323002D5 state=live
             resources: irq:212 memory:3c300000-3c303fff
           *-namespace:0
                description: NVMe disk
                physical id: 0
                logical name: hwmon15
           *-namespace:1
                description: NVMe disk
                physical id: 2
                logical name: /dev/ng0n1
           *-namespace:2
                description: NVMe disk
                physical id: 1
                bus info: nvme@0:1
                logical name: /dev/nvme0n1
                configuration: wwid=eui.6479a784da30608f
udisksctl info output of a drive in the M.2 slot
/org/freedesktop/UDisks2/block_devices/nvme0n1:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/nvme0n1
    DeviceNumber:               66304
    Drive:                      '/org/freedesktop/UDisks2/drives/PNY_CS2142_1TB_SSD_PNY4323002D5'
    HintAuto:                   false
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          true
    HintSymbolicIconName:       
    HintSystem:                 true
    Id:                         by-id-nvme-PNY_CS2142_1TB_SSD_PNY4323002D5
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/nvme0n1
    ReadOnly:                   false
    Size:                       1024209543168
    Symlinks:                   /dev/disk/by-diskseq/1
                                /dev/disk/by-id/nvme-PNY_CS2142_1TB_SSD_PNY4323002D5
                                /dev/disk/by-id/nvme-PNY_CS2142_1TB_SSD_PNY4323002D5_1
                                /dev/disk/by-id/nvme-eui.6479a784da30608f
                                /dev/disk/by-path/platform-1c20000.pcie-pci-0002:01:00.0-nvme-1
    UserspaceMountOptions:      
  org.freedesktop.UDisks2.NVMe.Namespace:
    EUI64:                      6479a784da30608f
    FormatPercentRemaining:     -1
    FormattedLBASize:           (4096, 0, 0x01)
    LBAFormats:                 [(512, 0, 0x02), (4096, 0, 0x01)]
    NGUID:                      
    NSID:                       1
    NamespaceCapacity:          250051158
    NamespaceSize:              250051158
    NamespaceUtilization:       250051158
    UUID:                       
    WWN:                        eui.6479a784da30608f
  org.freedesktop.UDisks2.PartitionTable:
    Partitions:         /org/freedesktop/UDisks2/block_devices/nvme0n1p2
                        /org/freedesktop/UDisks2/block_devices/nvme0n1p3
                        /org/freedesktop/UDisks2/block_devices/nvme0n1p1
    Type:               gpt
@TuxThePenguin0
Copy link
Author

Ah nevermind, it seems like by pure coincidence all the drives I tried with this laptop were affected by #1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant