Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350823
b: refs/heads/master
c: 805d410
h: refs/heads/master
i:
  350821: ae80680
  350819: 825f4fe
  350815: bb606af
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 3, 2013
1 parent 3e84cf4 commit 6b49786
Show file tree
Hide file tree
Showing 3,036 changed files with 28,882 additions and 67,106 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b3cdda2b4f541439ca4205793040aa2e1c852e3b
refs/heads/master: 805d410fb0dbd65e1a57a810858fa2491e75822d

This file was deleted.

47 changes: 0 additions & 47 deletions trunk/Documentation/ABI/testing/sysfs-platform-ts5500

This file was deleted.

6 changes: 3 additions & 3 deletions trunk/Documentation/DocBook/media/v4l/driver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ my_suspend (struct pci_dev * pci_dev,
return 0; /* a negative value on error, 0 on success. */
}
static void
static void __devexit
my_remove (struct pci_dev * pci_dev)
{
my_device *my = pci_get_drvdata (pci_dev);
/* Describe me. */
}
static int
static int __devinit
my_probe (struct pci_dev * pci_dev,
const struct pci_device_id * pci_id)
{
Expand Down Expand Up @@ -157,7 +157,7 @@ my_pci_driver = {
.id_table = my_pci_device_ids,
.probe = my_probe,
.remove = my_remove,
.remove = __devexit_p (my_remove),
/* Power management functions. */
.suspend = my_suspend,
Expand Down
37 changes: 5 additions & 32 deletions trunk/Documentation/PCI/MSI-HOWTO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,42 +127,15 @@ on the number of vectors that can be allocated; pci_enable_msi_block()
returns as soon as it finds any constraint that doesn't allow the
call to succeed.

4.2.3 pci_enable_msi_block_auto

int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *count)

This variation on pci_enable_msi() call allows a device driver to request
the maximum possible number of MSIs. The MSI specification only allows
interrupts to be allocated in powers of two, up to a maximum of 2^5 (32).

If this function returns a positive number, it indicates that it has
succeeded and the returned value is the number of allocated interrupts. In
this case, the function enables MSI on this device and updates dev->irq to
be the lowest of the new interrupts assigned to it. The other interrupts
assigned to the device are in the range dev->irq to dev->irq + returned
value - 1.

If this function returns a negative number, it indicates an error and
the driver should not attempt to request any more MSI interrupts for
this device.

If the device driver needs to know the number of interrupts the device
supports it can pass the pointer count where that number is stored. The
device driver must decide what action to take if pci_enable_msi_block_auto()
succeeds, but returns a value less than the number of interrupts supported.
If the device driver does not need to know the number of interrupts
supported, it can set the pointer count to NULL.

4.2.4 pci_disable_msi
4.2.3 pci_disable_msi

void pci_disable_msi(struct pci_dev *dev)

This function should be used to undo the effect of pci_enable_msi() or
pci_enable_msi_block() or pci_enable_msi_block_auto(). Calling it restores
dev->irq to the pin-based interrupt number and frees the previously
allocated message signaled interrupt(s). The interrupt may subsequently be
assigned to another device, so drivers should not cache the value of
dev->irq.
pci_enable_msi_block(). Calling it restores dev->irq to the pin-based
interrupt number and frees the previously allocated message signaled
interrupt(s). The interrupt may subsequently be assigned to another
device, so drivers should not cache the value of dev->irq.

Before calling this function, a device driver must always call free_irq()
on any interrupt for which it previously called request_irq().
Expand Down
6 changes: 3 additions & 3 deletions trunk/Documentation/PCI/pci-iov-howto.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ To notify SR-IOV core of Virtual Function Migration:

Following piece of code illustrates the usage of the SR-IOV API.

static int dev_probe(struct pci_dev *dev, const struct pci_device_id *id)
static int __devinit dev_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
pci_enable_sriov(dev, NR_VIRTFN);

Expand All @@ -85,7 +85,7 @@ static int dev_probe(struct pci_dev *dev, const struct pci_device_id *id)
return 0;
}

static void dev_remove(struct pci_dev *dev)
static void __devexit dev_remove(struct pci_dev *dev)
{
pci_disable_sriov(dev);

Expand Down Expand Up @@ -131,7 +131,7 @@ static struct pci_driver dev_driver = {
.name = "SR-IOV Physical Function driver",
.id_table = dev_id_table,
.probe = dev_probe,
.remove = dev_remove,
.remove = __devexit_p(dev_remove),
.suspend = dev_suspend,
.resume = dev_resume,
.shutdown = dev_shutdown,
Expand Down
20 changes: 20 additions & 0 deletions trunk/Documentation/PCI/pci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,33 @@ Please mark the initialization and cleanup functions where appropriate
initializes.
__exit Exit code. Ignored for non-modular drivers.


__devinit Device initialization code.
Identical to __init if the kernel is not compiled
with CONFIG_HOTPLUG, normal function otherwise.
__devexit The same for __exit.

Tips on when/where to use the above attributes:
o The module_init()/module_exit() functions (and all
initialization functions called _only_ from these)
should be marked __init/__exit.

o Do not mark the struct pci_driver.

o The ID table array should be marked __devinitconst; this is done
automatically if the table is declared with DEFINE_PCI_DEVICE_TABLE().

o The probe() and remove() functions should be marked __devinit
and __devexit respectively. All initialization functions
exclusively called by the probe() routine, can be marked __devinit.
Ditto for remove() and __devexit.

o If mydriver_remove() is marked with __devexit(), then all address
references to mydriver_remove must use __devexit_p(mydriver_remove)
(in the struct pci_driver declaration for example).
__devexit_p() will generate the function name _or_ NULL if the
function will be discarded. For an example, see drivers/net/tg3.c.

o Do NOT mark a function if you are not sure which mark to use.
Better to not mark the function than mark the function wrong.

Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/acpi/enumeration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ input driver:
.acpi_match_table ACPI_PTR(mpu3050_acpi_match),
},
.probe = mpu3050_probe,
.remove = mpu3050_remove,
.remove = __devexit_p(mpu3050_remove),
.id_table = mpu3050_ids,
};

Expand Down
2 changes: 0 additions & 2 deletions trunk/Documentation/atomic_ops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@ This performs an atomic exchange operation on the atomic variable v, setting
the given new value. It returns the old value that the atomic variable v had
just before the operation.

atomic_xchg requires explicit memory barriers around the operation.

int atomic_cmpxchg(atomic_t *v, int old, int new);

This performs an atomic compare exchange operation on the atomic value v,
Expand Down
2 changes: 2 additions & 0 deletions trunk/Documentation/cgroups/00-INDEX
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ blkio-controller.txt
- Description for Block IO Controller, implementation and usage details.
cgroups.txt
- Control Groups definition, implementation details, examples and API.
cgroup_event_listener.c
- A user program for cgroup listener.
cpuacct.txt
- CPU Accounting Controller; account CPU usage for groups of tasks.
cpusets.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include <assert.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
Expand All @@ -16,7 +15,7 @@

#include <sys/eventfd.h>

#define USAGE_STR "Usage: cgroup_event_listener <path-to-control-file> <args>"
#define USAGE_STR "Usage: cgroup_event_listener <path-to-control-file> <args>\n"

int main(int argc, char **argv)
{
Expand All @@ -27,33 +26,49 @@ int main(int argc, char **argv)
char line[LINE_MAX];
int ret;

if (argc != 3)
errx(1, "%s", USAGE_STR);
if (argc != 3) {
fputs(USAGE_STR, stderr);
return 1;
}

cfd = open(argv[1], O_RDONLY);
if (cfd == -1)
err(1, "Cannot open %s", argv[1]);
if (cfd == -1) {
fprintf(stderr, "Cannot open %s: %s\n", argv[1],
strerror(errno));
goto out;
}

ret = snprintf(event_control_path, PATH_MAX, "%s/cgroup.event_control",
dirname(argv[1]));
if (ret >= PATH_MAX)
errx(1, "Path to cgroup.event_control is too long");
if (ret >= PATH_MAX) {
fputs("Path to cgroup.event_control is too long\n", stderr);
goto out;
}

event_control = open(event_control_path, O_WRONLY);
if (event_control == -1)
err(1, "Cannot open %s", event_control_path);
if (event_control == -1) {
fprintf(stderr, "Cannot open %s: %s\n", event_control_path,
strerror(errno));
goto out;
}

efd = eventfd(0, 0);
if (efd == -1)
err(1, "eventfd() failed");
if (efd == -1) {
perror("eventfd() failed");
goto out;
}

ret = snprintf(line, LINE_MAX, "%d %d %s", efd, cfd, argv[2]);
if (ret >= LINE_MAX)
errx(1, "Arguments string is too long");
if (ret >= LINE_MAX) {
fputs("Arguments string is too long\n", stderr);
goto out;
}

ret = write(event_control, line, strlen(line) + 1);
if (ret == -1)
err(1, "Cannot write to cgroup.event_control");
if (ret == -1) {
perror("Cannot write to cgroup.event_control");
goto out;
}

while (1) {
uint64_t result;
Expand All @@ -62,21 +77,34 @@ int main(int argc, char **argv)
if (ret == -1) {
if (errno == EINTR)
continue;
err(1, "Cannot read from eventfd");
perror("Cannot read from eventfd");
break;
}
assert(ret == sizeof(result));

ret = access(event_control_path, W_OK);
if ((ret == -1) && (errno == ENOENT)) {
puts("The cgroup seems to have removed.");
break;
puts("The cgroup seems to have removed.");
ret = 0;
break;
}

if (ret == -1)
err(1, "cgroup.event_control is not accessible any more");
if (ret == -1) {
perror("cgroup.event_control "
"is not accessible any more");
break;
}

printf("%s %s: crossed\n", argv[1], argv[2]);
}

return 0;
out:
if (efd >= 0)
close(efd);
if (event_control >= 0)
close(event_control);
if (cfd >= 0)
close(cfd);

return (ret != 0);
}
Loading

0 comments on commit 6b49786

Please sign in to comment.