Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153891
b: refs/heads/master
c: d888a4c
h: refs/heads/master
i:
  153889: 2d41f51
  153887: 61a167e
v: v3
  • Loading branch information
Linus Torvalds committed Jun 23, 2009
1 parent 8948496 commit 1bd5c10
Show file tree
Hide file tree
Showing 33 changed files with 2,798 additions and 407 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 42b86e06c7db365f1947dda9b75317cbb3c9fb5b
refs/heads/master: d888a4c76c51092993643f8992bf55b3c28da483
1 change: 1 addition & 0 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ and is between 256 and 4096 characters. It is defined in the file
nomerge
forcesac
soft
pt [x86, IA64]

io7= [HW] IO7 for Marvel based alpha systems
See comment before marvel_specify_io7 in
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/ia64/include/asm/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ extern void pci_iommu_shutdown(void);
extern void no_iommu_init(void);
extern int force_iommu, no_iommu;
extern int iommu_detected;
#ifdef CONFIG_DMAR
extern int iommu_pass_through;
#else
#define iommu_pass_through (0)
#endif
extern void iommu_dma_init(void);
extern void machvec_init(const char *name);

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/ia64/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ int force_iommu __read_mostly = 1;
int force_iommu __read_mostly;
#endif

int iommu_pass_through;

/* Dummy device used for NULL arguments (normally ISA). Better would
be probably a smaller DMA mask, but this is bug-to-bug compatible
to i386. */
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ia64/kernel/pci-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void __init swiotlb_dma_init(void)

void __init pci_swiotlb_init(void)
{
if (!iommu_detected) {
if (!iommu_detected || iommu_pass_through) {
#ifdef CONFIG_IA64_GENERIC
swiotlb = 1;
printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/include/asm/iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ extern void no_iommu_init(void);
extern struct dma_map_ops nommu_dma_ops;
extern int force_iommu, no_iommu;
extern int iommu_detected;
extern int iommu_pass_through;

/* 10 seconds */
#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000)
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/pci-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ int no_iommu __read_mostly;
/* Set this to 1 if there is a HW IOMMU in the system */
int iommu_detected __read_mostly = 0;

int iommu_pass_through;

dma_addr_t bad_dma_address __read_mostly = 0;
EXPORT_SYMBOL(bad_dma_address);

Expand Down Expand Up @@ -209,6 +211,10 @@ static __init int iommu_setup(char *p)
#ifdef CONFIG_SWIOTLB
if (!strncmp(p, "soft", 4))
swiotlb = 1;
if (!strncmp(p, "pt", 2)) {
iommu_pass_through = 1;
return 1;
}
#endif

gart_parse_options(p);
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/x86/kernel/pci-swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ void __init pci_swiotlb_init(void)
{
/* don't initialize swiotlb if iommu=off (no_iommu=1) */
#ifdef CONFIG_X86_64
if (!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN)
if ((!iommu_detected && !no_iommu && max_pfn > MAX_DMA32_PFN) ||
iommu_pass_through)
swiotlb = 1;
#endif
if (swiotlb_force)
Expand Down
60 changes: 34 additions & 26 deletions trunk/drivers/firewire/Kconfig
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
comment "A new alternative FireWire stack is available with EXPERIMENTAL=y"
depends on EXPERIMENTAL=n

comment "Enable only one of the two stacks, unless you know what you are doing"
depends on EXPERIMENTAL
comment "You can enable one or both FireWire driver stacks."
comment "See the help texts for more information."

config FIREWIRE
tristate "New FireWire stack, EXPERIMENTAL"
depends on EXPERIMENTAL
tristate "FireWire driver stack"
select CRC_ITU_T
help
This is the "Juju" FireWire stack, a new alternative implementation
designed for robustness and simplicity. You can build either this
stack, or the old stack (the ieee1394 driver, ohci1394 etc.) or both.
Please read http://ieee1394.wiki.kernel.org/index.php/Juju_Migration
before you enable the new stack.
This is the new-generation IEEE 1394 (FireWire) driver stack
a.k.a. Juju, a new implementation designed for robustness and
simplicity.
See http://ieee1394.wiki.kernel.org/index.php/Juju_Migration
for information about migration from the older Linux 1394 stack
to the new driver stack.

To compile this driver as a module, say M here: the module will be
called firewire-core.

This module functionally replaces ieee1394, raw1394, and video1394.
To access it from application programs, you generally need at least
libraw1394 version 2. IIDC/DCAM applications also need libdc1394
version 2. No libraries are required to access storage devices
through the firewire-sbp2 driver.
libraw1394 v2. IIDC/DCAM applications need libdc1394 v2.
No libraries are required to access storage devices through the
firewire-sbp2 driver.

NOTE:
FireWire audio devices currently require the old drivers (ieee1394,
ohci1394, raw1394).

config FIREWIRE_OHCI
tristate "OHCI-1394 controllers"
Expand All @@ -37,11 +38,9 @@ config FIREWIRE_OHCI
stack.

NOTE:

You should only build either firewire-ohci or the old ohci1394 driver,
but not both. If you nevertheless want to install both, you should
configure them only as modules and blacklist the driver(s) which you
don't want to have auto-loaded. Add either
If you want to install firewire-ohci and ohci1394 together, you
should configure them only as modules and blacklist the driver(s)
which you don't want to have auto-loaded. Add either

blacklist firewire-ohci
or
Expand All @@ -50,12 +49,7 @@ config FIREWIRE_OHCI
blacklist dv1394

to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf
depending on your distribution. The latter two modules should be
blacklisted together with ohci1394 because they depend on ohci1394.

If you have an old modprobe which doesn't implement the blacklist
directive, use "install modulename /bin/true" for the modules to be
blacklisted.
depending on your distribution.

config FIREWIRE_OHCI_DEBUG
bool
Expand All @@ -77,3 +71,17 @@ config FIREWIRE_SBP2

You should also enable support for disks, CD-ROMs, etc. in the SCSI
configuration section.

config FIREWIRE_NET
tristate "IP networking over 1394 (EXPERIMENTAL)"
depends on FIREWIRE && INET && EXPERIMENTAL
help
This enables IPv4 over IEEE 1394, providing IP connectivity with
other implementations of RFC 2734 as found on several operating
systems. Multicast support is currently limited.

NOTE, this driver is not stable yet!

To compile this driver as a module, say M here: The module will be
called firewire-net. It replaces eth1394 of the classic IEEE 1394
stack.
4 changes: 3 additions & 1 deletion trunk/drivers/firewire/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ firewire-core-y += core-card.o core-cdev.o core-device.o \
core-iso.o core-topology.o core-transaction.o
firewire-ohci-y += ohci.o
firewire-sbp2-y += sbp2.o
firewire-net-y += net.o

obj-$(CONFIG_FIREWIRE) += firewire-core.o
obj-$(CONFIG_FIREWIRE) += firewire-core.o
obj-$(CONFIG_FIREWIRE_OHCI) += firewire-ohci.o
obj-$(CONFIG_FIREWIRE_SBP2) += firewire-sbp2.o
obj-$(CONFIG_FIREWIRE_NET) += firewire-net.o
20 changes: 13 additions & 7 deletions trunk/drivers/firewire/core-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ int fw_core_add_descriptor(struct fw_descriptor *desc)

return 0;
}
EXPORT_SYMBOL(fw_core_add_descriptor);

void fw_core_remove_descriptor(struct fw_descriptor *desc)
{
Expand All @@ -189,6 +190,7 @@ void fw_core_remove_descriptor(struct fw_descriptor *desc)

mutex_unlock(&card_mutex);
}
EXPORT_SYMBOL(fw_core_remove_descriptor);

static void allocate_broadcast_channel(struct fw_card *card, int generation)
{
Expand Down Expand Up @@ -459,11 +461,11 @@ EXPORT_SYMBOL(fw_card_add);


/*
* The next few functions implements a dummy driver that use once a
* card driver shuts down an fw_card. This allows the driver to
* cleanly unload, as all IO to the card will be handled by the dummy
* driver instead of calling into the (possibly) unloaded module. The
* dummy driver just fails all IO.
* The next few functions implement a dummy driver that is used once a card
* driver shuts down an fw_card. This allows the driver to cleanly unload,
* as all IO to the card will be handled (and failed) by the dummy driver
* instead of calling into the module. Only functions for iso context
* shutdown still need to be provided by the card driver.
*/

static int dummy_enable(struct fw_card *card, u32 *config_rom, size_t length)
Expand Down Expand Up @@ -510,7 +512,7 @@ static int dummy_enable_phys_dma(struct fw_card *card,
return -ENODEV;
}

static struct fw_card_driver dummy_driver = {
static const struct fw_card_driver dummy_driver_template = {
.enable = dummy_enable,
.update_phy_reg = dummy_update_phy_reg,
.set_config_rom = dummy_set_config_rom,
Expand All @@ -529,6 +531,8 @@ void fw_card_release(struct kref *kref)

void fw_core_remove_card(struct fw_card *card)
{
struct fw_card_driver dummy_driver = dummy_driver_template;

card->driver->update_phy_reg(card, 4,
PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
fw_core_initiate_bus_reset(card, 1);
Expand All @@ -537,7 +541,9 @@ void fw_core_remove_card(struct fw_card *card)
list_del_init(&card->link);
mutex_unlock(&card_mutex);

/* Set up the dummy driver. */
/* Switch off most of the card driver interface. */
dummy_driver.free_iso_context = card->driver->free_iso_context;
dummy_driver.stop_iso = card->driver->stop_iso;
card->driver = &dummy_driver;

fw_destroy_nodes(card);
Expand Down
11 changes: 9 additions & 2 deletions trunk/drivers/firewire/core-iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
for (j = 0; j < i; j++) {
address = page_private(buffer->pages[j]);
dma_unmap_page(card->device, address,
PAGE_SIZE, DMA_TO_DEVICE);
PAGE_SIZE, direction);
__free_page(buffer->pages[j]);
}
kfree(buffer->pages);
Expand All @@ -80,6 +80,7 @@ int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,

return -ENOMEM;
}
EXPORT_SYMBOL(fw_iso_buffer_init);

int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma)
{
Expand Down Expand Up @@ -107,13 +108,14 @@ void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
for (i = 0; i < buffer->page_count; i++) {
address = page_private(buffer->pages[i]);
dma_unmap_page(card->device, address,
PAGE_SIZE, DMA_TO_DEVICE);
PAGE_SIZE, buffer->direction);
__free_page(buffer->pages[i]);
}

kfree(buffer->pages);
buffer->pages = NULL;
}
EXPORT_SYMBOL(fw_iso_buffer_destroy);

struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
int type, int channel, int speed, size_t header_size,
Expand All @@ -136,19 +138,22 @@ struct fw_iso_context *fw_iso_context_create(struct fw_card *card,

return ctx;
}
EXPORT_SYMBOL(fw_iso_context_create);

void fw_iso_context_destroy(struct fw_iso_context *ctx)
{
struct fw_card *card = ctx->card;

card->driver->free_iso_context(ctx);
}
EXPORT_SYMBOL(fw_iso_context_destroy);

int fw_iso_context_start(struct fw_iso_context *ctx,
int cycle, int sync, int tags)
{
return ctx->card->driver->start_iso(ctx, cycle, sync, tags);
}
EXPORT_SYMBOL(fw_iso_context_start);

int fw_iso_context_queue(struct fw_iso_context *ctx,
struct fw_iso_packet *packet,
Expand All @@ -159,11 +164,13 @@ int fw_iso_context_queue(struct fw_iso_context *ctx,

return card->driver->queue_iso(ctx, packet, buffer, payload);
}
EXPORT_SYMBOL(fw_iso_context_queue);

int fw_iso_context_stop(struct fw_iso_context *ctx)
{
return ctx->card->driver->stop_iso(ctx);
}
EXPORT_SYMBOL(fw_iso_context_stop);

/*
* Isochronous bus resource management (channels, bandwidth), client side
Expand Down
Loading

0 comments on commit 1bd5c10

Please sign in to comment.