[Nouveau] [PATCH v2] gr: fallback to legacy paths during firmware lookup

Alexandre Courbot gnurou at gmail.com
Sun Nov 6 09:02:58 UTC 2016


On Sun, Nov 6, 2016 at 12:12 AM, Peter Wu <peter at lekensteyn.nl> wrote:
> On Fri, Nov 04, 2016 at 06:36:17PM +0900, Alexandre Courbot wrote:
>> Look for firmware files using the legacy ("nouveau/nvxx_fucxxxx") path
>> if they cannot be found in the new, "official" path. User setups were
>> broken by the switch, which is bad.
>>
>> There are only 4 firmware files we may want to look up that way, so
>> hardcode them into the lookup function. All new firmware files should
>> use the standard "nvidia/<chip>/gr/" path.
>>
>> Fixes: 8539b37acef7 ("drm/nouveau/gr: use NVIDIA-provided external firmwares")
>> Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
>> ---
>> Changes since v1:
>> * Moved file name translation into the legacy function
>>
>>  drm/nouveau/nvkm/engine/gr/gf100.c | 53 +++++++++++++++++++++++++++++++++++---
>>  1 file changed, 49 insertions(+), 4 deletions(-)
>>
>> diff --git a/drm/nouveau/nvkm/engine/gr/gf100.c b/drm/nouveau/nvkm/engine/gr/gf100.c
>> index eccdee04107d..ed45f923442f 100644
>> --- a/drm/nouveau/nvkm/engine/gr/gf100.c
>> +++ b/drm/nouveau/nvkm/engine/gr/gf100.c
>> @@ -1756,6 +1756,53 @@ gf100_gr_ = {
>>  };
>>
>>  int
>> +gf100_gr_ctor_fw_legacy(struct gf100_gr *gr, const char *fwname,
>> +                     struct gf100_gr_fuc *fuc, int ret)
>> +{
>> +     struct nvkm_subdev *subdev = &gr->base.engine.subdev;
>> +     struct nvkm_device *device = subdev->device;
>> +     const struct firmware *fw;
>> +     char f[32];
>> +
>> +     /* see if this firmware has a legacy path */
>> +     if (!strcmp(fwname, "fecs_inst"))
>> +             fwname = "fuc409c";
>> +     else if (!strcmp(fwname, "fecs_data"))
>> +             fwname = "fuc409d";
>> +     else if (!strcmp(fwname, "gpccs_inst"))
>> +             fwname = "fuc41ac";
>> +     else if (!strcmp(fwname, "gpccs_data"))
>> +             fwname = "fuc41ad";
>> +     else
>> +             fwname = NULL;
>> +
>> +     /* nope, let's just return the error we got */
>> +     if (!fwname) {
>> +             nvkm_error(subdev, "failed to load %s\n", fwname);
>
> Due to the rename from legacy_fwname -> fwname, this can be NULL.
> What about replacing the else branch above by this block?

Ah, stupid me - I wanted to save a variable and here is the result.
Thanks for catching this, I will send a fixup patch to Ben.


More information about the Nouveau mailing list