mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
Merge commit '8e8320c931' into for-4.13/block
Pull in the fix for shared tags, as it conflicts with the pending changes in for-4.13/block. We already pulled in v4.12-rc5 to solve other conflicts or get fixes that went into 4.12, so not a lot of changes in this merge. Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
commit
f95a0d6a95
27 changed files with 275 additions and 148 deletions
|
|
@ -70,14 +70,14 @@ static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf)
|
|||
{
|
||||
return sprintf(buf, "I/O subchannel (Non-QDIO)\n");
|
||||
}
|
||||
MDEV_TYPE_ATTR_RO(name);
|
||||
static MDEV_TYPE_ATTR_RO(name);
|
||||
|
||||
static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
|
||||
char *buf)
|
||||
{
|
||||
return sprintf(buf, "%s\n", VFIO_DEVICE_API_CCW_STRING);
|
||||
}
|
||||
MDEV_TYPE_ATTR_RO(device_api);
|
||||
static MDEV_TYPE_ATTR_RO(device_api);
|
||||
|
||||
static ssize_t available_instances_show(struct kobject *kobj,
|
||||
struct device *dev, char *buf)
|
||||
|
|
@ -86,7 +86,7 @@ static ssize_t available_instances_show(struct kobject *kobj,
|
|||
|
||||
return sprintf(buf, "%d\n", atomic_read(&private->avail));
|
||||
}
|
||||
MDEV_TYPE_ATTR_RO(available_instances);
|
||||
static MDEV_TYPE_ATTR_RO(available_instances);
|
||||
|
||||
static struct attribute *mdev_types_attrs[] = {
|
||||
&mdev_type_attr_name.attr,
|
||||
|
|
@ -100,7 +100,7 @@ static struct attribute_group mdev_type_group = {
|
|||
.attrs = mdev_types_attrs,
|
||||
};
|
||||
|
||||
struct attribute_group *mdev_type_groups[] = {
|
||||
static struct attribute_group *mdev_type_groups[] = {
|
||||
&mdev_type_group,
|
||||
NULL,
|
||||
};
|
||||
|
|
@ -152,7 +152,7 @@ static int vfio_ccw_mdev_open(struct mdev_device *mdev)
|
|||
&events, &private->nb);
|
||||
}
|
||||
|
||||
void vfio_ccw_mdev_release(struct mdev_device *mdev)
|
||||
static void vfio_ccw_mdev_release(struct mdev_device *mdev)
|
||||
{
|
||||
struct vfio_ccw_private *private =
|
||||
dev_get_drvdata(mdev_parent_dev(mdev));
|
||||
|
|
@ -233,7 +233,7 @@ static int vfio_ccw_mdev_get_region_info(struct vfio_region_info *info,
|
|||
}
|
||||
}
|
||||
|
||||
int vfio_ccw_mdev_get_irq_info(struct vfio_irq_info *info)
|
||||
static int vfio_ccw_mdev_get_irq_info(struct vfio_irq_info *info)
|
||||
{
|
||||
if (info->index != VFIO_CCW_IO_IRQ_INDEX)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -668,10 +668,28 @@ static int ap_device_probe(struct device *dev)
|
|||
struct ap_driver *ap_drv = to_ap_drv(dev->driver);
|
||||
int rc;
|
||||
|
||||
/* Add queue/card to list of active queues/cards */
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
if (is_card_dev(dev))
|
||||
list_add(&to_ap_card(dev)->list, &ap_card_list);
|
||||
else
|
||||
list_add(&to_ap_queue(dev)->list,
|
||||
&to_ap_queue(dev)->card->queues);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
|
||||
ap_dev->drv = ap_drv;
|
||||
rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
|
||||
if (rc)
|
||||
|
||||
if (rc) {
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
if (is_card_dev(dev))
|
||||
list_del_init(&to_ap_card(dev)->list);
|
||||
else
|
||||
list_del_init(&to_ap_queue(dev)->list);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
ap_dev->drv = NULL;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -680,14 +698,17 @@ static int ap_device_remove(struct device *dev)
|
|||
struct ap_device *ap_dev = to_ap_dev(dev);
|
||||
struct ap_driver *ap_drv = ap_dev->drv;
|
||||
|
||||
if (ap_drv->remove)
|
||||
ap_drv->remove(ap_dev);
|
||||
|
||||
/* Remove queue/card from list of active queues/cards */
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
if (is_card_dev(dev))
|
||||
list_del_init(&to_ap_card(dev)->list);
|
||||
else
|
||||
list_del_init(&to_ap_queue(dev)->list);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
if (ap_drv->remove)
|
||||
ap_drv->remove(ap_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1056,10 +1077,6 @@ static void ap_scan_bus(struct work_struct *unused)
|
|||
}
|
||||
/* get it and thus adjust reference counter */
|
||||
get_device(&ac->ap_dev.device);
|
||||
/* Add card device to card list */
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
list_add(&ac->list, &ap_card_list);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
}
|
||||
/* now create the new queue device */
|
||||
aq = ap_queue_create(qid, type);
|
||||
|
|
@ -1070,10 +1087,6 @@ static void ap_scan_bus(struct work_struct *unused)
|
|||
aq->ap_dev.device.parent = &ac->ap_dev.device;
|
||||
dev_set_name(&aq->ap_dev.device,
|
||||
"%02x.%04x", id, dom);
|
||||
/* Add queue device to card queue list */
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
list_add(&aq->list, &ac->queues);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
/* Start with a device reset */
|
||||
spin_lock_bh(&aq->lock);
|
||||
ap_wait(ap_sm_event(aq, AP_EVENT_POLL));
|
||||
|
|
@ -1081,9 +1094,6 @@ static void ap_scan_bus(struct work_struct *unused)
|
|||
/* Register device */
|
||||
rc = device_register(&aq->ap_dev.device);
|
||||
if (rc) {
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
list_del_init(&aq->list);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
put_device(&aq->ap_dev.device);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,14 @@ static struct device_type ap_card_type = {
|
|||
|
||||
static void ap_card_device_release(struct device *dev)
|
||||
{
|
||||
kfree(to_ap_card(dev));
|
||||
struct ap_card *ac = to_ap_card(dev);
|
||||
|
||||
if (!list_empty(&ac->list)) {
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
list_del_init(&ac->list);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
}
|
||||
kfree(ac);
|
||||
}
|
||||
|
||||
struct ap_card *ap_card_create(int id, int queue_depth, int device_type,
|
||||
|
|
|
|||
|
|
@ -584,7 +584,14 @@ static struct device_type ap_queue_type = {
|
|||
|
||||
static void ap_queue_device_release(struct device *dev)
|
||||
{
|
||||
kfree(to_ap_queue(dev));
|
||||
struct ap_queue *aq = to_ap_queue(dev);
|
||||
|
||||
if (!list_empty(&aq->list)) {
|
||||
spin_lock_bh(&ap_list_lock);
|
||||
list_del_init(&aq->list);
|
||||
spin_unlock_bh(&ap_list_lock);
|
||||
}
|
||||
kfree(aq);
|
||||
}
|
||||
|
||||
struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type)
|
||||
|
|
|
|||
Loading…
Reference in a new issue