Hi all, Today's linux-next merge of the tegra tree got a conflict in: drivers/firmware/tegra/bpmp.c between commit: 4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family") from the origin tree and commits: ee98ea41ee3fb ("firmware: tegra: bpmp: Add ACPI support") 7432bd82f69e5 ("firmware: tegra: bpmp: Add MBWT BPMP helpers") fc92a01962b16 ("firmware: tegra: bpmp: Move channel initialization to helper") from the tegra tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. diff --cc drivers/firmware/tegra/bpmp.c index 5fbd6a3e69e09,d3508e98e3382..0000000000000 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@@ -764,20 -975,96 +975,94 @@@ int tegra_bpmp_init_channels(struct teg return -ENOMEM; spin_lock_init(&bpmp->atomic_tx_lock); - bpmp->tx_channel = devm_kzalloc_obj(&pdev->dev, *bpmp->tx_channel); - bpmp->tx_channel = devm_kzalloc(bpmp->dev, sizeof(*bpmp->tx_channel), - GFP_KERNEL); ++ bpmp->tx_channel = devm_kzalloc_obj(bpmp->dev, *bpmp->tx_channel); if (!bpmp->tx_channel) return -ENOMEM; - bpmp->rx_channel = devm_kzalloc_obj(&pdev->dev, *bpmp->rx_channel); - bpmp->rx_channel = devm_kzalloc(bpmp->dev, sizeof(*bpmp->rx_channel), - GFP_KERNEL); ++ bpmp->rx_channel = devm_kzalloc_obj(bpmp->dev, *bpmp->rx_channel); if (!bpmp->rx_channel) return -ENOMEM; - bpmp->threaded_channels = devm_kzalloc_objs(&pdev->dev, - bpmp->threaded_channels = devm_kcalloc(bpmp->dev, bpmp->threaded.count, - sizeof(*bpmp->threaded_channels), - GFP_KERNEL); ++ bpmp->threaded_channels = devm_kzalloc_objs(bpmp->dev, + *bpmp->threaded_channels, + bpmp->threaded.count); if (!bpmp->threaded_channels) return -ENOMEM; + return 0; + } + + int tegra_bpmp_init_ping(struct tegra_bpmp *bpmp) + { + int err; + + err = tegra_bpmp_request_mrq(bpmp, MRQ_PING, + tegra_bpmp_mrq_handle_ping, bpmp); + if (err < 0) + return err; + + err = tegra_bpmp_ping(bpmp); + if (err < 0) { + dev_err(bpmp->dev, "failed to ping BPMP: %d\n", err); + goto free_mrq; + } + + return 0; + + free_mrq: + tegra_bpmp_free_mrq(bpmp, MRQ_PING, bpmp); + + return err; + } + + void tegra_bpmp_deinit_ping(struct tegra_bpmp *bpmp) + { + tegra_bpmp_free_mrq(bpmp, MRQ_PING, bpmp); + } + + int tegra_bpmp_init_dt_providers(struct tegra_bpmp *bpmp) + { + struct device *dev = bpmp->dev; + int err; + + err = of_platform_default_populate(dev->of_node, NULL, dev); + if (err < 0) + return err; + + if (of_property_present(dev->of_node, "#clock-cells")) { + err = tegra_bpmp_init_clocks(bpmp); + if (err < 0) + return err; + } + + if (of_property_present(dev->of_node, "#reset-cells")) { + err = tegra_bpmp_init_resets(bpmp); + if (err < 0) + return err; + } + + if (of_property_present(dev->of_node, "#power-domain-cells")) { + err = tegra_bpmp_init_powergates(bpmp); + if (err < 0) + return err; + } + + return 0; + } + + static int tegra_bpmp_probe(struct platform_device *pdev) + { + struct tegra_bpmp *bpmp; + char tag[TAG_SZ]; + int err; + - bpmp = devm_kzalloc(&pdev->dev, sizeof(*bpmp), GFP_KERNEL); ++ bpmp = devm_kzalloc_obj(&pdev->dev, *bpmp); + if (!bpmp) + return -ENOMEM; + + bpmp->soc = device_get_match_data(&pdev->dev); + bpmp->dev = &pdev->dev; + platform_set_drvdata(pdev, bpmp); err = bpmp->soc->ops->init(bpmp);