Re: [PATCH 0/6] memory: tegra114-emc: Fix bus width and pad auto-calibration

From: Patrick Fischer

Date: Sun Nov 22 2026 - 05:31:25 EST


Am 20.11.26 um 14:46 schrieb Krzysztof Kozlowski:
>> On a Tegra Note 7 (Tegra114, P1640) I had kernel panics, bit errors and
>> WLAN firmware hangs under load, and two kernel panics on EMC rate
>> changes from pll_p to 624 MHz on pll_c. Looking at the EMC I
>> found three problems in the Tegra114 EMC driver:
>>
>> 1. EMC_AUTO_CAL_CONFIG is masked down to the self-clearing start bit
>> before it is written, which clears AUTO_CAL_ENABLE on the first rate
>> change. The bootloader leaves calibration enabled, with channel 0 as
>> master and channel 1 as slave. Patch 1 stops clearing the register.
>> Programming the table values needs the channel registers, which
>> patches 4 to 6 describe and use.
>> 2. emc_icc_set() assumes a 32-bit DRAM bus, but Tegra114 has two 32-bit
>> channels. Every interconnect request asks for twice the EMC rate, so
>> actmon at 312 MHz moves the EMC to 624 MHz (patch 2).
>> 3. Pad auto-calibration is disabled for every clock change, but the
>> interval is only restored if EMC_CTT_TERM_CTRL changes, so it stays
>> off after the first change (patch 3).
>>
>> Patches 1 to 3 are small, do not depend on the device tree change and
>> are marked for stable. Patch 1 comes first on purpose: patch 2 and the
>> clk patch mentioned below make the EMC run at a real 624 MHz on pll_c
>> more often, and both panics I saw on a change to that rate were with
>> the calibration cleared. Patches 4 to 6 are not marked: they need the
>> binding and the device tree. Patches 1 to 5 are for the memory
>> controller tree, patch 6 for the Tegra tree. The driver has been there
>> since v7.2, but the first in-tree Tegra114 device tree with EMC timings
>> (TF701T) came with v7.4-rc1, so the stable tags matter for v7.4 and for
>> out-of-tree device trees.
>
> A bit confusing. This clearly suggests dependency on DTS, thus ABI
> break, but code does not look like that.
>
> Best regards,
> Krzysztof
>

Sorry, my wording was unclear. There is no ABI break: with an older
device tree that only has the broadcast reg entry, the driver probes
as before and leaves EMC_AUTO_CAL_CONFIG as the bootloader set it up,
which is what patch 1 is about. Only programming the per-channel
calibration values from the timing tables needs the two channel reg
entries added in patch 6, and the binding accepts either one or three
entries.

Thanks for applying patches 1-5,
Patrick