Loading drivers/soc/qcom/qdss_bridge.c +9 −17 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -31,17 +31,6 @@ #define MODULE_NAME "qdss_bridge" #define QDSS_BUF_SIZE (16*1024) #define MHI_CLIENT_QDSS_IN 9 /* Max number of objects needed */ static int poolsize = 32; module_param(poolsize, int, 0644); /* Size of single buffer */ static int itemsize = QDSS_BUF_SIZE; module_param(itemsize, int, 0644); static struct class *mhi_class; static const char * const str_mhi_transfer_mode[] = { Loading Loading @@ -106,8 +95,12 @@ static int qdss_create_buf_tbl(struct qdss_bridge_drvdata *drvdata) void *buf; struct qdss_request *usb_req; int i; struct mhi_device *mhi_dev = drvdata->mhi_dev; drvdata->nr_trbs = mhi_get_no_free_descriptors(mhi_dev, DMA_FROM_DEVICE); for (i = 0; i < poolsize; i++) { for (i = 0; i < drvdata->nr_trbs; i++) { entry = kzalloc(sizeof(*entry), GFP_KERNEL); if (!entry) goto err; Loading Loading @@ -455,7 +448,7 @@ static void usb_notifier(void *priv, unsigned int event, switch (event) { case USB_QDSS_CONNECT: usb_qdss_alloc_req(ch, poolsize, 0); usb_qdss_alloc_req(ch, drvdata->nr_trbs, 0); mhi_queue_read(drvdata); break; Loading Loading @@ -709,12 +702,11 @@ static ssize_t mhi_uci_read(struct file *file, static int mhi_queue_inbound(struct qdss_bridge_drvdata *drvdata) { struct mhi_device *mhi_dev = drvdata->mhi_dev; int nr_trbs = mhi_get_no_free_descriptors(mhi_dev, DMA_FROM_DEVICE); void *buf; struct qdss_mhi_buf_tbl_t *entry; int ret = -EIO, i; for (i = 0; i < nr_trbs; i++) { for (i = 0; i < drvdata->nr_trbs; i++) { entry = kzalloc(sizeof(*entry), GFP_KERNEL); if (!entry) goto err; Loading Loading @@ -922,7 +914,7 @@ static int qdss_mhi_probe(struct mhi_device *mhi_dev, } static const struct mhi_device_id qdss_mhi_match_table[] = { { .chan = "QDSS", .driver_data = 0x4000 }, { .chan = "QDSS", .driver_data = 0x8000 }, {}, }; Loading drivers/soc/qcom/qdss_bridge.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -39,6 +39,7 @@ enum open_status { struct qdss_bridge_drvdata { int alias; int nr_trbs; enum open_status opened; struct completion completion; size_t mtu; Loading Loading
drivers/soc/qcom/qdss_bridge.c +9 −17 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -31,17 +31,6 @@ #define MODULE_NAME "qdss_bridge" #define QDSS_BUF_SIZE (16*1024) #define MHI_CLIENT_QDSS_IN 9 /* Max number of objects needed */ static int poolsize = 32; module_param(poolsize, int, 0644); /* Size of single buffer */ static int itemsize = QDSS_BUF_SIZE; module_param(itemsize, int, 0644); static struct class *mhi_class; static const char * const str_mhi_transfer_mode[] = { Loading Loading @@ -106,8 +95,12 @@ static int qdss_create_buf_tbl(struct qdss_bridge_drvdata *drvdata) void *buf; struct qdss_request *usb_req; int i; struct mhi_device *mhi_dev = drvdata->mhi_dev; drvdata->nr_trbs = mhi_get_no_free_descriptors(mhi_dev, DMA_FROM_DEVICE); for (i = 0; i < poolsize; i++) { for (i = 0; i < drvdata->nr_trbs; i++) { entry = kzalloc(sizeof(*entry), GFP_KERNEL); if (!entry) goto err; Loading Loading @@ -455,7 +448,7 @@ static void usb_notifier(void *priv, unsigned int event, switch (event) { case USB_QDSS_CONNECT: usb_qdss_alloc_req(ch, poolsize, 0); usb_qdss_alloc_req(ch, drvdata->nr_trbs, 0); mhi_queue_read(drvdata); break; Loading Loading @@ -709,12 +702,11 @@ static ssize_t mhi_uci_read(struct file *file, static int mhi_queue_inbound(struct qdss_bridge_drvdata *drvdata) { struct mhi_device *mhi_dev = drvdata->mhi_dev; int nr_trbs = mhi_get_no_free_descriptors(mhi_dev, DMA_FROM_DEVICE); void *buf; struct qdss_mhi_buf_tbl_t *entry; int ret = -EIO, i; for (i = 0; i < nr_trbs; i++) { for (i = 0; i < drvdata->nr_trbs; i++) { entry = kzalloc(sizeof(*entry), GFP_KERNEL); if (!entry) goto err; Loading Loading @@ -922,7 +914,7 @@ static int qdss_mhi_probe(struct mhi_device *mhi_dev, } static const struct mhi_device_id qdss_mhi_match_table[] = { { .chan = "QDSS", .driver_data = 0x4000 }, { .chan = "QDSS", .driver_data = 0x8000 }, {}, }; Loading
drivers/soc/qcom/qdss_bridge.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -39,6 +39,7 @@ enum open_status { struct qdss_bridge_drvdata { int alias; int nr_trbs; enum open_status opened; struct completion completion; size_t mtu; Loading