Skip to content

Commit e43afae

Browse files
committed
Merge tag 'powerpc-6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Fix wireguard loading failure on pre-Power10 due to Power10 crypto routines - Fix papr-vpd selftest failure due to missing variable initialization - Avoid unnecessary get/put in spapr_tce_platform_iommu_attach_dev() Thanks to Geetika Moolchandani, Jason Gunthorpe, Michal Suchánek, Nathan Lynch, and Shivaprasad G Bhat. * tag 'powerpc-6.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: selftests/powerpc/papr-vpd: Fix missing variable initialization powerpc/crypto/chacha-p10: Fix failure on non Power10 powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev()
2 parents 560d4e7 + 210cfef commit e43afae

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

arch/powerpc/crypto/chacha-p10-glue.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,17 +197,23 @@ static struct skcipher_alg algs[] = {
197197

198198
static int __init chacha_p10_init(void)
199199
{
200+
if (!cpu_has_feature(CPU_FTR_ARCH_31))
201+
return 0;
202+
200203
static_branch_enable(&have_p10);
201204

202205
return crypto_register_skciphers(algs, ARRAY_SIZE(algs));
203206
}
204207

205208
static void __exit chacha_p10_exit(void)
206209
{
210+
if (!static_branch_likely(&have_p10))
211+
return;
212+
207213
crypto_unregister_skciphers(algs, ARRAY_SIZE(algs));
208214
}
209215

210-
module_cpu_feature_match(PPC_MODULE_FEATURE_P10, chacha_p10_init);
216+
module_init(chacha_p10_init);
211217
module_exit(chacha_p10_exit);
212218

213219
MODULE_DESCRIPTION("ChaCha and XChaCha stream ciphers (P10 accelerated)");

arch/powerpc/kernel/iommu.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,15 +1285,14 @@ spapr_tce_platform_iommu_attach_dev(struct iommu_domain *platform_domain,
12851285
struct device *dev)
12861286
{
12871287
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
1288-
struct iommu_group *grp = iommu_group_get(dev);
12891288
struct iommu_table_group *table_group;
1289+
struct iommu_group *grp;
12901290

12911291
/* At first attach the ownership is already set */
1292-
if (!domain) {
1293-
iommu_group_put(grp);
1292+
if (!domain)
12941293
return 0;
1295-
}
12961294

1295+
grp = iommu_group_get(dev);
12971296
table_group = iommu_group_get_iommudata(grp);
12981297
/*
12991298
* The domain being set to PLATFORM from earlier

tools/testing/selftests/powerpc/papr_vpd/papr_vpd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int dev_papr_vpd_null_handle(void)
154154
static int papr_vpd_close_handle_without_reading(void)
155155
{
156156
const int devfd = open(DEVPATH, O_RDONLY);
157-
struct papr_location_code lc;
157+
struct papr_location_code lc = { .str = "", };
158158
int fd;
159159

160160
SKIP_IF_MSG(devfd < 0 && errno == ENOENT,

0 commit comments

Comments
 (0)