You have been subscribed to a public bug:

### Summary

A recent stable-update pulled two v7.1 FF-A commits into the linux-nvidia 7.0
branches, but not the third commit in the chain. The result is that FF-A
fails to initialise on 64K page kernels whose firmware rejects a 64K RX/TX
buffer, taking every FF-A device with it. This backports the missing fix.

### The regression

Stable-updates applied these two, both of which first shipped
upstream in **v7.1**:

| Backport | Upstream | BugLink |
|---|---|---|
| `7bfaed6b412b` firmware: arm_ffa: Use the correct buffer size during RXTX_MAP 
| `83210251fd70` | LP #2156385 |
| `105dac1d2c92` firmware: arm_ffa: Align RxTx buffer size before mapping | 
`0399e3f872ca` | LP #2156390 |

The first makes the driver advertise `PAGE_ALIGN(rxtx_bufsz)` to firmware; the
second is its follow-up fix. Both landed in `Ubuntu-nvidia-bos-7.0.0-2016.16`,
the most recent tag on this branch. Earlier tags are not affected.

The third commit in the chain, which fixes the fallout from the first, only
landed upstream in **v7.2-rc4**:

    53716a4d745f  firmware: arm_ffa: Respect firmware advertised RX/TX
buffer size limits

### Symptom

On a 64K page kernel the driver takes the firmware advertised minimum RX/TX
buffer size, rounds it up to `PAGE_SIZE`, and asks firmware to map that. FF-A
implementations before v1.2 advertise no maximum and may simply reject the
rounded up size. There is no clamp and no retry, so probe fails:

    ARM FF-A: Driver version 1.2
    ARM FF-A: Firmware version 1.1 found
    ARM FF-A: failed to register FFA RxTx buffers

and no FF-A devices are registered at all. Anything sitting on FF-A goes with
it, including TPM over FF-A.

Trigger is `PAGE_SIZE` greater than the advertised minimum, so the 64K
flavours. Platforms with FF-A v1.2 or later firmware are unaffected, since the
advertised maximum is then respected.

### The fix

Backport of `53716a4d745f`. It decodes the maximum buffer size that
FF-A v1.2+ reports, clamps the page aligned minimum to it, and where no maximum
is advertised retries `RXTX_MAP` at the advertised minimum if the rounded size
is rejected with `INVALID_PARAMETERS`.

### Testing

Tested on an Arm server reporting FF-A firmware version 1.1, running a 64K page
kernel built from this branch's own `nvidia-bos-64k` flavour annotations.

Before, on the unmodified branch tip:

    ARM FF-A: failed to register FFA RxTx buffers
    /sys/bus/arm_ffa/devices/   ->  empty

After, with this commit applied:

    ARM FF-A: Firmware version 1.1 found
    ARM FF-A: Failed to create IRQ mapping!
    /sys/bus/arm_ffa/devices/   ->  arm-ffa-1 .. arm-ffa-5

All five partitions enumerate again. The remaining "Failed to create IRQ
mapping" line is pre-existing and also present on the distro kernel that
predates the regression. No new BUG, WARNING or call traces.

** Affects: ubuntu
     Importance: Undecided
         Status: New

-- 
Backport: "firmware: arm_ffa: Respect firmware advertised RX/TX buffer size 
limits"
https://bugs.launchpad.net/bugs/2162012
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to