Source
154
154
dev->config_enabled = true;
155
155
if (dev->config_change_pending)
156
156
__virtio_config_changed(dev);
157
157
dev->config_change_pending = false;
158
158
spin_unlock_irq(&dev->config_lock);
159
159
}
160
160
EXPORT_SYMBOL_GPL(virtio_config_enable);
161
161
162
162
void virtio_add_status(struct virtio_device *dev, unsigned int status)
163
163
{
164
+
might_sleep();
164
165
dev->config->set_status(dev, dev->config->get_status(dev) | status);
165
166
}
166
167
EXPORT_SYMBOL_GPL(virtio_add_status);
167
168
168
169
int virtio_finalize_features(struct virtio_device *dev)
169
170
{
170
171
int ret = dev->config->finalize_features(dev);
171
172
unsigned status;
172
173
174
+
might_sleep();
173
175
if (ret)
174
176
return ret;
175
177
176
178
if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1))
177
179
return 0;
178
180
179
181
virtio_add_status(dev, VIRTIO_CONFIG_S_FEATURES_OK);
180
182
status = dev->config->get_status(dev);
181
183
if (!(status & VIRTIO_CONFIG_S_FEATURES_OK)) {
182
184
dev_err(&dev->dev, "virtio: device refuses features: %x\n",