diff options
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r-- | drivers/misc/mei/init.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c index 6197018e2f16..f7f3abbe12b6 100644 --- a/drivers/misc/mei/init.c +++ b/drivers/misc/mei/init.c | |||
@@ -68,6 +68,14 @@ void mei_device_init(struct mei_device *dev) | |||
68 | mei_io_list_init(&dev->amthif_cmd_list); | 68 | mei_io_list_init(&dev->amthif_cmd_list); |
69 | mei_io_list_init(&dev->amthif_rd_complete_list); | 69 | mei_io_list_init(&dev->amthif_rd_complete_list); |
70 | 70 | ||
71 | bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX); | ||
72 | dev->open_handle_count = 0; | ||
73 | |||
74 | /* | ||
75 | * Reserving the first client ID | ||
76 | * 0: Reserved for MEI Bus Message communications | ||
77 | */ | ||
78 | bitmap_set(dev->host_clients_map, 0, 1); | ||
71 | } | 79 | } |
72 | EXPORT_SYMBOL_GPL(mei_device_init); | 80 | EXPORT_SYMBOL_GPL(mei_device_init); |
73 | 81 | ||
@@ -139,6 +147,10 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) | |||
139 | dev->dev_state != MEI_DEV_POWER_DOWN && | 147 | dev->dev_state != MEI_DEV_POWER_DOWN && |
140 | dev->dev_state != MEI_DEV_POWER_UP); | 148 | dev->dev_state != MEI_DEV_POWER_UP); |
141 | 149 | ||
150 | if (unexpected) | ||
151 | dev_warn(&dev->pdev->dev, "unexpected reset: dev_state = %s\n", | ||
152 | mei_dev_state_str(dev->dev_state)); | ||
153 | |||
142 | ret = mei_hw_reset(dev, interrupts_enabled); | 154 | ret = mei_hw_reset(dev, interrupts_enabled); |
143 | if (ret) { | 155 | if (ret) { |
144 | dev_err(&dev->pdev->dev, "hw reset failed disabling the device\n"); | 156 | dev_err(&dev->pdev->dev, "hw reset failed disabling the device\n"); |
@@ -165,12 +177,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) | |||
165 | /* remove entry if already in list */ | 177 | /* remove entry if already in list */ |
166 | dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n"); | 178 | dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n"); |
167 | mei_cl_unlink(&dev->wd_cl); | 179 | mei_cl_unlink(&dev->wd_cl); |
168 | if (dev->open_handle_count > 0) | ||
169 | dev->open_handle_count--; | ||
170 | mei_cl_unlink(&dev->iamthif_cl); | 180 | mei_cl_unlink(&dev->iamthif_cl); |
171 | if (dev->open_handle_count > 0) | ||
172 | dev->open_handle_count--; | ||
173 | |||
174 | mei_amthif_reset_params(dev); | 181 | mei_amthif_reset_params(dev); |
175 | memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg)); | 182 | memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg)); |
176 | } | 183 | } |
@@ -182,10 +189,6 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) | |||
182 | dev->rd_msg_hdr = 0; | 189 | dev->rd_msg_hdr = 0; |
183 | dev->wd_pending = false; | 190 | dev->wd_pending = false; |
184 | 191 | ||
185 | if (unexpected) | ||
186 | dev_warn(&dev->pdev->dev, "unexpected reset: dev_state = %s\n", | ||
187 | mei_dev_state_str(dev->dev_state)); | ||
188 | |||
189 | if (!interrupts_enabled) { | 192 | if (!interrupts_enabled) { |
190 | dev_dbg(&dev->pdev->dev, "intr not enabled end of reset\n"); | 193 | dev_dbg(&dev->pdev->dev, "intr not enabled end of reset\n"); |
191 | return; | 194 | return; |