Skip to content

Commit

Permalink
slimbus: Use physical address type where physical address is used
Browse files Browse the repository at this point in the history
Use physical address type for buffers using physical address.
(e.g. interaction with data-mover engine)

Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
  • Loading branch information
Sagar Dharia authored and neobuddy89 committed Jan 2, 2015
1 parent 2f4d560 commit c4ee674
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions drivers/slimbus/slim-msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,23 +312,23 @@ void msm_dealloc_port(struct slim_controller *ctrl, u8 pn)
}

enum slim_port_err msm_slim_port_xfer_status(struct slim_controller *ctr,
u8 pn, u8 **done_buf, u32 *done_len)
u8 pn, phys_addr_t *done_buf, u32 *done_len)
{
struct msm_slim_ctrl *dev = slim_get_ctrldata(ctr);
struct sps_iovec sio;
int ret;
if (done_len)
*done_len = 0;
if (done_buf)
*done_buf = NULL;
*done_buf = 0;
if (!dev->pipes[pn].connected)
return SLIM_P_DISCONNECT;
ret = sps_get_iovec(dev->pipes[pn].sps, &sio);
if (!ret) {
if (done_len)
*done_len = sio.size;
if (done_buf)
*done_buf = (u8 *)sio.addr;
*done_buf = (phys_addr_t)sio.addr;
}
dev_dbg(dev->dev, "get iovec returned %d\n", ret);
return SLIM_P_INPROGRESS;
Expand All @@ -353,7 +353,7 @@ static void msm_slim_port_cb(struct sps_event_notify *ev)
complete(comp);
}

int msm_slim_port_xfer(struct slim_controller *ctrl, u8 pn, u8 *iobuf,
int msm_slim_port_xfer(struct slim_controller *ctrl, u8 pn, phys_addr_t iobuf,
u32 len, struct completion *comp)
{
struct sps_register_event sreg;
Expand All @@ -375,7 +375,7 @@ int msm_slim_port_xfer(struct slim_controller *ctrl, u8 pn, u8 *iobuf,
dev_dbg(dev->dev, "sps register event error:%x\n", ret);
return ret;
}
ret = sps_transfer_one(dev->pipes[pn].sps, (u32)iobuf, len, comp,
ret = sps_transfer_one(dev->pipes[pn].sps, iobuf, len, comp,
SPS_IOVEC_FLAG_INT);
dev_dbg(dev->dev, "sps submit xfer error code:%x\n", ret);
if (!ret) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/slimbus/slim-msm.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ int msm_alloc_port(struct slim_controller *ctrl, u8 pn);
void msm_dealloc_port(struct slim_controller *ctrl, u8 pn);
int msm_slim_connect_pipe_port(struct msm_slim_ctrl *dev, u8 pn);
enum slim_port_err msm_slim_port_xfer_status(struct slim_controller *ctr,
u8 pn, u8 **done_buf, u32 *done_len);
int msm_slim_port_xfer(struct slim_controller *ctrl, u8 pn, u8 *iobuf,
u8 pn, phys_addr_t *done_buf, u32 *done_len);
int msm_slim_port_xfer(struct slim_controller *ctrl, u8 pn, phys_addr_t iobuf,
u32 len, struct completion *comp);
int msm_send_msg_buf(struct msm_slim_ctrl *dev, u32 *buf, u8 len, u32 tx_reg);
u32 *msm_get_msg_buf(struct msm_slim_ctrl *dev, int len,
Expand Down
6 changes: 3 additions & 3 deletions drivers/slimbus/slimbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ EXPORT_SYMBOL_GPL(slim_disconnect_ports);
* Client will call slim_port_get_xfer_status to get error and/or number of
* bytes transferred if used asynchronously.
*/
int slim_port_xfer(struct slim_device *sb, u32 ph, u8 *iobuf, u32 len,
int slim_port_xfer(struct slim_device *sb, u32 ph, phys_addr_t iobuf, u32 len,
struct completion *comp)
{
struct slim_controller *ctrl = sb->ctrl;
Expand Down Expand Up @@ -1518,7 +1518,7 @@ EXPORT_SYMBOL_GPL(slim_port_xfer);
* processed from the multiple transfers.
*/
enum slim_port_err slim_port_get_xfer_status(struct slim_device *sb, u32 ph,
u8 **done_buf, u32 *done_len)
phys_addr_t *done_buf, u32 *done_len)
{
struct slim_controller *ctrl = sb->ctrl;
u8 pn = SLIM_HDL_TO_PORT(ph);
Expand All @@ -1531,7 +1531,7 @@ enum slim_port_err slim_port_get_xfer_status(struct slim_device *sb, u32 ph,
*/
if (la != SLIM_LA_MANAGER) {
if (done_buf)
*done_buf = NULL;
*done_buf = 0;
if (done_len)
*done_len = 0;
return SLIM_P_NOT_OWNED;
Expand Down
10 changes: 5 additions & 5 deletions include/linux/slimbus/slimbus.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ struct slim_controller {
int (*framer_handover)(struct slim_controller *ctrl,
struct slim_framer *new_framer);
int (*port_xfer)(struct slim_controller *ctrl,
u8 pn, u8 *iobuf, u32 len,
u8 pn, phys_addr_t iobuf, u32 len,
struct completion *comp);
enum slim_port_err (*port_xfer_status)(struct slim_controller *ctr,
u8 pn, u8 **done_buf, u32 *done_len);
u8 pn, phys_addr_t *done_buf, u32 *done_len);
int (*xfer_user_msg)(struct slim_controller *ctrl,
u8 la, u8 mt, u8 mc,
struct slim_ele_access *msg, u8 *buf, u8 len);
Expand Down Expand Up @@ -804,8 +804,8 @@ extern int slim_dealloc_mgrports(struct slim_device *sb, u32 *hdl, int hsz);
* Client will call slim_port_get_xfer_status to get error and/or number of
* bytes transferred if used asynchronously.
*/
extern int slim_port_xfer(struct slim_device *sb, u32 ph, u8 *iobuf, u32 len,
struct completion *comp);
extern int slim_port_xfer(struct slim_device *sb, u32 ph, phys_addr_t iobuf,
u32 len, struct completion *comp);

/*
* slim_port_get_xfer_status: Poll for port transfers, or get transfer status
Expand All @@ -827,7 +827,7 @@ extern int slim_port_xfer(struct slim_device *sb, u32 ph, u8 *iobuf, u32 len,
* processed from the multiple transfers.
*/
extern enum slim_port_err slim_port_get_xfer_status(struct slim_device *sb,
u32 ph, u8 **done_buf, u32 *done_len);
u32 ph, phys_addr_t *done_buf, u32 *done_len);

/*
* slim_connect_src: Connect source port to channel.
Expand Down

0 comments on commit c4ee674

Please sign in to comment.