Displaying 20 results from an estimated 24 matches for "list_is_last".
2018 Feb 20
0
[PATCH 1/4] iommu: Add virtio-iommu driver
...&len)) != NULL) {
>> + if (req != pending) {
>> + dev_warn(viommu->dev, "discarding stale request\n");
>> + continue;
>> + }
>> +
>> + pending->written = len;
>> +
>> + if (++nr_received == nr_sent) {
>> + WARN_ON(!list_is_last(&pending->list, sent));
>> + break;
>> + } else if (WARN_ON(list_is_last(&pending->list, sent))) {
>> + break;
>> + }
>> +
>> + pending = list_next_entry(pending, list);
>
> We should remove current element from the pending list. There...
2013 Sep 16
0
[PATCH 1/2] com32: Fix bugs on cmd_reverse_search (Triple fault dimension)
...eletions(-)
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 7c4f14c..b70224a 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -89,10 +89,14 @@ static const char * cmd_reverse_search(int *cursor, clock_t *kbd_to,
break;
}
- while (!list_is_last(&last_found->list, &cli_history_head)) {
+ while (last_found) {
p = strstr(last_found->command, buf);
if (p)
break;
+
+ if (list_is_last(&last_found->list, &cli_history_head))
+ break;
+
last_found = list_entry(last_found->list....
2013 Sep 17
1
[PATCH 3/4 v2] com32: Fix bugs on cmd_reverse_search (Triple fault dimension)
...deletions(-)
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 7c4f14c..a50124c 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -89,10 +89,14 @@ static const char * cmd_reverse_search(int *cursor, clock_t *kbd_to,
break;
}
- while (!list_is_last(&last_found->list, &cli_history_head)) {
+ while (last_found) {
p = strstr(last_found->command, buf);
if (p)
break;
+
+ if (list_is_last(&last_found->list, &cli_history_head))
+ break;
+
last_found = list_entry(last_found->list.next, type...
2023 Jul 07
0
[PATCH drm-next v6 02/13] drm: manager to keep track of GPUs VA mappings
...d__)) && \
>> + !list_entry_is_head(va__, &(mgr__)->rb.list, rb.entry); \
>> + va__ = list_next_entry(va__, rb.entry))
>
> If you define:
>
> static inline struct drm_gpuva *
> drm_gpuva_next(struct drm_gpuva *va)
> {
> if (va && !list_is_last(&va->rb.entry, &va->mgr->rb.list))
> return list_next_entry(va, rb.entry);
>
> return NULL;
> } >
> the for loop becomes a bit more readable:
Yes, it would. However, I don't want it to be confused with
drm_gpuva_find_next(). Maybe I should rename the lat...
2014 Jul 26
0
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
...BUG_ON(irq_has_action(entry->irq + i));
}
- arch_teardown_msi_irqs(dev);
+ arch_teardown_msi_irqs(msi);
- list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
+ list_for_each_entry_safe(entry, tmp, &msi->msi_list, list) {
if (entry->msi_attrib.is_msix) {
- if (list_is_last(&entry->list, &dev->msi_list))
+ if (list_is_last(&entry->list, &msi->msi_list))
iounmap(entry->mask_base);
}
@@ -398,38 +441,24 @@ static void free_msi_irqs(struct pci_dev *dev)
list_del(&entry->list);
kfree(entry);
}
-
- if (dev->msi_ir...
2018 Feb 14
0
[PATCH 1/4] iommu: Add virtio-iommu driver
...ARN_ON(!pending))
+ return 0;
+
+ while ((req = virtqueue_get_buf(viommu->vq, &len)) != NULL) {
+ if (req != pending) {
+ dev_warn(viommu->dev, "discarding stale request\n");
+ continue;
+ }
+
+ pending->written = len;
+
+ if (++nr_received == nr_sent) {
+ WARN_ON(!list_is_last(&pending->list, sent));
+ break;
+ } else if (WARN_ON(list_is_last(&pending->list, sent))) {
+ break;
+ }
+
+ pending = list_next_entry(pending, list);
+ }
+
+ return nr_received;
+}
+
+static int _viommu_send_reqs_sync(struct viommu_dev *viommu,
+ struct viommu_request *r...
2018 Feb 14
12
[PATCH 0/4] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.6 of the
specification [1]. Previous version, RFCv2, was sent in November [2].
This version addresses Eric's comments and changes the device number.
(Since last week I also tested and fixed the probe/release functions,
they now use devm properly.)
I did not include ACPI support because the next IORT specifications
isn't ready yet (even
2018 Feb 14
12
[PATCH 0/4] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.6 of the
specification [1]. Previous version, RFCv2, was sent in November [2].
This version addresses Eric's comments and changes the device number.
(Since last week I also tested and fixed the probe/release functions,
they now use devm properly.)
I did not include ACPI support because the next IORT specifications
isn't ready yet (even
2017 Nov 17
0
[RFC PATCH v2 1/5] iommu: Add virtio-iommu driver
...ARN_ON(!pending))
+ return 0;
+
+ while ((req = virtqueue_get_buf(viommu->vq, &len)) != NULL) {
+ if (req != pending) {
+ dev_warn(viommu->dev, "discarding stale request\n");
+ continue;
+ }
+
+ pending->written = len;
+
+ if (++nr_received == nr_sent) {
+ WARN_ON(!list_is_last(&pending->list, sent));
+ break;
+ } else if (WARN_ON(list_is_last(&pending->list, sent))) {
+ break;
+ }
+
+ pending = list_next_entry(pending, list);
+ }
+
+ return nr_received;
+}
+
+/* Must be called with request_lock held */
+static int _viommu_send_reqs_sync(struct viommu...
2014 Aug 20
1
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
...> }
>
> - arch_teardown_msi_irqs(dev);
> + arch_teardown_msi_irqs(msi);
>
> - list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
> + list_for_each_entry_safe(entry, tmp, &msi->msi_list, list) {
> if (entry->msi_attrib.is_msix) {
> - if (list_is_last(&entry->list, &dev->msi_list))
> + if (list_is_last(&entry->list, &msi->msi_list))
> iounmap(entry->mask_base);
> }
>
> @@ -398,38 +441,24 @@ static void free_msi_irqs(struct pci_dev *dev)
> list_del(&entry->list);
> kfree(...
2014 Aug 20
1
[RFC PATCH 09/11] PCI/MSI: refactor PCI MSI driver
...> }
>
> - arch_teardown_msi_irqs(dev);
> + arch_teardown_msi_irqs(msi);
>
> - list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
> + list_for_each_entry_safe(entry, tmp, &msi->msi_list, list) {
> if (entry->msi_attrib.is_msix) {
> - if (list_is_last(&entry->list, &dev->msi_list))
> + if (list_is_last(&entry->list, &msi->msi_list))
> iounmap(entry->mask_base);
> }
>
> @@ -398,38 +441,24 @@ static void free_msi_irqs(struct pci_dev *dev)
> list_del(&entry->list);
> kfree(...
2018 Mar 23
1
[PATCH 1/4] iommu: Add virtio-iommu driver
...q = virtqueue_get_buf(viommu->vq, &len)) != NULL) {
> + if (req != pending) {
> + dev_warn(viommu->dev, "discarding stale request\n");
> + continue;
> + }
> +
> + pending->written = len;
> +
> + if (++nr_received == nr_sent) {
> + WARN_ON(!list_is_last(&pending->list, sent));
> + break;
> + } else if (WARN_ON(list_is_last(&pending->list, sent))) {
> + break;
> + }
> +
> + pending = list_next_entry(pending, list);
> + }
> +
> + return nr_received;
> +}
> +
> +static int _viommu_send_reqs_syn...
2014 Jul 26
0
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
...d;
+ else
+ nvec = 1 << entry->msi_attrib.multiple;
+ for (i = 0; i < nvec; i++)
+ BUG_ON(irq_has_action(entry->irq + i));
+ }
+
+ arch_teardown_msi_irqs(msi);
+
+ list_for_each_entry_safe(entry, tmp, &msi->msi_list, list) {
+ if (entry->msi_attrib.is_msix) {
+ if (list_is_last(&entry->list, &msi->msi_list))
+ iounmap(entry->mask_base);
+ }
+
+ /*
+ * Its possible that we get into this path
+ * When populate_msi_sysfs fails, which means the entries
+ * were not registered with sysfs. In that case don't
+ * unregister them.
+ */
+ if (...
2018 Jan 15
1
[RFC PATCH v2 1/5] iommu: Add virtio-iommu driver
...q = virtqueue_get_buf(viommu->vq, &len)) != NULL) {
> + if (req != pending) {
> + dev_warn(viommu->dev, "discarding stale request\n");
> + continue;
> + }
> +
> + pending->written = len;
> +
> + if (++nr_received == nr_sent) {
> + WARN_ON(!list_is_last(&pending->list, sent));
> + break;
> + } else if (WARN_ON(list_is_last(&pending->list, sent))) {
> + break;
> + }
> +
> + pending = list_next_entry(pending, list);
> + }
> +
> + return nr_received;
> +}
> +
> +/* Must be called with request_l...
2014 Aug 20
1
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
...i_attrib.multiple;
> + for (i = 0; i < nvec; i++)
> + BUG_ON(irq_has_action(entry->irq + i));
> + }
> +
> + arch_teardown_msi_irqs(msi);
> +
> + list_for_each_entry_safe(entry, tmp, &msi->msi_list, list) {
> + if (entry->msi_attrib.is_msix) {
> + if (list_is_last(&entry->list, &msi->msi_list))
> + iounmap(entry->mask_base);
> + }
> +
> + /*
> + * Its possible that we get into this path
> + * When populate_msi_sysfs fails, which means the entries
> + * were not registered with sysfs. In that case don't
&g...
2014 Aug 20
1
[RFC PATCH 10/11] PCI/MSI: Split the generic MSI code into new file
...i_attrib.multiple;
> + for (i = 0; i < nvec; i++)
> + BUG_ON(irq_has_action(entry->irq + i));
> + }
> +
> + arch_teardown_msi_irqs(msi);
> +
> + list_for_each_entry_safe(entry, tmp, &msi->msi_list, list) {
> + if (entry->msi_attrib.is_msix) {
> + if (list_is_last(&entry->list, &msi->msi_list))
> + iounmap(entry->mask_base);
> + }
> +
> + /*
> + * Its possible that we get into this path
> + * When populate_msi_sysfs fails, which means the entries
> + * were not registered with sysfs. In that case don't
&g...
2017 Nov 17
11
[RFC PATCH v2 0/5] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.5 of the
specification [1]. Previous version of this code was sent back in April
[2], implementing the first public RFC. Since then there has been lots of
progress and discussion on the specification side, and I think the driver
is in a good shape now.
The reason patches 1-3 are only RFC is that I'm waiting on feedback from
the Virtio TC
2017 Nov 17
11
[RFC PATCH v2 0/5] Add virtio-iommu driver
Implement the virtio-iommu driver following version 0.5 of the
specification [1]. Previous version of this code was sent back in April
[2], implementing the first public RFC. Since then there has been lots of
progress and discussion on the specification side, and I think the driver
is in a good shape now.
The reason patches 1-3 are only RFC is that I'm waiting on feedback from
the Virtio TC
2014 Jul 26
20
[RFC PATCH 00/11] Refactor MSI to support Non-PCI device
Hi all,
The series is a draft of generic MSI driver that supports PCI
and Non-PCI device which have MSI capability. If you're not interested
it, sorry for the noise.
The series is based on Linux-3.16-rc1.
MSI was introduced in PCI Spec 2.2. Currently, kernel MSI
driver codes are bonding with PCI device. Because MSI has a lot
advantages in design. More and more non-PCI devices want to
use
2014 Jul 26
20
[RFC PATCH 00/11] Refactor MSI to support Non-PCI device
Hi all,
The series is a draft of generic MSI driver that supports PCI
and Non-PCI device which have MSI capability. If you're not interested
it, sorry for the noise.
The series is based on Linux-3.16-rc1.
MSI was introduced in PCI Spec 2.2. Currently, kernel MSI
driver codes are bonding with PCI device. Because MSI has a lot
advantages in design. More and more non-PCI devices want to
use