]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe
authorEdward Cree <ecree@solarflare.com>
Tue, 22 Jan 2019 19:02:17 +0000 (19:02 +0000)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:39 +0000 (14:21 -0300)
commitd09acaed13740bcc053eeb6bdd9ad4613b23ef29
tree94282542c25a787c9568402a788d2cb6ad8db20b
parent405229a003c633677584f6b6ac163084e5c1582a
sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe

BugLink: https://bugs.launchpad.net/bugs/1855787
[ Upstream commit 3366463513f544c12c6b88c13da4462ee9e7a1a1 ]

Use a bitmap to keep track of which partition types we've already seen;
 for duplicates, return -EEXIST from efx_ef10_mtd_probe_partition() and
 thus skip adding that partition.
Duplicate partitions occur because of the A/B backup scheme used by newer
 sfc NICs.  Prior to this patch they cause sysfs_warn_dup errors because
 they have the same name, causing us not to expose any MTDs at all.

Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/sfc/ef10.c