Skip to content

Commit 5963edd

Browse files
committed
Merge tag 'soc_fsl-6.16-1' of https://github.com/chleroy/linux into soc/drivers
FSL SOC Changes for 6.16: - Various fixes and cleanups from Ioana on fsl-mc bus driver - Other misc fixes on fsl-mc bus driver - A build fix on DPAA2 driver - Some preparation work from Kees on qbman driver - Some cleanup on FSL qe interrupt driver init * tag 'soc_fsl-6.16-1' of https://github.com/chleroy/linux: soc: fsl: qe: Consolidate chained IRQ handler install/remove bus: fsl-mc: Use strscpy() instead of strscpy_pad() soc: fsl: qbman: Remove const from portal->cgrs allocation type bus: fsl_mc: Fix driver_managed_dma check bus: fsl-mc: increase MC_CMD_COMPLETION_TIMEOUT_MS value bus: fsl-mc: drop useless cleanup bus: fsl-mc: add the dprc_get_mem() command to the whitelist bus: fsl-mc: fix GET/SET_TAILDROP command ids bus: fsl-mc: do not add a device-link for the UAPI used DPMCP device bus: fsl-mc: fix double-free on mc_dev soc: fsl: Do not enable DPAA2_CONSOLE by default during compile testing Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 4d1c69e + 695d702 commit 5963edd

File tree

11 files changed

+38
-49
lines changed

11 files changed

+38
-49
lines changed

drivers/bus/fsl-mc/dprc-driver.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,6 @@ int dprc_cleanup(struct fsl_mc_device *mc_dev)
806806
dev_set_msi_domain(&mc_dev->dev, NULL);
807807
}
808808

809-
fsl_mc_cleanup_all_resource_pools(mc_dev);
810-
811809
/* if this step fails we cannot go further with cleanup as there is no way of
812810
* communicating with the firmware
813811
*/

drivers/bus/fsl-mc/dprc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ int dprc_set_obj_irq(struct fsl_mc_io *mc_io,
489489
cmd_params->irq_addr = cpu_to_le64(irq_cfg->paddr);
490490
cmd_params->irq_num = cpu_to_le32(irq_cfg->irq_num);
491491
cmd_params->obj_id = cpu_to_le32(obj_id);
492-
strscpy_pad(cmd_params->obj_type, obj_type, 16);
492+
strscpy(cmd_params->obj_type, obj_type);
493493

494494
/* send command to mc*/
495495
return mc_send_command(mc_io, &cmd);
@@ -561,7 +561,7 @@ int dprc_get_obj_region(struct fsl_mc_io *mc_io,
561561
cmd_params = (struct dprc_cmd_get_obj_region *)cmd.params;
562562
cmd_params->obj_id = cpu_to_le32(obj_id);
563563
cmd_params->region_index = region_index;
564-
strscpy_pad(cmd_params->obj_type, obj_type, 16);
564+
strscpy(cmd_params->obj_type, obj_type);
565565

566566
/* send command to mc*/
567567
err = mc_send_command(mc_io, &cmd);

drivers/bus/fsl-mc/fsl-mc-allocator.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -555,27 +555,6 @@ void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
555555
}
556556
}
557557

558-
static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev,
559-
enum fsl_mc_pool_type pool_type)
560-
{
561-
struct fsl_mc_resource *resource;
562-
struct fsl_mc_resource *next;
563-
struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
564-
struct fsl_mc_resource_pool *res_pool =
565-
&mc_bus->resource_pools[pool_type];
566-
567-
list_for_each_entry_safe(resource, next, &res_pool->free_list, node)
568-
devm_kfree(&mc_bus_dev->dev, resource);
569-
}
570-
571-
void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
572-
{
573-
int pool_type;
574-
575-
for (pool_type = 0; pool_type < FSL_MC_NUM_POOL_TYPES; pool_type++)
576-
fsl_mc_cleanup_resource_pool(mc_bus_dev, pool_type);
577-
}
578-
579558
/*
580559
* fsl_mc_allocator_probe - callback invoked when an allocatable device is
581560
* being added to the system

drivers/bus/fsl-mc/fsl-mc-bus.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ static int fsl_mc_bus_uevent(const struct device *dev, struct kobj_uevent_env *e
139139

140140
static int fsl_mc_dma_configure(struct device *dev)
141141
{
142+
const struct device_driver *drv = READ_ONCE(dev->driver);
142143
struct device *dma_dev = dev;
143144
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
144-
struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(dev->driver);
145145
u32 input_id = mc_dev->icid;
146146
int ret;
147147

@@ -153,8 +153,8 @@ static int fsl_mc_dma_configure(struct device *dev)
153153
else
154154
ret = acpi_dma_configure_id(dev, DEV_DMA_COHERENT, &input_id);
155155

156-
/* @mc_drv may not be valid when we're called from the IOMMU layer */
157-
if (!ret && dev->driver && !mc_drv->driver_managed_dma) {
156+
/* @drv may not be valid when we're called from the IOMMU layer */
157+
if (!ret && drv && !to_fsl_mc_driver(drv)->driver_managed_dma) {
158158
ret = iommu_device_use_default_domain(dev);
159159
if (ret)
160160
arch_teardown_dma_ops(dev);
@@ -906,8 +906,10 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
906906

907907
error_cleanup_dev:
908908
kfree(mc_dev->regions);
909-
kfree(mc_bus);
910-
kfree(mc_dev);
909+
if (mc_bus)
910+
kfree(mc_bus);
911+
else
912+
kfree(mc_dev);
911913

912914
return error;
913915
}

drivers/bus/fsl-mc/fsl-mc-private.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,6 @@ int __init fsl_mc_allocator_driver_init(void);
629629

630630
void fsl_mc_init_all_resource_pools(struct fsl_mc_device *mc_bus_dev);
631631

632-
void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev);
633-
634632
int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus,
635633
enum fsl_mc_pool_type pool_type,
636634
struct fsl_mc_resource

drivers/bus/fsl-mc/fsl-mc-uapi.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ enum fsl_mc_cmd_index {
4848
DPRC_GET_POOL,
4949
DPRC_GET_POOL_COUNT,
5050
DPRC_GET_CONNECTION,
51+
DPRC_GET_MEM,
5152
DPCI_GET_LINK_STATE,
5253
DPCI_GET_PEER_ATTR,
5354
DPAIOP_GET_SL_VERSION,
@@ -194,6 +195,12 @@ static struct fsl_mc_cmd_desc fsl_mc_accepted_cmds[] = {
194195
.token = true,
195196
.size = 32,
196197
},
198+
[DPRC_GET_MEM] = {
199+
.cmdid_value = 0x16D0,
200+
.cmdid_mask = 0xFFF0,
201+
.token = true,
202+
.size = 12,
203+
},
197204

198205
[DPCI_GET_LINK_STATE] = {
199206
.cmdid_value = 0x0E10,
@@ -275,13 +282,13 @@ static struct fsl_mc_cmd_desc fsl_mc_accepted_cmds[] = {
275282
.size = 8,
276283
},
277284
[DPSW_GET_TAILDROP] = {
278-
.cmdid_value = 0x0A80,
285+
.cmdid_value = 0x0A90,
279286
.cmdid_mask = 0xFFF0,
280287
.token = true,
281288
.size = 14,
282289
},
283290
[DPSW_SET_TAILDROP] = {
284-
.cmdid_value = 0x0A90,
291+
.cmdid_value = 0x0A80,
285292
.cmdid_mask = 0xFFF0,
286293
.token = true,
287294
.size = 24,

drivers/bus/fsl-mc/mc-io.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,19 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev,
214214
if (error < 0)
215215
goto error_cleanup_resource;
216216

217-
dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev,
218-
&dpmcp_dev->dev,
219-
DL_FLAG_AUTOREMOVE_CONSUMER);
220-
if (!dpmcp_dev->consumer_link) {
221-
error = -EINVAL;
222-
goto error_cleanup_mc_io;
217+
/* If the DPRC device itself tries to allocate a portal (usually for
218+
* UAPI interaction), don't add a device link between them since the
219+
* DPMCP device is an actual child device of the DPRC and a reverse
220+
* dependency is not allowed.
221+
*/
222+
if (mc_dev != mc_bus_dev) {
223+
dpmcp_dev->consumer_link = device_link_add(&mc_dev->dev,
224+
&dpmcp_dev->dev,
225+
DL_FLAG_AUTOREMOVE_CONSUMER);
226+
if (!dpmcp_dev->consumer_link) {
227+
error = -EINVAL;
228+
goto error_cleanup_mc_io;
229+
}
223230
}
224231

225232
*new_mc_io = mc_io;

drivers/bus/fsl-mc/mc-sys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/*
2020
* Timeout in milliseconds to wait for the completion of an MC command
2121
*/
22-
#define MC_CMD_COMPLETION_TIMEOUT_MS 500
22+
#define MC_CMD_COMPLETION_TIMEOUT_MS 15000
2323

2424
/*
2525
* usleep_range() min and max values used to throttle down polling

drivers/soc/fsl/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ config FSL_MC_DPIO
3636
config DPAA2_CONSOLE
3737
tristate "QorIQ DPAA2 console driver"
3838
depends on OF && (ARCH_LAYERSCAPE || COMPILE_TEST)
39-
default y
39+
default ARCH_LAYERSCAPE
4040
help
4141
Console driver for DPAA2 platforms. Exports 2 char devices,
4242
/dev/dpaa2_mc_console and /dev/dpaa2_aiop_console,

drivers/soc/fsl/qbman/qman.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ static int qman_create_portal(struct qman_portal *portal,
12701270
qm_dqrr_set_ithresh(p, QMAN_PIRQ_DQRR_ITHRESH);
12711271
qm_mr_set_ithresh(p, QMAN_PIRQ_MR_ITHRESH);
12721272
qm_out(p, QM_REG_ITPR, QMAN_PIRQ_IPERIOD);
1273-
portal->cgrs = kmalloc_array(2, sizeof(*cgrs), GFP_KERNEL);
1273+
portal->cgrs = kmalloc_array(2, sizeof(*portal->cgrs), GFP_KERNEL);
12741274
if (!portal->cgrs)
12751275
goto fail_cgrs;
12761276
/* initial snapshot is no-depletion */

0 commit comments

Comments
 (0)