Code Monkey home page Code Monkey logo

Comments (4)

keithbusch avatar keithbusch commented on September 25, 2024

Is this PPC little or big endian?

from nvme-cli.

keithbusch avatar keithbusch commented on September 25, 2024

I assume big since i don't see any problems on little endian machines, and the code looks wrong for big endian anyway. Could you try a patch to confirm? I might just push this anyway, but want to be sure if fixes the issue.

---
diff --git a/nvme-ioctl.c b/nvme-ioctl.c
index 2a26ca2..c0d659b 100644
--- a/nvme-ioctl.c
+++ b/nvme-ioctl.c
@@ -363,10 +363,8 @@ int nvme_get_log(int fd, __u32 nsid, __u8 log_id, __u32 data_len, void *data)
        .data_len   = data_len,
    };
    __u32 numd = (data_len >> 2) - 1;
-   __le16 numdu, numdl;
+   __u16 numdu = numd >> 16, numdl = numd & 0xffff;

-   numdu = htole16((numd & 0xFFFF0000) >> 16);
-   numdl = htole16(numd & 0x0000FFFF);
    cmd.cdw10 = log_id | (numdl << 16);
    cmd.cdw11 = numdu;
 --

from nvme-cli.

garygeike avatar garygeike commented on September 25, 2024

I would be happy to try a patch

I added the following to the nvme_get_log function
__u16 numdu = numd >> 16, numdl = numd & 0xffff;
And commented out these lines.

__le16 numdu, numdl;

numdu = htole16((numd & 0xFFFF0000) >> 16);

numdl = htole16(numd & 0x0000FFFF);

recompiled and now fw-log works … Thank you!

Thank you
Gary

From: Keith Busch [mailto:[email protected]]
Sent: Friday, August 5, 2016 3:55 PM
To: linux-nvme/nvme-cli [email protected]
Cc: Gary Geike [email protected]; Author [email protected]
Subject: Re: [linux-nvme/nvme-cli] nvme fw-log not working in version 0.8 - INVALID_FIELD(4002) (#104)

I assume big since i don't see any problems on little endian machines, and the code looks wrong for big endian anyway. Could you try a patch to confirm? I might just push this anyway, but want to be sure if fixes the issue.


diff --git a/nvme-ioctl.c b/nvme-ioctl.c

index 2a26ca2..c0d659b 100644

--- a/nvme-ioctl.c

+++ b/nvme-ioctl.c

@@ -363,10 +363,8 @@ int nvme_get_log(int fd, __u32 nsid, __u8 log_id, __u32 data_len, void *data)

    .data_len   = data_len,

};

__u32 numd = (data_len >> 2) - 1;
  • __le16 numdu, numdl;
  • __u16 numdu = numd >> 16, numdl = numd & 0xffff;
  • numdu = htole16((numd & 0xFFFF0000) >> 16);
  • numdl = htole16(numd & 0x0000FFFF);

cmd.cdw10 = log_id | (numdl << 16);

cmd.cdw11 = numdu;


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/104#issuecomment-237963753, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALHCSlWiNofw9HIwhl1x3d6vB4HtLJvBks5qc6MlgaJpZM4JeAs-.
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.

from nvme-cli.

keithbusch avatar keithbusch commented on September 25, 2024

Thanks, fixed pushed here:

1276f05

from nvme-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.