diff options
author | Jens Axboe <axboe@fb.com> | 2017-05-02 11:53:04 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-05-03 10:09:19 -0400 |
commit | 994ff079e8f6399e1f8cd43141da0f79ce7a179a (patch) | |
tree | 8162633011689567dc864f511326d042e92a7cd1 /drivers/block | |
parent | 7a148c2fcff83309748bfaafe121aa85b724624f (diff) |
mtip32xx: cleanup internal tag assumptions
We don't decode the internal tag to the proper group or tag
indx. This works fine because we have hard wired it as 0 for now,
but could break if we get rid of that.
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 96fe6500e941..3204623f746a 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -847,16 +847,15 @@ static inline void mtip_process_legacy(struct driver_data *dd, u32 port_stat) | |||
847 | struct mtip_port *port = dd->port; | 847 | struct mtip_port *port = dd->port; |
848 | struct mtip_cmd *cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL); | 848 | struct mtip_cmd *cmd = mtip_cmd_from_tag(dd, MTIP_TAG_INTERNAL); |
849 | 849 | ||
850 | if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) && | 850 | if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &port->flags) && cmd) { |
851 | (cmd != NULL) && !(readl(port->cmd_issue[MTIP_TAG_INTERNAL]) | 851 | int group = MTIP_TAG_INDEX(MTIP_TAG_INTERNAL); |
852 | & (1 << MTIP_TAG_INTERNAL))) { | 852 | int status = readl(port->cmd_issue[group]); |
853 | if (cmd->comp_func) { | 853 | |
854 | cmd->comp_func(port, MTIP_TAG_INTERNAL, cmd, 0); | 854 | if (!(status & (1 << MTIP_TAG_BIT(MTIP_TAG_INTERNAL)))) { |
855 | return; | 855 | if (cmd->comp_func) |
856 | cmd->comp_func(port, MTIP_TAG_INTERNAL, cmd, 0); | ||
856 | } | 857 | } |
857 | } | 858 | } |
858 | |||
859 | return; | ||
860 | } | 859 | } |
861 | 860 | ||
862 | /* | 861 | /* |
@@ -1213,8 +1212,8 @@ static int mtip_exec_internal_command(struct mtip_port *port, | |||
1213 | goto exec_ic_exit; | 1212 | goto exec_ic_exit; |
1214 | } | 1213 | } |
1215 | 1214 | ||
1216 | if (readl(port->cmd_issue[MTIP_TAG_INTERNAL]) | 1215 | if (readl(port->cmd_issue[MTIP_TAG_INDEX(MTIP_TAG_INTERNAL)]) |
1217 | & (1 << MTIP_TAG_INTERNAL)) { | 1216 | & (1 << MTIP_TAG_BIT(MTIP_TAG_INTERNAL))) { |
1218 | rv = -ENXIO; | 1217 | rv = -ENXIO; |
1219 | if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) { | 1218 | if (!test_bit(MTIP_DDF_REMOVE_PENDING_BIT, &dd->dd_flag)) { |
1220 | mtip_device_reset(dd); | 1219 | mtip_device_reset(dd); |