Coder Social home page Coder Social logo

Comments (11)

CozmoNate avatar CozmoNate commented on July 18, 2024

This gpio stuff I think better to keep as is...

from hwsensors.

RehabMan avatar RehabMan commented on July 18, 2024

I wonder whether it is the condition is evaluated as true or false. Statistically, there is a 1/4 chance *ver is less than 0x40, and 3/4 chance that *ver is >= 0x40. Of course, most stack garbage tends to depend on what was there on the stack before, so the value might be fixed and not random (although could change with each build, depending on how the compiler wants to allocate space on the stack).

from hwsensors.

CozmoNate avatar CozmoNate commented on July 18, 2024

*ver is set in one of previous calls.

from hwsensors.

CozmoNate avatar CozmoNate commented on July 18, 2024

The issue could happen only if using dcb_xpio_table that doesn't set "ver"

So... I really don't know when it happens and what the logic of nouveau developer was in this case..

from hwsensors.

RehabMan avatar RehabMan commented on July 18, 2024

Maybe I'm missing something, but dcb_xpio_table is called after dcb_gpio_parse, so *ver is definitely uninitialized always.

from hwsensors.

CozmoNate avatar CozmoNate commented on July 18, 2024

Yes, it's difficult to investigate

static u16 dcb_gpio_entry(struct nouveau_device device, int idx, int ent, u8 *ver, u8 *len)
{
u8 hdr, cnt, xver; /
use gpio version for xpio entry parsing */
u16 gpio;

if (!idx--)
    gpio = dcb_gpio_table(device, ver, &hdr, &cnt, len);
else
    gpio = dcb_xpio_table(device, idx, &xver, &hdr, &cnt, len);

if (gpio && ent < cnt)
    return gpio + hdr + (ent * *len);
return 0x0000;

}

we entering dcb_xpio_table only if if (!idx--) == False, but in GeForceSensors idx is always 0, so we get True and entering dcb_gpio_table and setting "ver" to something.

from hwsensors.

CozmoNate avatar CozmoNate commented on July 18, 2024

Look for gpio_find in code. Second parameter is idx.

from hwsensors.

RehabMan avatar RehabMan commented on July 18, 2024

Yes, now I see. Thanks. It is "maybe" initialized in dcb_gpio_entry (via call to dcb_gpio_table). Who knows what the intention was here.

from hwsensors.

CozmoNate avatar CozmoNate commented on July 18, 2024

Yes. I even don't try to understand all this gpio calls... It may be a full of bugs but seems to work fine in most cases with older GPUs (not Kepler ones)

from hwsensors.

RehabMan avatar RehabMan commented on July 18, 2024

This can be closed if ok with you...

from hwsensors.

CozmoNate avatar CozmoNate commented on July 18, 2024

Not a big deal will reopen it if it will be some news.

from hwsensors.

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.