OSDN Git Service

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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:21:07 +0000 (09:21 +0100)
commit2269278085f7c505b70d7ca6a2118ad45b966cd7
tree672b6e89a279ccb2382162128cc1732c0d411fd5
parent7d9566fb14f0e24d6472c425fd1d64746a257287
sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe

[ 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>
drivers/net/ethernet/sfc/ef10.c