Skip to content

Commit 0dc3ad3

Browse files
committed
Revert "bus: mhi: Add inbound buffers allocation flag"
This reverts commit 0092a1e This should be reverted in the char-misc-next branch to make merging with Linus's branch possible due to issues with the mhi code that was found in the networking tree. Link: https://lore.kernel.org/r/20210827175852.GB15018@thinkpad Reported-by: Manivannan Sadhasivam <[email protected]> Reported-by: Stephen Rothwell <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Bhaumik Bhatt <[email protected]> Cc: Hemant Kumar <[email protected]> Cc: Jakub Kicinski <[email protected]> Cc: Kalle Valo <[email protected]> Cc: Loic Poulain <[email protected]> Cc: Manivannan Sadhasivam <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a99009b commit 0dc3ad3

File tree

6 files changed

+8
-16
lines changed

6 files changed

+8
-16
lines changed

drivers/bus/mhi/core/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ void mhi_rddm_prepare(struct mhi_controller *mhi_cntrl,
682682
struct image_info *img_info);
683683
void mhi_fw_load_handler(struct mhi_controller *mhi_cntrl);
684684
int mhi_prepare_channel(struct mhi_controller *mhi_cntrl,
685-
struct mhi_chan *mhi_chan, unsigned int flags);
685+
struct mhi_chan *mhi_chan);
686686
int mhi_init_chan_ctxt(struct mhi_controller *mhi_cntrl,
687687
struct mhi_chan *mhi_chan);
688688
void mhi_deinit_chan_ctxt(struct mhi_controller *mhi_cntrl,

drivers/bus/mhi/core/main.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ static void mhi_unprepare_channel(struct mhi_controller *mhi_cntrl,
14301430
}
14311431

14321432
int mhi_prepare_channel(struct mhi_controller *mhi_cntrl,
1433-
struct mhi_chan *mhi_chan, unsigned int flags)
1433+
struct mhi_chan *mhi_chan)
14341434
{
14351435
int ret = 0;
14361436
struct device *dev = &mhi_chan->mhi_dev->dev;
@@ -1455,9 +1455,6 @@ int mhi_prepare_channel(struct mhi_controller *mhi_cntrl,
14551455
if (ret)
14561456
goto error_pm_state;
14571457

1458-
if (mhi_chan->dir == DMA_FROM_DEVICE)
1459-
mhi_chan->pre_alloc = !!(flags & MHI_CH_INBOUND_ALLOC_BUFS);
1460-
14611458
/* Pre-allocate buffer for xfer ring */
14621459
if (mhi_chan->pre_alloc) {
14631460
int nr_el = get_nr_avail_ring_elements(mhi_cntrl,
@@ -1613,7 +1610,7 @@ void mhi_reset_chan(struct mhi_controller *mhi_cntrl, struct mhi_chan *mhi_chan)
16131610
}
16141611

16151612
/* Move channel to start state */
1616-
int mhi_prepare_for_transfer(struct mhi_device *mhi_dev, unsigned int flags)
1613+
int mhi_prepare_for_transfer(struct mhi_device *mhi_dev)
16171614
{
16181615
int ret, dir;
16191616
struct mhi_controller *mhi_cntrl = mhi_dev->mhi_cntrl;
@@ -1624,7 +1621,7 @@ int mhi_prepare_for_transfer(struct mhi_device *mhi_dev, unsigned int flags)
16241621
if (!mhi_chan)
16251622
continue;
16261623

1627-
ret = mhi_prepare_channel(mhi_cntrl, mhi_chan, flags);
1624+
ret = mhi_prepare_channel(mhi_cntrl, mhi_chan);
16281625
if (ret)
16291626
goto error_open_chan;
16301627
}

drivers/net/mhi/net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static int mhi_net_newlink(void *ctxt, struct net_device *ndev, u32 if_id,
335335
u64_stats_init(&mhi_netdev->stats.tx_syncp);
336336

337337
/* Start MHI channels */
338-
err = mhi_prepare_for_transfer(mhi_dev, 0);
338+
err = mhi_prepare_for_transfer(mhi_dev);
339339
if (err)
340340
goto out_err;
341341

drivers/net/wwan/mhi_wwan_ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static int mhi_wwan_ctrl_start(struct wwan_port *port)
110110
int ret;
111111

112112
/* Start mhi device's channel(s) */
113-
ret = mhi_prepare_for_transfer(mhiwwan->mhi_dev, 0);
113+
ret = mhi_prepare_for_transfer(mhiwwan->mhi_dev);
114114
if (ret)
115115
return ret;
116116

include/linux/mhi.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,13 +721,8 @@ void mhi_device_put(struct mhi_device *mhi_dev);
721721
* host and device execution environments match and
722722
* channels are in a DISABLED state.
723723
* @mhi_dev: Device associated with the channels
724-
* @flags: MHI channel flags
725724
*/
726-
int mhi_prepare_for_transfer(struct mhi_device *mhi_dev,
727-
unsigned int flags);
728-
729-
/* Automatically allocate and queue inbound buffers */
730-
#define MHI_CH_INBOUND_ALLOC_BUFS BIT(0)
725+
int mhi_prepare_for_transfer(struct mhi_device *mhi_dev);
731726

732727
/**
733728
* mhi_unprepare_from_transfer - Reset UL and DL channels for data transfer.

net/qrtr/mhi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev,
8484
int rc;
8585

8686
/* start channels */
87-
rc = mhi_prepare_for_transfer(mhi_dev, MHI_CH_INBOUND_ALLOC_BUFS);
87+
rc = mhi_prepare_for_transfer(mhi_dev);
8888
if (rc)
8989
return rc;
9090

0 commit comments

Comments
 (0)