* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
@ 2002-02-19 17:05 Pete Zaitcev
2002-02-19 19:31 ` Doug Ledford
0 siblings, 1 reply; 25+ messages in thread
From: Pete Zaitcev @ 2002-02-19 17:05 UTC (permalink / raw)
To: linux-kernel; +Cc: dledford, zaitcev
> From: Linus Torvalds <torvalds@transmeta.com>
> Date: 2002-02-13 16:47:33
> Subject: Re: PATCH 2.5.4 i810_audio, bttv, working at all.
> On Wed, 13 Feb 2002, Jeff Garzik wrote:
> >
> > These changes are wrong. The addresses desired need to be obtained from
> > the pci_alloc_consistent return values.
>
> Let's face it, people won't care about the complex PCI interfaces unless
> they give you something useful.
I cannot believe that I am reading that. The pinhead penguin
is totally off the thread. The fix for i810 took me less than
10 minutes, and it works perfectly! What the hell are you
talking about here? What complex interfaces?! Is this a list
for kernel programmers or milksuckers? The interface is
simple as a pancake!
-- Pete
P.S. Doug, for heaven's sake, push the fix upstrem ASAP, please.
I cannot stand this stupidity and incompetence anymore.
P.P.S. Posting this FOR THE THIRD TIME in reply for a broken
patch. Next guy to post a broken "fix" for i810 with
isa_virt_to_bus or virt_to_phis may suffer very badly.
--- linux-2.5.3/drivers/sound/i810_audio.c Mon Jan 28 14:35:13 2002
+++ linux-2.5.3-p3/drivers/sound/i810_audio.c Fri Feb 8 16:24:05 2002
@@ -335,7 +335,6 @@
struct i810_card {
- struct i810_channel channel[3];
unsigned int magic;
/* We keep i810 cards in a linked list */
@@ -359,6 +358,8 @@
/* structures for abstraction of hardware facilities, codecs, banks and channels*/
struct ac97_codec *ac97_codec[NR_AC97];
struct i810_state *states[NR_HW_CH];
+ struct i810_channel *channel; /* 1:1 to states[] but diff. lifetime */
+ dma_addr_t chandma;
u16 ac97_features;
u16 ac97_status;
@@ -939,7 +940,7 @@
for(i=0;i<dmabuf->numfrag;i++)
{
- sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
+ sg->busaddr=(u32)dmabuf->dma_handle+dmabuf->fragsize*i;
// the card will always be doing 16bit stereo
sg->control=dmabuf->fragsamples;
if(state->card->pci_id == PCI_DEVICE_ID_SI_7012)
@@ -954,7 +955,9 @@
}
spin_lock_irqsave(&state->card->lock, flags);
outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outl((u32)state->card->chandma +
+ c->num*sizeof(struct i810_channel),
+ state->card->iobase+c->port+OFF_BDBAR);
outb(0, state->card->iobase+c->port+OFF_CIV);
outb(0, state->card->iobase+c->port+OFF_LVI);
@@ -1669,7 +1672,7 @@
if (size > (PAGE_SIZE << dmabuf->buforder))
goto out;
ret = -EAGAIN;
- if (remap_page_range(vma->vm_start, virt_to_phys(dmabuf->rawbuf),
+ if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf),
size, vma->vm_page_prot))
goto out;
dmabuf->mapped = 1;
@@ -1722,7 +1725,9 @@
}
if (c != NULL) {
outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outl((u32)state->card->chandma +
+ c->num*sizeof(struct i810_channel),
+ state->card->iobase+c->port+OFF_BDBAR);
outb(0, state->card->iobase+c->port+OFF_CIV);
outb(0, state->card->iobase+c->port+OFF_LVI);
}
@@ -2881,15 +2886,26 @@
card->alloc_rec_pcm_channel = i810_alloc_rec_pcm_channel;
card->alloc_rec_mic_channel = i810_alloc_rec_mic_channel;
card->free_pcm_channel = i810_free_pcm_channel;
- card->channel[0].offset = 0;
- card->channel[0].port = 0x00;
- card->channel[0].num=0;
- card->channel[1].offset = 0;
- card->channel[1].port = 0x10;
- card->channel[1].num=1;
- card->channel[2].offset = 0;
- card->channel[2].port = 0x20;
- card->channel[2].num=2;
+
+ if ((card->channel = pci_alloc_consistent(pci_dev,
+ sizeof(struct i810_channel)*NR_HW_CH, &card->chandma)) == NULL) {
+ printk(KERN_ERR "i810: cannot allocate channel DMA memory\n");
+ goto out_mem;
+ }
+
+ { /* We may dispose of this altogether some time soon, so... */
+ struct i810_channel *cp = card->channel;
+
+ cp[0].offset = 0;
+ cp[0].port = 0x00;
+ cp[0].num = 0;
+ cp[1].offset = 0;
+ cp[1].port = 0x10;
+ cp[1].num = 1;
+ cp[2].offset = 0;
+ cp[2].port = 0x20;
+ cp[2].num = 2;
+ }
/* claim our iospace and irq */
request_region(card->iobase, 64, card_names[pci_id->driver_data]);
@@ -2900,8 +2916,7 @@
printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq);
release_region(card->iobase, 64);
release_region(card->ac97base, 256);
- kfree(card);
- return -ENODEV;
+ goto out_chan;
}
/* initialize AC97 codec and register /dev/mixer */
@@ -2909,8 +2924,7 @@
release_region(card->iobase, 64);
release_region(card->ac97base, 256);
free_irq(card->irq, card);
- kfree(card);
- return -ENODEV;
+ goto out_chan;
}
pci_set_drvdata(pci_dev, card);
@@ -2931,11 +2945,17 @@
unregister_sound_mixer(card->ac97_codec[i]->dev_mixer);
kfree (card->ac97_codec[i]);
}
- kfree(card);
- return -ENODEV;
+ goto out_chan;
}
card->initializing = 0;
return 0;
+
+ out_chan:
+ pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH,
+ card->channel, card->chandma);
+ out_mem:
+ kfree(card);
+ return -ENODEV;
}
static void __exit i810_remove(struct pci_dev *pci_dev)
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-19 17:05 PATCH 2.5.4 i810_audio, bttv, working at all Pete Zaitcev
@ 2002-02-19 19:31 ` Doug Ledford
0 siblings, 0 replies; 25+ messages in thread
From: Doug Ledford @ 2002-02-19 19:31 UTC (permalink / raw)
To: Pete Zaitcev; +Cc: linux-kernel, Linus Torvalds, alan, Marcelo Tosatti
[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]
Pete Zaitcev wrote:
>>From: Linus Torvalds <torvalds@transmeta.com>
>>Date: 2002-02-13 16:47:33
>>Subject: Re: PATCH 2.5.4 i810_audio, bttv, working at all.
>>
>
>>On Wed, 13 Feb 2002, Jeff Garzik wrote:
>>
>>>These changes are wrong. The addresses desired need to be obtained from
>>>the pci_alloc_consistent return values.
>>>
>>Let's face it, people won't care about the complex PCI interfaces unless
>>they give you something useful.
>>
>
> I cannot believe that I am reading that. The pinhead penguin
> is totally off the thread. The fix for i810 took me less than
> 10 minutes, and it works perfectly! What the hell are you
> talking about here? What complex interfaces?! Is this a list
> for kernel programmers or milksuckers? The interface is
> simple as a pancake!
>
> -- Pete
>
> P.S. Doug, for heaven's sake, push the fix upstrem ASAP, please.
> I cannot stand this stupidity and incompetence anymore.
>
> P.P.S. Posting this FOR THE THIRD TIME in reply for a broken
> patch. Next guy to post a broken "fix" for i810 with
> isa_virt_to_bus or virt_to_phis may suffer very badly.
I agree that the patch is the correct fix. All except for the line changing
the remap_page_range() call it's also totally relevant to the 2.4 kernel driver.
--
Doug Ledford <dledford@redhat.com> http://people.redhat.com/dledford
Please check my web site for aic7xxx updates/answers before
e-mailing me about problems
[-- Attachment #2: i810-2.5.3-p3.patch --]
[-- Type: text/plain, Size: 4154 bytes --]
--- linux-2.5.3/drivers/sound/i810_audio.c Mon Jan 28 14:35:13 2002
+++ linux-2.5.3-p3/drivers/sound/i810_audio.c Fri Feb 8 16:24:05 2002
@@ -335,7 +335,6 @@
struct i810_card {
- struct i810_channel channel[3];
unsigned int magic;
/* We keep i810 cards in a linked list */
@@ -359,6 +358,8 @@
/* structures for abstraction of hardware facilities, codecs, banks and channels*/
struct ac97_codec *ac97_codec[NR_AC97];
struct i810_state *states[NR_HW_CH];
+ struct i810_channel *channel; /* 1:1 to states[] but diff. lifetime */
+ dma_addr_t chandma;
u16 ac97_features;
u16 ac97_status;
@@ -939,7 +940,7 @@
for(i=0;i<dmabuf->numfrag;i++)
{
- sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
+ sg->busaddr=(u32)dmabuf->dma_handle+dmabuf->fragsize*i;
// the card will always be doing 16bit stereo
sg->control=dmabuf->fragsamples;
if(state->card->pci_id == PCI_DEVICE_ID_SI_7012)
@@ -954,7 +955,9 @@
}
spin_lock_irqsave(&state->card->lock, flags);
outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outl((u32)state->card->chandma +
+ c->num*sizeof(struct i810_channel),
+ state->card->iobase+c->port+OFF_BDBAR);
outb(0, state->card->iobase+c->port+OFF_CIV);
outb(0, state->card->iobase+c->port+OFF_LVI);
@@ -1669,7 +1672,7 @@
if (size > (PAGE_SIZE << dmabuf->buforder))
goto out;
ret = -EAGAIN;
- if (remap_page_range(vma->vm_start, virt_to_phys(dmabuf->rawbuf),
+ if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf),
size, vma->vm_page_prot))
goto out;
dmabuf->mapped = 1;
@@ -1722,7 +1725,9 @@
}
if (c != NULL) {
outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outl((u32)state->card->chandma +
+ c->num*sizeof(struct i810_channel),
+ state->card->iobase+c->port+OFF_BDBAR);
outb(0, state->card->iobase+c->port+OFF_CIV);
outb(0, state->card->iobase+c->port+OFF_LVI);
}
@@ -2881,15 +2886,26 @@
card->alloc_rec_pcm_channel = i810_alloc_rec_pcm_channel;
card->alloc_rec_mic_channel = i810_alloc_rec_mic_channel;
card->free_pcm_channel = i810_free_pcm_channel;
- card->channel[0].offset = 0;
- card->channel[0].port = 0x00;
- card->channel[0].num=0;
- card->channel[1].offset = 0;
- card->channel[1].port = 0x10;
- card->channel[1].num=1;
- card->channel[2].offset = 0;
- card->channel[2].port = 0x20;
- card->channel[2].num=2;
+
+ if ((card->channel = pci_alloc_consistent(pci_dev,
+ sizeof(struct i810_channel)*NR_HW_CH, &card->chandma)) == NULL) {
+ printk(KERN_ERR "i810: cannot allocate channel DMA memory\n");
+ goto out_mem;
+ }
+
+ { /* We may dispose of this altogether some time soon, so... */
+ struct i810_channel *cp = card->channel;
+
+ cp[0].offset = 0;
+ cp[0].port = 0x00;
+ cp[0].num = 0;
+ cp[1].offset = 0;
+ cp[1].port = 0x10;
+ cp[1].num = 1;
+ cp[2].offset = 0;
+ cp[2].port = 0x20;
+ cp[2].num = 2;
+ }
/* claim our iospace and irq */
request_region(card->iobase, 64, card_names[pci_id->driver_data]);
@@ -2900,8 +2916,7 @@
printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq);
release_region(card->iobase, 64);
release_region(card->ac97base, 256);
- kfree(card);
- return -ENODEV;
+ goto out_chan;
}
/* initialize AC97 codec and register /dev/mixer */
@@ -2909,8 +2924,7 @@
release_region(card->iobase, 64);
release_region(card->ac97base, 256);
free_irq(card->irq, card);
- kfree(card);
- return -ENODEV;
+ goto out_chan;
}
pci_set_drvdata(pci_dev, card);
@@ -2931,11 +2945,17 @@
unregister_sound_mixer(card->ac97_codec[i]->dev_mixer);
kfree (card->ac97_codec[i]);
}
- kfree(card);
- return -ENODEV;
+ goto out_chan;
}
card->initializing = 0;
return 0;
+
+ out_chan:
+ pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH,
+ card->channel, card->chandma);
+ out_mem:
+ kfree(card);
+ return -ENODEV;
}
static void __exit i810_remove(struct pci_dev *pci_dev)
^ permalink raw reply [flat|nested] 25+ messages in thread
* A modest proposal -- We need a patch penguin
@ 2002-01-28 14:10 Rob Landley
2002-01-29 1:37 ` Francesco Munda
0 siblings, 1 reply; 25+ messages in thread
From: Rob Landley @ 2002-01-28 14:10 UTC (permalink / raw)
To: linux-kernel; +Cc: torvalds, Alan Cox, Dave Jones, esr
Patch Penguin Proposal.
1) Executive summary.
2) The problem.
3) The solution.
4) Ramifications.
-- Executive summary.
Okay everybody, this is getting rediculous. Patches FROM MAINTAINERS are
getting dropped on the floor on a regular basis. This is burning out
maintainers and is increasing the number of different kernel trees (not yet a
major fork, but a lot of cracks and fragmentation are showing under the
stress). Linus needs an integration lieutenant, and he needs one NOW.
We need to create the office of "patch penguin", whose job would be to make
Linus's life easier by doing what Alan Cox used to do, and what Dave Jones is
unofficially doing right now. (In fact, I'd like to nominate Dave Jones for
the office, although it's Linus's decision and it would be nice if Dave got
Alan Cox's blessing as well.)
And if we understand this position, and formalize it, we can make better use
of it. It can solve a lot of problems in linux development.
-- The problem.
Linus doesn't scale, and his current way of coping is to silently drop the
vast majority of patches submitted to him onto the floor. Most of the time
there is no judgement involved when this code gets dropped. Patches that fix
compile errors get dropped. Code from subsystem maintainers that Linus
himself designated gets dropped. A build of the tree now spits out numerous
easily fixable warnings, when at one time it was warning-free. Finished code
regularly goes unintegrated for months at a time, being repeatedly resynced
and re-diffed against new trees until the code's maintainer gets sick of it.
This is extremely frustrating to developers, users, and vendors, and is
burning out the maintainers. It is a huge source of unnecessary work. The
situation needs to be resolved. Fast.
If you think I'm preaching to the choir, skip to the next bit called "the
solution". If not, read on...
The Linux tree came very close to forking during 2.4. We went eleven months
without a development tree. The founding of the Functionally Overloaded Linux
Kernel project was a symptom of an enormous unintegrated patch backlog
building up pressure until at least a small fork was necessary. Even with 2.5
out, the current high number of seperate development trees accepting
third-party is still alarmingly high. Linus and Marcelo have been joined by
Dave Jones, Alan Cox, Andrea Arcangeli, Michael Cohen, and others, with
distributors maintaining their own significantly forked kernel trees as a
matter of course. Developers like Andrea, Robert Love and Rik van Riel either
distribute others' relatively unrelated patches with their patch sets, or
base their patches on other, as yet unintegrated patches for extended periods
of time.
Discussion of this problem was covered by kernel traffic and Linux Weekly
News:
http://kt.zork.net/kernel-traffic/kt20020114_150.html#5
http://lwn.net/2002/0103/kernel.php3 (search for "patch management").
During 2.4, the version skew between Alan Cox's tree and Linus's tree got as
bad as it's ever been. Several of the bug fixes in Alan's tree (which he
stopped maintaining months ago) still are not present in 2.4.17 or 2.5. Rik
van Riel has publicly complained that Linus dropped his VM patches on the
floor for several months, a contributing factor to the 2.4 VM's failure to
stabilize for almost a -YEAR- after its release. (This is a bad sign. Whether
Rik's or Andrea's VM is superior is a side issue. Alan Cox, and through him
Red Hat, got Rik's VM to work acceptably by integrating patches from that
VM's maintainer. The fact Linus didn't do as well is a symptom of this larger
problem. The kind of subsystem swapping so major it requires a new maintainer
should not be necessary during a stable series.)
Speaking of Andrea Arcangeli, he's now integrating third-party patches into
his own released development trees, because 2.5 isn't suitable to do
development against and 2.4 doesn't have existing work (like low latency)
he's trying to extend.
Andre Hedrick just had to throw a temper tantrum to get any attention paid to
his IDE patches, and he's the official IDE maintainer. Eric Raymond tells me
his help file updates have now been ignored for 33 consecutive releases
(again, he's the maintainer), and this combined with recent major changes
Linus unilaterally made to 2.5's help files (still without syncing with the
maintainer's version before doing so) has created a lot of extra and totally
unnecessary work for Eric, and he tells me it's made the version skew between
2.4 and 2.5 almost unmanageable.
Andrew Morton's lock splitting low latency work has no forseeable schedule
for inclusion, despite the fact it's needed whether or not Robert Love's
preemption patch goes in. Ingo Molnar's O(1) scheduler did go in, but that
was largely a case of good timing: it came right on the heels of a public
argument about why Linus had not accepted patches to the scheduler for
several years. The inclusion of code like JFS, XFS, and Daniel Phillips' ext2
indexing patch are left up to distributions to integrate and ship long before
they make it into Linus's tree. (Remember the software raid code in 2.2?)
These are just the patches that have persisted, how much other good work
doesn't last because its author loses interest after six months of the silent
treatment? The mere existence of the "Functionally Overloaded Linux Kernel"
(FOLK) project, to collect together as many unintegrated patches as possible,
was a warning sign that things were not going smoothly on the patch
integration front.
The release of 2.5 has helped a bit, but by no means solved the problem. Dave
Jones started his tree because 2.4 fixes Marcello had accepted were not
finding their way into 2.5. Even code like Keith Owens' new build system and
CML2, both of which Linus approved for inclusion at the Kernel summit almost
a year ago and even tentatively scheduled for before 2.5.2, are still not
integrated with no clear idea if they ever will be. (Yes Linus can change his
mind about including them, but total silence isn't the best way to indicate
this. Why leave Keith and Eric hanging, and wasting months or even years of
their time still working on code Linus may not want?)
The fact that 2.5 has "pre" releases seems suggestive of a change in mindset.
A patch now has to be widely used, tested, and recommended even to get into
2.5, yet how does the patch get such testing before it's integrated into a
buildable kernel? Chicken and egg problem there, you want more testing but
without integration each testers can test fewer patches at once.
There has even been public talk of CRON jobs to resubmit patches to Linus
periodically for as long as it takes him to get around to dealing with them.
Linus has actually endorsed this approach (provided that re-testing of the
patches against the newest release before they are remailed is also
automated). This effort has spawned a mailing list. That's just nuts. The
fact that Linus doesn't scale isn't going to be solved by increasing the
amount of mail he gets. When desperate measures are being seriously
considered, we must be in desperate times.
-- The solution.
The community needs to offload some work from Linus, so he can focus on what
he does that nobody else can. This offloading and delegation has been done
before, with the introduction of subsystem maintainers. We just need to
extend the maintainer concept to include an official and recognized
integration maintainer.
During 2.1, when Linus burned out, responsibility for various subsystems were
delegated to lieutenants to make Linus' job more manageable. Lieutenants are
maintainers of various parts of the tree who collect and clean up patches,
and make the first wave of obvious decisions ("this patch doesn't apply",
"this bit doesn't compile", "my machine panicked", "look, it's not SMP safe")
before sending tested code off to Linus. Linus still spends a lot of his time
reading and auditing code, but by increasing the average quality of the code
Linus looks at, the maintainers make his job easier. The more work
maintainers can do the less Linus has to.
So what tasks does Linus still personally do? He's an architect. He steers
the project, vetoing patches he doesn't like and suggesting changes in
direction to the developers. And he's the final integrator, pulling together
dispirate patches into one big system.
The job of architect is something only Linus can do. The job of integrator is
something many people can do. Alan Cox did it for years. Dave Jones is doing
it now, and Michael Cohen has yet another tree. Every Linux distributor has
its own tree. Integrating patches so they don't conflict and porting them to
new versions is hard work, but not brain surgery.
Linus is acting as a central collection point for patches, and patches are
getting lost on their way to that collection point. Patches as big as UML and
EXT3 were going into Alan Cox's tree during 2.4, and now new patches are
going into Dave Jones's tree to be tested out and queued for Linus.
Integration is a task that can be delegated, and it has been. In Perl's
model, Larry Wall is the benevolent dictator and architect, but integration
work is done by the current holder of the "patch pumpkin". In Linux, Alan Cox
used to be the de facto holder of the patch penguin, and now Dave Jones is
maintaining a tree which can accept and integrate patches, and then feed them
on to Linus when Linus is ready.
This system should be formalized, we need the patch penguin to become
official. The patch penguin seems to have passed from Alan Cox to Dave Jones.
If we recognize this, we can make much better use of it.
--- Ramifications.
The holder of the patch penguin's job would be to accept patches from people
other than linus, make them work together in a publicly compilable and
testable tree, and feed good patches on to Linus. This may sound simple and
obvious, but it's currenlty not happening and its noticeable by its absence.
The purpose of the patch penguin tree is to make life easier, both for Linus
and the developer community. With a designated patch collector and
integrator, Linus's job becomes easier. Linus would still maintain and
release his own kernel trees (the way he did when Alan Cox regularly fed him
patches), and Linus could still veto any patch he doesn't like (whether it
came from the patch penguin, directly from a subsystem maintainer, or
elsewhere). But Linus wouldn't be asked to act as the kernel's public CVS
tree anymore. He could focus on being the architect.
The bulk of the patch penguin's work would be to accept, integrate, and
update patches from designated subsystem maintainers, maintaining his own
tree (seperate from linus's) containing the integrated collection of pending
patches awaiting inclusion in Linus's tree. Patches submitted directly to the
patch penguin could be redirected to subsystem maintainers where appropriate,
or bounced with a message to that effect (at the patch penguin's option).
This integration and patch tracking work is a fairly boring, thankless task,
but it's work somebody other than Linus can do, which Linus has to do
otherwise. (And which Linus is NOT doing a good job at right now.)
The rest of the patch-penguin holder's job is to feed Linus patches. The
patch penguin holder's tree would fundamentally be a delta against the most
recent release from Linus (like the "-ac patches" used to be). If Linus takes
several releases to get around to looking at a new patch, the patch penguin
would resynchronize their tree with each new Linus release, doing the fixups
on the pending patch set (or bullying the source of each patch into doing
so). It would be the patch penguin's job to keep up with Linus, not the other
way around. When a change happens in Linus's tree that didn't come from the
patch penguin, the patch penguin integrates the change into their tree
automatically.
The holder of the patch penguin would feed Linus good patches, by Linus's
standards. Not just tested ones, but small bite-sized patches, one per email
as plain text includes, with an explanation of what each patch does at the
top of the mail. (Just the way Linus likes them. :) Current pending patches
from the patch penguin tree could even be kept at a public place (like
kernel.org) so Linus could pull rather than push, and grab them when he has
time. The patch penguin tree would make sure that when Linus is ready for a
patch, the patch is ready for Linus.
The patch penguin tree can act as a buffer between Linus and the flood of
patches from the field. When Linus is not ready for a patch yet, he can hold
off on taking it into his tree, and doesn't have to worry about the patch
being lost or out of date by the time he's ready to accept it. When Linus is
focusing on something like the new block I/O code, the backlog of other
patches naturally feeds into the patch penguin tree until Linus is ready to
look at them. People won't have to complain about dropped patches, and Linus
doesn't have to worry that patches haven't been tested enough before being
submitted to him. Users who want to live on the really bleeding edge have a
place to go for a kernel that's likely to break. Testers can find bugs en
masse without having to do integration work (which is in and of itself a
source of potential bugs).
Linus would still have veto power. He gets to reject any patch he doesn't
like, and can ask for the integration lieutenant to back that patch out of
the patch penguin tree. That's one big difference between the patch penguin
tree and Linus's tree: the patch penguin tree is provisional. Stuff that goes
in it can still get backed out in a version or two. Of course Linus would
have to explicitly reject a patch to get it out of the patch penguin tree,
meaning its developer stops fruitlessly re-submitting it to Linus, and maybe
even gets a quick comment from Linus as to WHY it was unacceptable so they
can fix it. (From the developer's point of view, this is a good thing. They
either get feedback of closure.)
Linus sometimes needs time off. Not just for vacations, but to focus on
specific subsections, like integrating Jens Axobe's BIO patches at the start
of 2.5. Currently, these periods hopelessly stall or tangling development.
But in Linus's absence, the patch penguin could continue to maintain a delta
against the last Linus tree, and generate a sequence of small individual
patches like a trail of bread crumbs for Linus to follow when he gets back.
Linus could take a month off, and catch back up in a fraction of that time
when he returned. (And if Linus were to get hit by a bus, the same
infrastructure would allow the community to select and support a new
architect, which might help companies like IBM sleep better at night.) And if
Linus rejected patches halfway through the bread crumb trail requiring a lot
of shuffling in later patches, well, that's more work for the patch penguin,
not more work for Linus.
One reason Linus doesn't like CVS is he won't let other people check code
into his tree. (This is not a capricious decision on Linus's part: no
architect can function if he doesn't know what's in the system. Code review
of EVERYTHING is a vital part of Linus's job.) With a patch penguin tree,
there's no more pressure on Linus to use CVS. The patch penguin can use CVS
if he wants to, and if he wants to give the subsystem maintainers commit
access to the patch penguin tree, that's his business. The patch penguin's
own internal housekeeping toolset shouldn't affect the patches he feeds on to
Linus one way or the other.
Again, Linus likes stuff tested by a wide audience before it's sent to him.
With a growing list of multiple trees maintained by Dave Jones, Alan Cox,
Michael Cohen, Andrea Arcangeli, development and testing become fragmented.
With a single patch penguin tree, the patches drain into a common pool and
the backlog of unintegrated patches can't build up dangerous amounts of
pressure to interfere with development. A single shared "pending" tree means
the largest possible group of potential testers.
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: A modest proposal -- We need a patch penguin
2002-01-28 14:10 A modest proposal -- We need a patch penguin Rob Landley
@ 2002-01-29 1:37 ` Francesco Munda
2002-01-29 3:23 ` Linus Torvalds
0 siblings, 1 reply; 25+ messages in thread
From: Francesco Munda @ 2002-01-29 1:37 UTC (permalink / raw)
To: Rob Landley; +Cc: linux-kernel
On Mon, 28 Jan 2002 09:10:56 -0500
Rob Landley <landley@trommello.org> wrote:
> Patch Penguin Proposal.
>
> [...]
You mean some sort of proxy/two-tier development? A "commit/rollback"
transaction model on the kernel itself?
I deeply agree with you, especially in keeping "many eyes" to look at the
same kernel tree, and not chosing one of the many subtrees; as added bonus,
this stuff is buzzword compliant! What we can ask more? :)
Now, Linus' call to accept _your_ patch. Fingers crossed already.
-- FM
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: A modest proposal -- We need a patch penguin
2002-01-29 1:37 ` Francesco Munda
@ 2002-01-29 3:23 ` Linus Torvalds
2002-02-13 12:10 ` PATCH 2.5.4 i810_audio, bttv, working at all Martin Dalecki
0 siblings, 1 reply; 25+ messages in thread
From: Linus Torvalds @ 2002-01-29 3:23 UTC (permalink / raw)
To: linux-kernel
In article <200201290137.g0T1bwB24120@karis.localdomain>,
Francesco Munda <syylk@libero.it> wrote:
>
>I deeply agree with you, especially in keeping "many eyes" to look at the
>same kernel tree, and not chosing one of the many subtrees; as added bonus,
>this stuff is buzzword compliant! What we can ask more? :)
Some thinking, for one thing.
One "patch penguin" scales no better than I do. In fact, I will claim
that most of them scale a whole lot worse.
The fact is, we've had "patch penguins" pretty much forever, and they
are called subsystem maintainers. They maintain their own subsystem, ie
people like David Miller (networking), Kai Germaschewski (ISDN), Greg KH
(USB), Ben Collins (firewire), Al Viro (VFS), Andrew Morton (ext3), Ingo
Molnar (scheduler), Jeff Garzik (network drivers) etc etc.
If there are problems with certain patches, it tends to be due to one or
more of:
- the subsystem is badly modularized (quite common, originally. I don't
think many people realize how _far_ Linux has come in the last five
years wrt issues like architectures, driver independence, filesystem
infrastructure etc). And it still happens.
- lack of maintainer interest. Many "maintainers" are less interested
in true merging than in trying to just push whatever code they have,
and only ever grow their patches instead of keeping them in pieces.
This is usually a matter of getting used to it, and the best people
get used to it really quickly (Andrea, for example, used to not do
this well at all, but look at how he does it now! From a merge
standpoint, his patches have gone from "horrible" to "very good")
- personality/communication issues. Yes, they happen. I've tried to
have other people be "filters" for the people I cannot work with, but
I have to say that most of the time when I can't work with somebody,
others have real problems with those people too.
(An example of a very successful situation: David Miller and Alexey
Kuznetsov: Alexey used to have these rather uncontrolled patches that
I couldn't judge or work with but that obviously had a lot of
potential, and David acting as a filter made them a very successful
team.)
In short, if you have areas or patches that you feel have had problems,
ask yourself _why_ those areas have problems.
A word of warning: good maintainers are hard to find. Getting more of
them helps, but at some point it can actually be more useful to help the
_existing_ ones. I've got about ten-twenty people I really trust, and
quite frankly, the way people work is hardcoded in our DNA. Nobody
"really trusts" hundreds of people. The way to make these things scale
out more is to increase the network of trust not by trying to push it on
me, but by making it more of a _network_, not a star-topology around me.
In short: don't try to come up with a "patch penguin". Instead try to
help existing maintainers, or maybe help grow new ones. THAT is the way
to scalability.
Linus
^ permalink raw reply [flat|nested] 25+ messages in thread
* PATCH 2.5.4 i810_audio, bttv, working at all.
2002-01-29 3:23 ` Linus Torvalds
@ 2002-02-13 12:10 ` Martin Dalecki
2002-02-13 12:35 ` Jeff Garzik
2002-02-13 13:04 ` Alan Cox
0 siblings, 2 replies; 25+ messages in thread
From: Martin Dalecki @ 2002-02-13 12:10 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
The attached 3 patches serve the following purposes:
1. Make the i810_audio.c driver working again. Well it's tested on my
private hardware.
2. Make the bttv driver work again. I know that there is a GREAT REWRITE
of this
driver underway, but still it's a bit annoying to miss the TV until
that's ready.
3. This is just fixing an obvious mistake from the final release and let's
the whole compile at all on IA32.
[-- Attachment #2: i810_audio.patch --]
[-- Type: text/plain, Size: 1616 bytes --]
diff -ur linux/drivers/sound/i810_audio.c linux-new/drivers/sound/i810_audio.c
--- linux/drivers/sound/i810_audio.c Tue Feb 12 18:32:55 2002
+++ linux-new/drivers/sound/i810_audio.c Mon Feb 11 01:34:36 2002
@@ -939,7 +939,7 @@
for(i=0;i<dmabuf->numfrag;i++)
{
- sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
+ sg->busaddr=virt_to_phys(dmabuf->rawbuf+dmabuf->fragsize*i);
// the card will always be doing 16bit stereo
sg->control=dmabuf->fragsamples;
if(state->card->pci_id == PCI_DEVICE_ID_SI_7012)
@@ -954,7 +954,7 @@
}
spin_lock_irqsave(&state->card->lock, flags);
outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outl(virt_to_phys(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
outb(0, state->card->iobase+c->port+OFF_CIV);
outb(0, state->card->iobase+c->port+OFF_LVI);
@@ -1669,7 +1669,7 @@
if (size > (PAGE_SIZE << dmabuf->buforder))
goto out;
ret = -EAGAIN;
- if (remap_page_range(vma->vm_start, virt_to_phys(dmabuf->rawbuf),
+ if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf),
size, vma->vm_page_prot))
goto out;
dmabuf->mapped = 1;
@@ -1722,7 +1722,7 @@
}
if (c != NULL) {
outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+ outl(virt_to_phys(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
outb(0, state->card->iobase+c->port+OFF_CIV);
outb(0, state->card->iobase+c->port+OFF_LVI);
}
[-- Attachment #3: bttv.patch --]
[-- Type: text/plain, Size: 10013 bytes --]
diff -ur linux/drivers/media/video/bttv-driver.c linux-new/drivers/media/video/bttv-driver.c
--- linux/drivers/media/video/bttv-driver.c Tue Feb 12 18:32:53 2002
+++ linux-new/drivers/media/video/bttv-driver.c Mon Feb 11 01:42:05 2002
@@ -166,23 +166,23 @@
return ret;
}
-static inline unsigned long uvirt_to_bus(unsigned long adr)
+static inline unsigned long uvirt_to_phys(unsigned long adr)
{
unsigned long kva, ret;
kva = uvirt_to_kva(pgd_offset(current->mm, adr), adr);
- ret = virt_to_bus((void *)kva);
+ ret = virt_to_phys((void *)kva);
MDEBUG(printk("uv2b(%lx-->%lx)", adr, ret));
return ret;
}
-static inline unsigned long kvirt_to_bus(unsigned long adr)
+static inline unsigned long kvirt_to_phys(unsigned long adr)
{
unsigned long va, kva, ret;
va = VMALLOC_VMADDR(adr);
kva = uvirt_to_kva(pgd_offset_k(va), va);
- ret = virt_to_bus((void *)kva);
+ ret = virt_to_phys((void *)kva);
MDEBUG(printk("kv2b(%lx-->%lx)", adr, ret));
return ret;
}
@@ -530,29 +530,29 @@
if (bttv_debug > 1)
printk("bttv%d: vbi1: po=%08lx pe=%08lx\n",
- btv->nr,virt_to_bus(po), virt_to_bus(pe));
+ btv->nr,virt_to_phys(po), virt_to_phys(pe));
*(po++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(po++)=0;
for (i=0; i<VBI_MAXLINES; i++)
{
*(po++)=cpu_to_le32(VBI_RISC);
- *(po++)=cpu_to_le32(kvirt_to_bus((unsigned long)btv->vbibuf+i*2048));
+ *(po++)=cpu_to_le32(kvirt_to_phys((unsigned long)btv->vbibuf+i*2048));
}
*(po++)=cpu_to_le32(BT848_RISC_JUMP);
- *(po++)=cpu_to_le32(virt_to_bus(btv->risc_jmp+4));
+ *(po++)=cpu_to_le32(virt_to_phys(btv->risc_jmp+4));
*(pe++)=cpu_to_le32(BT848_RISC_SYNC|BT848_FIFO_STATUS_FM1); *(pe++)=0;
for (i=VBI_MAXLINES; i<VBI_MAXLINES*2; i++)
{
*(pe++)=cpu_to_le32(VBI_RISC);
- *(pe++)=cpu_to_le32(kvirt_to_bus((unsigned long)btv->vbibuf+i*2048));
+ *(pe++)=cpu_to_le32(kvirt_to_phys((unsigned long)btv->vbibuf+i*2048));
}
*(pe++)=cpu_to_le32(BT848_RISC_JUMP|BT848_RISC_IRQ|(0x01<<16));
- *(pe++)=cpu_to_le32(virt_to_bus(btv->risc_jmp+10));
+ *(pe++)=cpu_to_le32(virt_to_phys(btv->risc_jmp+10));
if (bttv_debug > 1)
printk("bttv%d: vbi2: po=%08lx pe=%08lx\n",
- btv->nr,virt_to_bus(po), virt_to_bus(pe));
+ btv->nr,virt_to_phys(po), virt_to_phys(pe));
}
static int fmtbppx2[16] = {
@@ -599,9 +599,9 @@
for (line=0; line < 640; line++)
{
*(ro++)=cpu_to_le32(BT848_RISC_WRITE|bpl|BT848_RISC_SOL|BT848_RISC_EOL);
- *(ro++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *(ro++)=cpu_to_le32(kvirt_to_phys(vadr));
*(re++)=cpu_to_le32(BT848_RISC_WRITE|bpl|BT848_RISC_SOL|BT848_RISC_EOL);
- *(re++)=cpu_to_le32(kvirt_to_bus(vadr+gbufsize/2));
+ *(re++)=cpu_to_le32(kvirt_to_phys(vadr+gbufsize/2));
vadr+=bpl;
}
@@ -629,7 +629,7 @@
if (bttv_debug > 1)
printk("bttv%d: prisc1: ro=%08lx re=%08lx\n",
- btv->nr,virt_to_bus(ro), virt_to_bus(re));
+ btv->nr,virt_to_phys(ro), virt_to_phys(re));
switch(fmt)
{
@@ -705,13 +705,13 @@
*((*rp)++)=cpu_to_le32(rcmd|bl);
*((*rp)++)=cpu_to_le32(blcb|(blcr<<16));
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(vadr));
vadr+=bl;
if((rcmd&(15<<28))==BT848_RISC_WRITE123)
{
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(cbadr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(cbadr));
cbadr+=blcb;
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(cradr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(cradr));
cradr+=blcr;
}
@@ -726,7 +726,7 @@
if (bttv_debug > 1)
printk("bttv%d: prisc2: ro=%08lx re=%08lx\n",
- btv->nr,virt_to_bus(ro), virt_to_bus(re));
+ btv->nr,virt_to_phys(ro), virt_to_phys(re));
return 0;
}
@@ -751,7 +751,7 @@
if (bttv_debug > 1)
printk("bttv%d: vrisc1: ro=%08lx re=%08lx\n",
- btv->nr,virt_to_bus(ro), virt_to_bus(re));
+ btv->nr,virt_to_phys(ro), virt_to_phys(re));
inter = (height>tvnorms[btv->win.norm].sheight/2) ? 1 : 0;
bpl=width*fmtbppx2[palette2fmt[palette]&0xf]/2;
@@ -773,25 +773,25 @@
{
*((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|
BT848_RISC_EOL|bpl);
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(vadr));
vadr+=bpl;
}
else
{
todo=bpl;
*((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_SOL|bl);
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(vadr));
vadr+=bl;
todo-=bl;
while (todo>PAGE_SIZE)
{
*((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|PAGE_SIZE);
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(vadr));
vadr+=PAGE_SIZE;
todo-=PAGE_SIZE;
}
*((*rp)++)=cpu_to_le32(BT848_RISC_WRITE|BT848_RISC_EOL|todo);
- *((*rp)++)=cpu_to_le32(kvirt_to_bus(vadr));
+ *((*rp)++)=cpu_to_le32(kvirt_to_phys(vadr));
vadr+=todo;
}
}
@@ -803,7 +803,7 @@
if (bttv_debug > 1)
printk("bttv%d: vrisc2: ro=%08lx re=%08lx\n",
- btv->nr,virt_to_bus(ro), virt_to_bus(re));
+ btv->nr,virt_to_phys(ro), virt_to_phys(re));
return 0;
}
@@ -896,7 +896,7 @@
if (bttv_debug)
printk("bttv%d: clip: ro=%08lx re=%08lx\n",
- btv->nr,virt_to_bus(ro), virt_to_bus(re));
+ btv->nr,virt_to_phys(ro), virt_to_phys(re));
if ((clipmap=vmalloc(VIDEO_CLIPMAP_SIZE))==NULL) {
/* can't clip, don't generate any risc code */
@@ -1213,8 +1213,8 @@
btv->gbuf[mp->frame].fmt = palette2fmt[mp->format];
btv->gbuf[mp->frame].width = mp->width;
btv->gbuf[mp->frame].height = mp->height;
- btv->gbuf[mp->frame].ro = virt_to_bus(ro);
- btv->gbuf[mp->frame].re = virt_to_bus(re);
+ btv->gbuf[mp->frame].ro = virt_to_phys(ro);
+ btv->gbuf[mp->frame].re = virt_to_phys(re);
#if 1
if (mp->height <= tvnorms[btv->win.norm].sheight/2 &&
@@ -1341,7 +1341,7 @@
btwrite(0xfffffUL, BT848_INT_STAT);
btand(~15, BT848_GPIO_DMA_CTL);
btwrite(0, BT848_SRESET);
- btwrite(virt_to_bus(btv->risc_jmp+2),
+ btwrite(virt_to_phys(btv->risc_jmp+2),
BT848_RISC_STRT_ADD);
/* enforce pll reprogramming */
@@ -2371,7 +2371,7 @@
if (bttv_debug > 1)
printk("bttv%d: set_risc_jmp %08lx:",
- btv->nr,virt_to_bus(btv->risc_jmp));
+ btv->nr,virt_to_phys(btv->risc_jmp));
/* Sync to start of odd field */
btv->risc_jmp[0]=cpu_to_le32(BT848_RISC_SYNC|BT848_RISC_RESYNC
@@ -2382,12 +2382,12 @@
btv->risc_jmp[2]=cpu_to_le32(BT848_RISC_JUMP|(0xd<<20));
if (flags&8) {
if (bttv_debug > 1)
- printk(" ev=%08lx",virt_to_bus(btv->vbi_odd));
- btv->risc_jmp[3]=cpu_to_le32(virt_to_bus(btv->vbi_odd));
+ printk(" ev=%08lx",virt_to_phys(btv->vbi_odd));
+ btv->risc_jmp[3]=cpu_to_le32(virt_to_phys(btv->vbi_odd));
} else {
if (bttv_debug > 1)
printk(" -----------");
- btv->risc_jmp[3]=cpu_to_le32(virt_to_bus(btv->risc_jmp+4));
+ btv->risc_jmp[3]=cpu_to_le32(virt_to_phys(btv->risc_jmp+4));
}
/* Jump to odd sub */
@@ -2400,12 +2400,12 @@
} else if ((flags&2) &&
(!btv->win.interlace || 0 == btv->risc_cap_even)) {
if (bttv_debug > 1)
- printk(" eo=%08lx",virt_to_bus(btv->risc_scr_odd));
- btv->risc_jmp[5]=cpu_to_le32(virt_to_bus(btv->risc_scr_odd));
+ printk(" eo=%08lx",virt_to_phys(btv->risc_scr_odd));
+ btv->risc_jmp[5]=cpu_to_le32(virt_to_phys(btv->risc_scr_odd));
} else {
if (bttv_debug > 1)
printk(" -----------");
- btv->risc_jmp[5]=cpu_to_le32(virt_to_bus(btv->risc_jmp+6));
+ btv->risc_jmp[5]=cpu_to_le32(virt_to_phys(btv->risc_jmp+6));
}
@@ -2418,12 +2418,12 @@
btv->risc_jmp[8]=cpu_to_le32(BT848_RISC_JUMP);
if (flags&4) {
if (bttv_debug > 1)
- printk(" ov=%08lx",virt_to_bus(btv->vbi_even));
- btv->risc_jmp[9]=cpu_to_le32(virt_to_bus(btv->vbi_even));
+ printk(" ov=%08lx",virt_to_phys(btv->vbi_even));
+ btv->risc_jmp[9]=cpu_to_le32(virt_to_phys(btv->vbi_even));
} else {
if (bttv_debug > 1)
printk(" -----------");
- btv->risc_jmp[9]=cpu_to_le32(virt_to_bus(btv->risc_jmp+10));
+ btv->risc_jmp[9]=cpu_to_le32(virt_to_phys(btv->risc_jmp+10));
}
/* Jump to even sub */
@@ -2436,12 +2436,12 @@
} else if ((flags&1) &&
btv->win.interlace) {
if (bttv_debug > 1)
- printk(" oo=%08lx",virt_to_bus(btv->risc_scr_even));
- btv->risc_jmp[11]=cpu_to_le32(virt_to_bus(btv->risc_scr_even));
+ printk(" oo=%08lx",virt_to_phys(btv->risc_scr_even));
+ btv->risc_jmp[11]=cpu_to_le32(virt_to_phys(btv->risc_scr_even));
} else {
if (bttv_debug > 1)
printk(" -----------");
- btv->risc_jmp[11]=cpu_to_le32(virt_to_bus(btv->risc_jmp+12));
+ btv->risc_jmp[11]=cpu_to_le32(virt_to_phys(btv->risc_jmp+12));
}
if (btv->gq_start) {
@@ -2449,7 +2449,7 @@
} else {
btv->risc_jmp[12]=cpu_to_le32(BT848_RISC_JUMP);
}
- btv->risc_jmp[13]=cpu_to_le32(virt_to_bus(btv->risc_jmp));
+ btv->risc_jmp[13]=cpu_to_le32(virt_to_phys(btv->risc_jmp));
/* enable cpaturing and DMA */
if (bttv_debug > 1)
@@ -2546,10 +2546,10 @@
return -1;
btv->vbi_odd=btv->risc_jmp+16;
btv->vbi_even=btv->vbi_odd+256;
- btv->bus_vbi_odd=virt_to_bus(btv->risc_jmp+12);
- btv->bus_vbi_even=virt_to_bus(btv->risc_jmp+6);
+ btv->bus_vbi_odd=virt_to_phys(btv->risc_jmp+12);
+ btv->bus_vbi_even=virt_to_phys(btv->risc_jmp+6);
- btwrite(virt_to_bus(btv->risc_jmp+2), BT848_RISC_STRT_ADD);
+ btwrite(virt_to_phys(btv->risc_jmp+2), BT848_RISC_STRT_ADD);
btv->vbibuf=(unsigned char *) vmalloc_32(VBIBUF_SIZE);
if (!btv->vbibuf)
return -1;
@@ -2719,7 +2719,7 @@
if (btv->errors < BTTV_ERRORS) {
spin_lock(&btv->s_lock);
btand(~15, BT848_GPIO_DMA_CTL);
- btwrite(virt_to_bus(btv->risc_jmp+2),
+ btwrite(virt_to_phys(btv->risc_jmp+2),
BT848_RISC_STRT_ADD);
bt848_set_geo(btv,0);
bt848_set_risc_jmps(btv,-1);
[-- Attachment #4: compile-2.5.4.patch --]
[-- Type: text/plain, Size: 1299 bytes --]
diff -ur linux-2.5.4/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
--- linux-2.5.4/arch/i386/kernel/process.c Mon Feb 11 02:50:06 2002
+++ linux/arch/i386/kernel/process.c Tue Feb 12 19:58:33 2002
@@ -468,6 +468,14 @@
}
/*
+ * Return saved PC of a blocked thread.
+ */
+unsigned long thread_saved_pc(struct task_struct *tsk)
+{
+ return ((unsigned long *)tsk->thread.esp)[3];
+}
+
+/*
* No need to lock the MM as we are the last user
*/
void release_segments(struct mm_struct *mm)
diff -ur linux-2.5.4/include/asm-i386/processor.h linux/include/asm-i386/processor.h
--- linux-2.5.4/include/asm-i386/processor.h Mon Feb 11 02:50:08 2002
+++ linux/include/asm-i386/processor.h Tue Feb 12 20:03:54 2002
@@ -436,13 +436,8 @@
extern void copy_segments(struct task_struct *p, struct mm_struct * mm);
extern void release_segments(struct mm_struct * mm);
-/*
- * Return saved PC of a blocked thread.
- */
-static inline unsigned long thread_saved_pc(struct task_struct *tsk)
-{
- return ((unsigned long *)tsk->thread->esp)[3];
-}
+/* Return saved PC of a blocked thread. */
+extern unsigned long thread_saved_pc(struct task_struct *tsk);
unsigned long get_wchan(struct task_struct *p);
#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)->thread_info))[1019])
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:10 ` PATCH 2.5.4 i810_audio, bttv, working at all Martin Dalecki
@ 2002-02-13 12:35 ` Jeff Garzik
2002-02-13 12:40 ` Martin Dalecki
2002-02-13 18:30 ` Linus Torvalds
2002-02-13 13:04 ` Alan Cox
1 sibling, 2 replies; 25+ messages in thread
From: Jeff Garzik @ 2002-02-13 12:35 UTC (permalink / raw)
To: Martin Dalecki; +Cc: Linus Torvalds, linux-kernel
Martin Dalecki wrote:
sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
> + sg->busaddr=virt_to_phys(dmabuf->rawbuf+dmabuf->fragsize*i);
> // the card will always be doing 16bit stereo
> sg->control=dmabuf->fragsamples;
> if(state->card->pci_id == PCI_DEVICE_ID_SI_7012)
> @@ -954,7 +954,7 @@
> }
> spin_lock_irqsave(&state->card->lock, flags);
> outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
> - outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
> + outl(virt_to_phys(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
These changes are wrong. The addresses desired need to be obtained from
the pci_alloc_consistent return values.
> outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
> - outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
> + outl(virt_to_phys(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
likewise
> - ret = virt_to_bus((void *)kva);
> + ret = virt_to_phys((void *)kva);
> va = VMALLOC_VMADDR(adr);
> kva = uvirt_to_kva(pgd_offset_k(va), va);
> - ret = virt_to_bus((void *)kva);
> + ret = virt_to_phys((void *)kva);
> - btv->nr,virt_to_bus(po), virt_to_bus(pe));
> + btv->nr,virt_to_phys(po), virt_to_phys(pe));
...likewise, etc.
This works on silly x86 but is not portable at all... definitely not
for application.
--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:35 ` Jeff Garzik
@ 2002-02-13 12:40 ` Martin Dalecki
2002-02-13 12:45 ` David S. Miller
2002-02-13 12:47 ` Martin Dalecki
2002-02-13 18:30 ` Linus Torvalds
1 sibling, 2 replies; 25+ messages in thread
From: Martin Dalecki @ 2002-02-13 12:40 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Linus Torvalds, linux-kernel
Jeff Garzik wrote:
>Martin Dalecki wrote:
>sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
>
>>+ sg->busaddr=virt_to_phys(dmabuf->rawbuf+dmabuf->fragsize*i);
>> // the card will always be doing 16bit stereo
>> sg->control=dmabuf->fragsamples;
>> if(state->card->pci_id == PCI_DEVICE_ID_SI_7012)
>>@@ -954,7 +954,7 @@
>> }
>> spin_lock_irqsave(&state->card->lock, flags);
>> outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
>>- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
>>+ outl(virt_to_phys(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
>>
>
>
>These changes are wrong. The addresses desired need to be obtained from
>the pci_alloc_consistent return values.
>
>> outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */
>>- outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
>>+ outl(virt_to_phys(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
>>
>
>likewise
>
>>- ret = virt_to_bus((void *)kva);
>>+ ret = virt_to_phys((void *)kva);
>>
>> va = VMALLOC_VMADDR(adr);
>> kva = uvirt_to_kva(pgd_offset_k(va), va);
>>- ret = virt_to_bus((void *)kva);
>>+ ret = virt_to_phys((void *)kva);
>>
>>- btv->nr,virt_to_bus(po), virt_to_bus(pe));
>>+ btv->nr,virt_to_phys(po), virt_to_phys(pe));
>>
>
>...likewise, etc.
>
>This works on silly x86 but is not portable at all... definitely not
>for application.
>
The bttv we can argue about, I was just tagging it as beeing a quick fix...
Of course I admit that I have taken the easy shoot here. But it wasn't
possible
to me to deduce the proper thing to do by looking at the patches.
This is the usual way I deal with API changes: Have a look at what has
been done
to the other candidates and do the analogous thing where you need it.
But please just show me a non x86 architecture which is using the
i810_audio driver!
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:40 ` Martin Dalecki
@ 2002-02-13 12:45 ` David S. Miller
2002-02-13 12:55 ` Martin Dalecki
2002-02-13 12:47 ` Martin Dalecki
1 sibling, 1 reply; 25+ messages in thread
From: David S. Miller @ 2002-02-13 12:45 UTC (permalink / raw)
To: dalecki; +Cc: jgarzik, torvalds, linux-kernel
From: Martin Dalecki <dalecki@evision-ventures.com>
Date: Wed, 13 Feb 2002 13:40:59 +0100
Of course I admit that I have taken the easy shoot here. But it wasn't
possible
to me to deduce the proper thing to do by looking at the patches.
This is the usual way I deal with API changes: Have a look at what has
been done
to the other candidates and do the analogous thing where you need it.
The API hasn't changed, it is being enforced. The PCI DMA api
has existed for years. Please read Documentation/DMA-mapping.txt
so that you may learn how to properly convert drivers.
But please just show me a non x86 architecture which is using the
i810_audio driver!
Because if all drivers are consistently using the portable interfaces,
people writing new drivers will know exactly what to do.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:45 ` David S. Miller
@ 2002-02-13 12:55 ` Martin Dalecki
0 siblings, 0 replies; 25+ messages in thread
From: Martin Dalecki @ 2002-02-13 12:55 UTC (permalink / raw)
To: David S. Miller; +Cc: jgarzik, torvalds, linux-kernel
David S. Miller wrote:
> From: Martin Dalecki <dalecki@evision-ventures.com>
> Date: Wed, 13 Feb 2002 13:40:59 +0100
>
> Of course I admit that I have taken the easy shoot here. But it wasn't
> possible
> to me to deduce the proper thing to do by looking at the patches.
> This is the usual way I deal with API changes: Have a look at what has
> been done
> to the other candidates and do the analogous thing where you need it.
>
>The API hasn't changed, it is being enforced. The PCI DMA api
>has existed for years. Please read Documentation/DMA-mapping.txt
>so that you may learn how to properly convert drivers.
>
> But please just show me a non x86 architecture which is using the
> i810_audio driver!
>
>Because if all drivers are consistently using the portable interfaces,
>people writing new drivers will know exactly what to do.
>
Agred. I see now in patch-2.5.2 and the changes to ymfpci.c how to deal
with this.
I was already suspicious that the continuous back and forth address
space conversion
in bttv.c could be dealt with by just doing it once at initialization
time and storing both
the physical and virtuall mapping. Will do it, when I have pyhsical
access to the corresponding
hardware at hand.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:40 ` Martin Dalecki
2002-02-13 12:45 ` David S. Miller
@ 2002-02-13 12:47 ` Martin Dalecki
2002-02-13 13:10 ` Alan Cox
1 sibling, 1 reply; 25+ messages in thread
From: Martin Dalecki @ 2002-02-13 12:47 UTC (permalink / raw)
To: Martin Dalecki; +Cc: Jeff Garzik, Linus Torvalds, linux-kernel
Martin Dalecki wrote:
> Jeff Garzik wrote:
>
>> These changes are wrong. The addresses desired need to be obtained from
>> the pci_alloc_consistent return values.
>
>
> The bttv we can argue about, I was just tagging it as beeing a quick
> fix...
>
> Of course I admit that I have taken the easy shoot here. But it wasn't
> possible
> to me to deduce the proper thing to do by looking at the patches.
> This is the usual way I deal with API changes: Have a look at what has
> been done
> to the other candidates and do the analogous thing where you need it.
>
> But please just show me a non x86 architecture which is using the
> i810_audio driver!
Ah OK now I see that the API changes you where referencing too are
missing in bttv.c
already for a longer time then the 2.5.3->2.5.4 stage. This makes it
clear how to deal with that.
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:47 ` Martin Dalecki
@ 2002-02-13 13:10 ` Alan Cox
2002-02-18 17:36 ` Eric W. Biederman
0 siblings, 1 reply; 25+ messages in thread
From: Alan Cox @ 2002-02-13 13:10 UTC (permalink / raw)
To: Martin Dalecki; +Cc: Martin Dalecki, Jeff Garzik, Linus Torvalds, linux-kernel
> But please just show me a non x86 architecture which is using the
> i810_audio driver!
To start with the i810 audio code is the same code as is used for the AMD768
southbridge which can be used with an Alpha processor + AMD762
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 13:10 ` Alan Cox
@ 2002-02-18 17:36 ` Eric W. Biederman
0 siblings, 0 replies; 25+ messages in thread
From: Eric W. Biederman @ 2002-02-18 17:36 UTC (permalink / raw)
To: Alan Cox; +Cc: Martin Dalecki, Jeff Garzik, Linus Torvalds, linux-kernel
Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > But please just show me a non x86 architecture which is using the
> > i810_audio driver!
>
> To start with the i810 audio code is the same code as is used for the AMD768
> southbridge which can be used with an Alpha processor + AMD762
Or equally fun I won't be surprised if the i870 chipset for the next
generation ia64 itanium processor (mckinley) could use this code.
Eric
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:35 ` Jeff Garzik
2002-02-13 12:40 ` Martin Dalecki
@ 2002-02-13 18:30 ` Linus Torvalds
2002-02-13 16:49 ` David S. Miller
1 sibling, 1 reply; 25+ messages in thread
From: Linus Torvalds @ 2002-02-13 18:30 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Martin Dalecki, linux-kernel
On Wed, 13 Feb 2002, Jeff Garzik wrote:
>
> These changes are wrong. The addresses desired need to be obtained from
> the pci_alloc_consistent return values.
Let's face it, people won't care about the complex PCI interfaces unless
they give you something useful.
On most PC's, they don't.
In short, don't expect driver writers to care about somethign that simply
doesn't matter to them. Rant and rail all you want, but I think the thing
needs to be simplified to be acceptable to people. Many of these things
basically exists only on PC's, and are done on 1:1 pages (ie GFP_KERNEL),
so "virt_to_phys()" works.
Basic rule: it's up to _other_ architectures to fix drivers that don't
work for them. Always has been. Because there's no way you can get the
people who just want to have something working to care.
Linus
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 18:30 ` Linus Torvalds
@ 2002-02-13 16:49 ` David S. Miller
2002-02-13 16:55 ` Martin Dalecki
` (2 more replies)
0 siblings, 3 replies; 25+ messages in thread
From: David S. Miller @ 2002-02-13 16:49 UTC (permalink / raw)
To: torvalds; +Cc: jgarzik, dalecki, linux-kernel
From: Linus Torvalds <torvalds@transmeta.com>
Date: Wed, 13 Feb 2002 10:30:48 -0800 (PST)
Basic rule: it's up to _other_ architectures to fix drivers that don't
work for them. Always has been. Because there's no way you can get the
people who just want to have something working to care.
And if nobody else ends up doing it, you are right it will be people
like Jeff and myself doing it.
So what we are asking is to allow a few weeks for that and not crap up
the tree meanwhile. This is so that the cases that need to be
converted are harder to find.
Actually, you're only half right in one regard. Most people I've
pointed to Documentation/DMA-mapping.txt have responded "Oh, never saw
that before, that looks easy to do. Thanks I'll fix it up properly
for you."
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 16:49 ` David S. Miller
@ 2002-02-13 16:55 ` Martin Dalecki
2002-02-13 17:10 ` Jeff Garzik
2002-02-13 17:01 ` Jeff Garzik
2002-02-13 18:50 ` Linus Torvalds
2 siblings, 1 reply; 25+ messages in thread
From: Martin Dalecki @ 2002-02-13 16:55 UTC (permalink / raw)
To: David S. Miller; +Cc: torvalds, jgarzik, linux-kernel
David S. Miller wrote:
> From: Linus Torvalds <torvalds@transmeta.com>
> Date: Wed, 13 Feb 2002 10:30:48 -0800 (PST)
>
> Basic rule: it's up to _other_ architectures to fix drivers that don't
> work for them. Always has been. Because there's no way you can get the
> people who just want to have something working to care.
>
>And if nobody else ends up doing it, you are right it will be people
>like Jeff and myself doing it.
>
>So what we are asking is to allow a few weeks for that and not crap up
>the tree meanwhile. This is so that the cases that need to be
>converted are harder to find.
>
If you try to use them, then they are not hard to find - things just
break for you and you fix tem.
If you are fixing things for the "store" Linus is right that indeed it's
just a waiste of time on your behalf.
>Actually, you're only half right in one regard. Most people I've
>pointed to Documentation/DMA-mapping.txt have responded "Oh, never saw
>that before, that looks easy to do. Thanks I'll fix it up properly
>for you."
>
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 16:55 ` Martin Dalecki
@ 2002-02-13 17:10 ` Jeff Garzik
2002-02-13 19:02 ` Linus Torvalds
0 siblings, 1 reply; 25+ messages in thread
From: Jeff Garzik @ 2002-02-13 17:10 UTC (permalink / raw)
To: Martin Dalecki; +Cc: David S. Miller, torvalds, linux-kernel
Martin Dalecki wrote:
>
> David S. Miller wrote:
>
> > From: Linus Torvalds <torvalds@transmeta.com>
> > Date: Wed, 13 Feb 2002 10:30:48 -0800 (PST)
> >
> > Basic rule: it's up to _other_ architectures to fix drivers that don't
> > work for them. Always has been. Because there's no way you can get the
> > people who just want to have something working to care.
> >
> >And if nobody else ends up doing it, you are right it will be people
> >like Jeff and myself doing it.
> >
> >So what we are asking is to allow a few weeks for that and not crap up
> >the tree meanwhile. This is so that the cases that need to be
> >converted are harder to find.
> >
> If you try to use them, then they are not hard to find - things just
> break for you and you fix tem.
Applying a patch like s/virt_to_bus/virt_to_phys/ makes it more
difficult to find the right spots to change later.
Patience :) We will fix i810_audio and the other notables. As I noted
in the other message just now, i810_audio and bttv fixes are already
floating around, and hopefully should appear on lkml or in a Linus
pre-patch soon...
> If you are fixing things for the "store" Linus is right that indeed it's
> just a waiste of time on your behalf.
I can tell you it is -not- a waste of time. It's not a waste of time
when a vendor appears out of nowhere, having copied a driver of yours.
Since you did it right(tm), the vendor driver is portable, even though
its original source was for x86-only hardware. It's not a waste of time
when people copy your code or learn from your code. It's not a waste of
time when spiffy new x86 hardware appears that has useful IOMMU stuff,
making a driver's use of the PCI DMA API automatically useful for that
new hardware.
I agree with Linus that there is little motivation for someone to
continue patching a driver, after they have fixed the problem they set
out to fix. But that is not the same as saying driver portability is
worthless... far from it.
Jeff
--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 17:10 ` Jeff Garzik
@ 2002-02-13 19:02 ` Linus Torvalds
2002-02-13 17:38 ` Martin Dalecki
0 siblings, 1 reply; 25+ messages in thread
From: Linus Torvalds @ 2002-02-13 19:02 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Martin Dalecki, David S. Miller, linux-kernel
On Wed, 13 Feb 2002, Jeff Garzik wrote:
>
> Applying a patch like s/virt_to_bus/virt_to_phys/ makes it more
> difficult to find the right spots to change later.
Yes and no.
The thing is, for architectures that care, you can just grep for
"virt_to_phys()". It's basically _never_ the right thing to do on
something like sparc.
My personal preference would actually be to keep "virt_to_bus()" for x86
for now, and undo the change to make it complain. Instead, make it
complain on other architectures where it _is_ wrong, so that you don't
have to fix up drivers that simply aren't an issue. What's the point of
breaking some drivers that only exist on x86?
That, together with a warning and educating more driver writers.
Linus
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 19:02 ` Linus Torvalds
@ 2002-02-13 17:38 ` Martin Dalecki
0 siblings, 0 replies; 25+ messages in thread
From: Martin Dalecki @ 2002-02-13 17:38 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Jeff Garzik, David S. Miller, linux-kernel
Linus Torvalds wrote:
>
>On Wed, 13 Feb 2002, Jeff Garzik wrote:
>
>>Applying a patch like s/virt_to_bus/virt_to_phys/ makes it more
>>difficult to find the right spots to change later.
>>
>
>Yes and no.
>
>The thing is, for architectures that care, you can just grep for
>"virt_to_phys()". It's basically _never_ the right thing to do on
>something like sparc.
>
>My personal preference would actually be to keep "virt_to_bus()" for x86
>for now, and undo the change to make it complain. Instead, make it
>complain on other architectures where it _is_ wrong, so that you don't
>have to fix up drivers that simply aren't an issue. What's the point of
>breaking some drivers that only exist on x86?
>
I think that the suggestion from Jeff Garzik, that there is currently
just too much of code
duplication for quite common cases in drivers is the right way to go.
Most of the
stuff doing the virt_to_phys is doing quite common things from a broader
point of view.
Well even worser, there is quite a lot of code replication there as well
... see for example the
ide and scsi midlayers ;-). The whole hostadapter/iobus/device stuff
handling could be made common
at least. There is no real need for different driver handler lookup
mechanisms between them.
HWIF(device)-> and Scsi_Host_Templ come into mind...
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 16:49 ` David S. Miller
2002-02-13 16:55 ` Martin Dalecki
@ 2002-02-13 17:01 ` Jeff Garzik
2002-02-13 18:50 ` Linus Torvalds
2 siblings, 0 replies; 25+ messages in thread
From: Jeff Garzik @ 2002-02-13 17:01 UTC (permalink / raw)
To: David S. Miller; +Cc: torvalds, dalecki, linux-kernel
In the specific case mentioned in $subject, i810_audio has already been
fixed by Pete Zaitcev "the right way", and IIRC Gerd or somebody posted
a better patch for bttv, too. So $subject is actually taken care of...
"David S. Miller" wrote:
> And if nobody else ends up doing it, you are right it will be people
> like Jeff and myself doing it.
and have been doing it in the past :)
> So what we are asking is to allow a few weeks for that and not crap up
> the tree meanwhile. This is so that the cases that need to be
> converted are harder to find.
Yes, please..
> Actually, you're only half right in one regard. Most people I've
> pointed to Documentation/DMA-mapping.txt have responded "Oh, never saw
> that before, that looks easy to do. Thanks I'll fix it up properly
> for you."
I still get plenty of the "but virt_to_phys works fine for me" crowd too
:)
Jeff
--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 16:49 ` David S. Miller
2002-02-13 16:55 ` Martin Dalecki
2002-02-13 17:01 ` Jeff Garzik
@ 2002-02-13 18:50 ` Linus Torvalds
2002-02-13 17:19 ` Jeff Garzik
2 siblings, 1 reply; 25+ messages in thread
From: Linus Torvalds @ 2002-02-13 18:50 UTC (permalink / raw)
To: David S. Miller; +Cc: jgarzik, dalecki, linux-kernel
On Wed, 13 Feb 2002, David S. Miller wrote:
>
> Actually, you're only half right in one regard. Most people I've
> pointed to Documentation/DMA-mapping.txt have responded "Oh, never saw
> that before, that looks easy to do. Thanks I'll fix it up properly
> for you."
Fair enough. Educating driver writers is always good, and the good ones
will try to do their best even when it doesn't matter for them. I just
wanted to make sure that we don't make driver writers have to chew off too
big a piece.
(One example of this: look at how the big changes in the ll_rw_block
infrastructure were done - the whole locking thing was basically set up to
avoid having to change legacy drivers in anything but trivial ways, while
still sanely getting rid of io_request_lock. Similarly, while the BIO
stuff was a big change on a mid level layer, there was considerable effort
to make it easy to port drivers that didn't try to be clever to it).
Some drivers are written by people who are really passionate about kernel
internals, and that's good.
But many of them are barely working, written by people who don't care
about the rest of the kernel (or even about the driver itself, they just
wanted to have a working machine and forget about it), and if we make
those kinds of drivers do extra work, it's just not going to work.
Linus
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 18:50 ` Linus Torvalds
@ 2002-02-13 17:19 ` Jeff Garzik
2002-02-14 9:27 ` Pavel Machek
0 siblings, 1 reply; 25+ messages in thread
From: Jeff Garzik @ 2002-02-13 17:19 UTC (permalink / raw)
To: Linus Torvalds; +Cc: David S. Miller, dalecki, linux-kernel
Linus Torvalds wrote:
> But many of them are barely working, written by people who don't care
> about the rest of the kernel (or even about the driver itself, they just
> wanted to have a working machine and forget about it), and if we make
> those kinds of drivers do extra work, it's just not going to work.
Which is why, IMO, we should endeavor to make drivers as cookie-cutter
and dirt simple to create as possible. It will probably take many
months, but I would like to continually factor out from the net drivers
not only common code but -design patterns-.
As an experiment a couple months ago, I got most of the PCI net drivers
down to ~200-300 lines of C code apiece, by factoring out common code
patterns into M4 macros. "m4 netdrivers.m4 epic100.tmpl > epic100.c"
I would prefer to make drivers so dirt simple that people don't need to
worry about details like PCI DMA API changes...
Jeff, dreams on
--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 17:19 ` Jeff Garzik
@ 2002-02-14 9:27 ` Pavel Machek
2002-02-15 2:11 ` Jeff Garzik
0 siblings, 1 reply; 25+ messages in thread
From: Pavel Machek @ 2002-02-14 9:27 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Linus Torvalds, David S. Miller, dalecki, linux-kernel
Hi!
> As an experiment a couple months ago, I got most of the PCI net drivers
> down to ~200-300 lines of C code apiece, by factoring out common code
> patterns into M4 macros. "m4 netdrivers.m4 epic100.tmpl > epic100.c"
This is slightly extreme, right?
But I'd like to see resulting epic100.tmpl ;-).
Pavel
--
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-14 9:27 ` Pavel Machek
@ 2002-02-15 2:11 ` Jeff Garzik
2002-02-15 3:43 ` Linus Torvalds
0 siblings, 1 reply; 25+ messages in thread
From: Jeff Garzik @ 2002-02-15 2:11 UTC (permalink / raw)
To: Pavel Machek; +Cc: Linus Torvalds, David S. Miller, dalecki, linux-kernel
Pavel Machek wrote:
>
> Hi!
>
> > As an experiment a couple months ago, I got most of the PCI net drivers
> > down to ~200-300 lines of C code apiece, by factoring out common code
> > patterns into M4 macros. "m4 netdrivers.m4 epic100.tmpl > epic100.c"
>
> This is slightly extreme, right?
>
> But I'd like to see resulting epic100.tmpl ;-).
When you have to maintain more than 10 "cookie cutter" net drivers that
are 80-90% the same, you start to want such extremes :)
--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-15 2:11 ` Jeff Garzik
@ 2002-02-15 3:43 ` Linus Torvalds
2002-02-15 7:38 ` Martin Dalecki
0 siblings, 1 reply; 25+ messages in thread
From: Linus Torvalds @ 2002-02-15 3:43 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Pavel Machek, David S. Miller, dalecki, linux-kernel
On Thu, 14 Feb 2002, Jeff Garzik wrote:
> >
> > But I'd like to see resulting epic100.tmpl ;-).
>
> When you have to maintain more than 10 "cookie cutter" net drivers that
> are 80-90% the same, you start to want such extremes :)
It's not necessarily a bad idea to have a more capable preprocessor than
the C preprocessor. I've cursed preprocessor limitations before, and I
there was some discussion about using m4 several years ago (and I mean
_several_ years ago - if I were to guess I'd say 6-8 years ago..).
Linus
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-15 3:43 ` Linus Torvalds
@ 2002-02-15 7:38 ` Martin Dalecki
2002-02-25 16:24 ` Olaf Titz
0 siblings, 1 reply; 25+ messages in thread
From: Martin Dalecki @ 2002-02-15 7:38 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Jeff Garzik, Pavel Machek, David S. Miller, linux-kernel
Linus Torvalds wrote:
>On Thu, 14 Feb 2002, Jeff Garzik wrote:
>
>>>But I'd like to see resulting epic100.tmpl ;-).
>>>
>>When you have to maintain more than 10 "cookie cutter" net drivers that
>>are 80-90% the same, you start to want such extremes :)
>>
>
>It's not necessarily a bad idea to have a more capable preprocessor than
>the C preprocessor. I've cursed preprocessor limitations before, and I
>there was some discussion about using m4 several years ago (and I mean
>_several_ years ago - if I were to guess I'd say 6-8 years ago..).
>
The idal solution would be some kind of stripped down C++ for some of
those problems...
No rtti, no templates, no exceptions, no additional cruft requirng back
behind you runtime
support for the language, but just plain simple direct struct
inheritance kind off ;-).
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: PATCH 2.5.4 i810_audio, bttv, working at all.
2002-02-13 12:10 ` PATCH 2.5.4 i810_audio, bttv, working at all Martin Dalecki
2002-02-13 12:35 ` Jeff Garzik
@ 2002-02-13 13:04 ` Alan Cox
1 sibling, 0 replies; 25+ messages in thread
From: Alan Cox @ 2002-02-13 13:04 UTC (permalink / raw)
To: Martin Dalecki; +Cc: Linus Torvalds, linux-kernel
> {
> - sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
> + sg->busaddr=virt_to_phys(dmabuf->rawbuf+dmabuf->fragsize*i);
No don't do this. The code needs changing to use the new PCI API
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2002-02-25 16:37 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-19 17:05 PATCH 2.5.4 i810_audio, bttv, working at all Pete Zaitcev
2002-02-19 19:31 ` Doug Ledford
-- strict thread matches above, loose matches on Subject: below --
2002-01-28 14:10 A modest proposal -- We need a patch penguin Rob Landley
2002-01-29 1:37 ` Francesco Munda
2002-01-29 3:23 ` Linus Torvalds
2002-02-13 12:10 ` PATCH 2.5.4 i810_audio, bttv, working at all Martin Dalecki
2002-02-13 12:35 ` Jeff Garzik
2002-02-13 12:40 ` Martin Dalecki
2002-02-13 12:45 ` David S. Miller
2002-02-13 12:55 ` Martin Dalecki
2002-02-13 12:47 ` Martin Dalecki
2002-02-13 13:10 ` Alan Cox
2002-02-18 17:36 ` Eric W. Biederman
2002-02-13 18:30 ` Linus Torvalds
2002-02-13 16:49 ` David S. Miller
2002-02-13 16:55 ` Martin Dalecki
2002-02-13 17:10 ` Jeff Garzik
2002-02-13 19:02 ` Linus Torvalds
2002-02-13 17:38 ` Martin Dalecki
2002-02-13 17:01 ` Jeff Garzik
2002-02-13 18:50 ` Linus Torvalds
2002-02-13 17:19 ` Jeff Garzik
2002-02-14 9:27 ` Pavel Machek
2002-02-15 2:11 ` Jeff Garzik
2002-02-15 3:43 ` Linus Torvalds
2002-02-15 7:38 ` Martin Dalecki
2002-02-25 16:24 ` Olaf Titz
2002-02-13 13:04 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox