* Re: [PATCH] spi: Added spi master driver for Freescale MPC83xx SPI controller
From: Kumar Gala @ 2006-04-07 16:44 UTC (permalink / raw)
To: David Brownell; +Cc: Greg KH, linux-kernel, spi-devel-general
In-Reply-To: <200604070854.41383.david-b@pacbell.net>
On Apr 7, 2006, at 10:54 AM, David Brownell wrote:
>
>>> Hmm, it will of course be overridden as soon as needed, but
>>> shouldn't
>>> that default be "inactive low" clock? SPI mode 0 that is. That
>>> stands
>>> out mostly because you were interpreting CPOL=0 as inactive high,
>>> and
>>> that's not my understanding of how that signal works...
>>
>> I'll change it, not sure what I was thinking but SPI mode 0 being the
>> default makes sense.
>
> The default doesn't really matter, since it will be overridden ...
> I was
> more concerned about CPOL=0 being misinterpreted ...
Gotcha, I see that I am misinterpreting CPOL/CPHA so I'll fix that up.
>>> ... here you use "__be32" not "u32", and no "__iomem"
>>> annotation. So
>>> this is inconsistent with the declaration above. Note that if you
>>> just made this "&bank->regname" you'd be having the compiler do any
>>> offset calculation magic, and the source code will be more obvious.
>>
>> Yep, I know what you mean.
>
> Good rule of thumb: run "sparse -Wbitwise" on your drivers, and
> have it
> tell you about goofed up things. (Assuming the asm-ppc headers are
> safe
> to run that on!) It's nice having tools tell you about bugs before
> you
> run into them "live", and GCC only goes so far.
Yeah, forgot to run sparse the first time.
>>>> +static
>>>> +int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct
>>>> spi_transfer *t)
>>>> +{
>>>> + struct mpc83xx_spi *mpc83xx_spi;
>>>> + u32 regval;
>>>> + u32 len = t->bits_per_word - 1;
>>>> +
>>>> + if (len == 32)
>>>> + len = 0;
>>>
>>> So the hardware handles 1-33 bit words? It'd be good to filter
>>> the spi_setup() path directly then, returning EINVAL for illegal
>>> word lengths (and clock speeds).
>>
>> Uhh, no. The HW supports 4-bit to 32-bit words. However the
>> encoding of 32-bit is 0 in the register field, and 8-bit is a value
>> of 7, etc.. (bit encodings 1 & 2 are invalid).
>
> So that test should be "len == 31" too ...
Good catch, I had it testing bits_per_word directly before.
Actually, we support 4-bit to 16-bit, and 32-bit transfers.
>> I'm not following you on spi_setup(), but I think you mean to error
>> change bits_per_word there and return EINVAL if its not one we
>> support.
>
> Yes, but do it early: provide your own code to implement spi_setup
> (), which
> makes a range test and then either fails immediately or else
> delegates the
> rest of the work to spi_bitbang_setup() ... rather than only using
> that as
> the default.
>
> Your current code would claim to accept transfers with 64 bit words,
> but it wouldn't actually handle them correctly...
Right. However, do you think its really necessary to implement my
own spi_setup(), spi_bitbang_setup() is going to call my
setup_transfer() which will do the range checking for me (and I'll
need range checking in transfer_setup() anyways).
>>> I guess I'm surprised you're not using txrx_buffers() and having
>>> that whole thing be IRQ driven, so the per-word cost eliminates
>>> the task scheduling. You already paid for IRQ handling ... why
>>> not have it store the rx byte into the buffer, and write the tx
>>> byte froom the other buffer? That'd be cheaper than what you're
>>> doing now ... in both time and code. Only wake up a task at
>>> the end of a given spi_transfer().
>>
>> I dont follow you at all here. What are you suggesting I do?
>
> Don't do word-at-a-time I/O with spi_bitbang; you're using IRQs, and
> that's oriented towards polling. Don't fill bitbang->txrx_word[];
> don't
> use the default spi_bitbang_setup().
>
> Instead, provide your own setup(), and provide bitbang->txrx_buffers.
>
> Then when the generic not-really-bitbang core calls your
> txrx_buffers(),
> your code would record the "current" spi_transfer buffer pair and
> length
> then kickstart the I/O by writing the first byte from the TX buffer
> (or maybe zero if there is none). Wait on some completion event;
> return
> when the whole transfer has completed (or stopped after an error).
>
> Then the rest will be IRQ driven; you'll care only about "rx word
> ready"
> or whatever. When you get that IRQ, read the word ... and if there's
> an RX buffer, store it in the next location (else discard it).
> Decrement
> the length (by 1, 2, or 4 bytes). If length is nonzero, kickstart the
> next step by writing the next word from the TX buffer (or zero). When
> length is zero, trigger txrx_buffers() completion. Return from IRQ
> handler.
>
> See for example how bitbang_txrx_8() works; you'd basically be
> doing that
> as an irq-driven copy, instead of polling txrx_word(). The first
> version
> of your IRQ handler might be easier if it only handles 4-8 bit words,
> leaving 9-16 bits (and 17-32 bits) till later.
Maybe I'm missing where the polling is occurring now, but I felt like
I was effectively doing what you are describing.
^ permalink raw reply
* Status
From: Returned mail @ 2006-04-07 16:44 UTC (permalink / raw)
To: cpufreq
[-- Attachment #1: Type: text/plain, Size: 181 bytes --]
This message has been processed by Symantec AntiVirus.
transcript.exe was infected with the malicious virus W32.Mydoom!gen and has been deleted because the file cannot be cleaned.
[-- Attachment #2: Type: message/rfc822, Size: 1738 bytes --]
[-- Attachment #2.1.1: Type: text/plain, Size: 353 bytes --]
Dear user of www.linux.org.uk,
Your account was used to send a large amount of unsolicited e-mail messages during this week.
Obviously, your computer was infected and now contains a trojan proxy server.
We recommend that you follow instructions in the attachment in order to keep your computer safe.
Best regards,
The www.linux.org.uk support team.
[-- Attachment #2.1.2: transcript.zip --]
[-- Type: application/octet-stream, Size: 22 bytes --]
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
^ permalink raw reply
* Re: [PATCH 09/17] uml: fix critical typo for TT mode
From: Jeff Dike @ 2006-04-07 15:45 UTC (permalink / raw)
To: Paolo 'Blaisorblade' Giarrusso
Cc: Andrew Morton, linux-kernel, user-mode-linux-devel
In-Reply-To: <20060407143110.19201.91963.stgit@zion.home.lan>
On Fri, Apr 07, 2006 at 04:31:10PM +0200, Paolo 'Blaisorblade' Giarrusso wrote:
> Noticed this for a compilation-time warning, so I'm fixing it even for TT mode -
> this is not put_user, but copy_to_user, so we need a pointer to sp, not sp
> itself (we're trying to write the word pointed to by the "sp" var.).
>
> Jeff, have I misunderstood anything?
No, you're right. Al spotted this as well, and I have this fix in my tree.
Jeff
^ permalink raw reply
* [uml-devel] Re: [PATCH 09/17] uml: fix critical typo for TT mode
From: Jeff Dike @ 2006-04-07 15:45 UTC (permalink / raw)
To: Paolo 'Blaisorblade' Giarrusso
Cc: Andrew Morton, linux-kernel, user-mode-linux-devel
In-Reply-To: <20060407143110.19201.91963.stgit@zion.home.lan>
On Fri, Apr 07, 2006 at 04:31:10PM +0200, Paolo 'Blaisorblade' Giarrusso wrote:
> Noticed this for a compilation-time warning, so I'm fixing it even for TT mode -
> this is not put_user, but copy_to_user, so we need a pointer to sp, not sp
> itself (we're trying to write the word pointed to by the "sp" var.).
>
> Jeff, have I misunderstood anything?
No, you're right. Al spotted this as well, and I have this fix in my tree.
Jeff
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply
* Re: problem building UML kernel with 2.6.16.1 -- dies when linking vmlinux
From: Jeff Dike @ 2006-04-07 15:43 UTC (permalink / raw)
To: Christopher Friesen; +Cc: linux-kernel
In-Reply-To: <443676ED.10907@nortel.com>
On Fri, Apr 07, 2006 at 08:27:57AM -0600, Christopher Friesen wrote:
> I just used CONFIG_MODE_TT based on the config comments for
> CONFIG_PT_PROXY: "If you want to do kernel debugging, say Y here;
> otherwise say N.". This then required MODE_TT.
Yeah, that's out of date, and I'm in the process of fixing stuff like that.
> Can I run UML under gdb in skas mode?
"gdb linux" and away you go.
Jeff
^ permalink raw reply
* Re: [Xenomai-core] Frozen timer IRQ
From: Philippe Gerum @ 2006-04-07 16:39 UTC (permalink / raw)
To: Philippe Gerum; +Cc: Jan Kiszka, xenomai-core
In-Reply-To: <44369320.6030406@domain.hid>
Philippe Gerum wrote:
> Jan Kiszka wrote:
>
>>
>> BTW, that trace hacking reminds me that we should really think about
>> making a kernel debugger run. I recently noticed that latest kgdb
>> applied with a single failing hunk on top of ipipe (2.6.15, x86). Maybe
>> it is just about making kgdb's irq-locks ipipe-aware and bypassing the
>> ipipe for int3 and the serial IRQ (so that ipipe can be debugged as
>> well) and catching the relevant exceptions. Hmm, the debugger seems to
>> get initialised in the "early" stage. Is this before or after ipipe
>> setup?
>>
>
> It depends. If "kgdbwait" is set in the bootargs to halt the kernel
> waiting for the remote GDB to connect to the target, kgdb starts before
> the ipipe. Otherwise, it's a late init, and kgdb starts after the ipipe
> is fully initialized.
>
Basically, kgdb could start before the i-pipe as soon as a breakpoint is
hit before the latter is enabled in init/main.c.
--
Philippe.
^ permalink raw reply
* Re: [PATCH] use CONFIG_HZ
From: Maciej W. Rozycki @ 2006-04-07 16:46 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: ralf, linux-mips
In-Reply-To: <20060408.010348.41197502.anemo@mba.ocn.ne.jp>
On Sat, 8 Apr 2006, Atsushi Nemoto wrote:
> Make HZ configurable (DECSTATION can select 128/256/1024 HZ, JAZZ can
> only select 100 HZ, others can select 48/100/128/250/256/1000/1024
> HZ). Also remove all mach-xxx/param.h files and update all defconfigs
> according to current HZ value.
Thanks. I've got a suggestion SEAD (sead_defconfig) should use 100Hz by
default too and given its usual setup I can't agree more.
Maciej
^ permalink raw reply
* Re: Real Time Mirroring of a NAS
From: Tuomas Leikola @ 2006-04-07 16:29 UTC (permalink / raw)
To: Joshua Baker-LePain; +Cc: andy liebman, linux-raid
In-Reply-To: <Pine.LNX.4.62.0604070703560.27432@chaos.egr.duke.edu>
> > I'm looking for a way to create a real-time mirror of a NAS. In other words,
> > say I have a 5.5 TB NAS (3ware 16-drive array, RAID-5, 500 GB drives). I want
> > to mirror it in real time to a completely separate 5.5 TB NAS. RSYNCing in
> > the background is not an option. The two NAS boxes need to hold identical
> > data at all times. It is NOT necessary that the data be accessed from both
> > NAS boxes simultaneously. One is simply a backup of the other.
> >
> I don't have any experience with it, but I've often seen DRBD mentioned
> for just this sort of situation. I'd look into that.
>
Linux NBD (and md on top) is a simpler solution for the same thing.
I'd look into that also :)
^ permalink raw reply
* Re: Trasnferring u-boot to P2 730
From: Brian Swetland @ 2006-04-07 16:29 UTC (permalink / raw)
To: Chetan Kapoor; +Cc: Linux-omap-open-source, linux-omap-open-source-bounces
In-Reply-To: <OF252DA920.39024BFA-ON65257149.004C9463-65257149.004F0E12@flextronicssoftware.com>
[Chetan Kapoor <chetan.kapoor@flextronicssoftware.com>]
> Hello
>
> I am also working on the P2 board and having similar problems with u-boot
> download onto the board.
>
> Can we not use OST Tools - a TI application, for downloading the
> u-boot.bin onto the P2 board RAM/FLASH, OST seems to have flexibility
> between downloading & executing images from RAM AND downloading/burning
> images to flash.
>
> I was able to download the u-boot.bin (the raw binary) as well as u-boot
> (ELF image) to P2's RAM using OST Tools over a serial line (COM1). I has
> success in downloading u-boot to the specific address in RAM, but the
> image doesn't seem to execute/run. ALso, there is a provision of
> downloading images over the USB connection to the target, but in my case
> my Windows PC does not detect the P2 board as a USB device when I connect
> the board to the host PC with a USB cable. Rather, the charging LED on the
> board blinks for a second.
There is a bug in P2 (some combination of an on-die rom bug and a board
design issue, iirc) that prevents USB download from working.
Brian
^ permalink raw reply
* Re: [RFC][PATCH] allow dom0 to power off machine using ACPI on shutdown.
From: Muli Ben-Yehuda @ 2006-04-07 16:28 UTC (permalink / raw)
To: Keir Fraser; +Cc: Harry Butterworth, xen-devel
In-Reply-To: <461bea0b36f0398882dec8610f691f54@cl.cam.ac.uk>
On Fri, Apr 07, 2006 at 08:27:50AM +0100, Keir Fraser wrote:
> I think your patch looked okay for now, actually. Alternatively our
> machine_restart() could be moved into arch-specific code files.
The patch might be ok as a short term stopgap measure, but if we
consider mainstream inclusion, it has to make use of the arch specific
machine_power_off, not have ifdefs in core code. There's just no way
such a thing will be accepted. I think it's better to get it right now
rather than have one more thing to go back and fix when we submit it.
Cheers,
Muli
--
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
^ permalink raw reply
* iptables-1.3.4/5 and 2.4.32
From: Peter S. Mazinger @ 2006-04-07 16:28 UTC (permalink / raw)
To: netfilter
Hello!
I am running 2.4.32 kernel w/ pom patches applied (tried the last pom-ng
that has the 2.4 related files, also combined this w/ the newer pom-ng by
replacing the old files w/ the new ones). Independently of the pom-ng
version, if I use iptables-1.3.3 my rules (mainly NAT and some incoming
filters) work, but iptables-1.3.4 and 1.3.5 work only for about 10
minutes, then the firewall begans to drop packages weirdly, nothing shows
up in the logs and the natting breaks within 15 minutes (forward chain
does not forward anymore), the input/output chains work.
I haven't found any related messages, but it seems that the newer iptables
concentrate on 2.6 series, even pom was stripped to add only what is
missing from 2.6.
Should this be interpreted as "2.4 is not supported anymore, stick w/
1.3.3"?
Thanks, Peter
P.S. Please CC me.
--
Peter S. Mazinger <ps dot m at gmx dot net> ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
^ permalink raw reply
* Re: [PATCH] use __ffs() instead of ffs() on waybit calculation
From: Ralf Baechle @ 2006-04-07 16:39 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
In-Reply-To: <20060408.013331.71086855.anemo@mba.ocn.ne.jp>
On Sat, Apr 08, 2006 at 01:33:31AM +0900, Atsushi Nemoto wrote:
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Nice cleanup, applied.
Ralf
^ permalink raw reply
* Re: [Xenomai-core] Frozen timer IRQ
From: Philippe Gerum @ 2006-04-07 16:28 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
In-Reply-To: <443662DE.8020804@domain.hid>
Jan Kiszka wrote:
>
> BTW, that trace hacking reminds me that we should really think about
> making a kernel debugger run. I recently noticed that latest kgdb
> applied with a single failing hunk on top of ipipe (2.6.15, x86). Maybe
> it is just about making kgdb's irq-locks ipipe-aware and bypassing the
> ipipe for int3 and the serial IRQ (so that ipipe can be debugged as
> well) and catching the relevant exceptions. Hmm, the debugger seems to
> get initialised in the "early" stage. Is this before or after ipipe setup?
>
It depends. If "kgdbwait" is set in the bootargs to halt the kernel
waiting for the remote GDB to connect to the target, kgdb starts before
the ipipe. Otherwise, it's a late init, and kgdb starts after the ipipe
is fully initialized.
--
Philippe.
^ permalink raw reply
* Re: [PATCH] nullify __ide_flush_{prologue,epilogue} on UP
From: Ralf Baechle @ 2006-04-07 16:38 UTC (permalink / raw)
To: Atsushi Nemoto; +Cc: linux-mips
In-Reply-To: <20060408.012511.75185496.anemo@mba.ocn.ne.jp>
On Sat, Apr 08, 2006 at 01:25:11AM +0900, Atsushi Nemoto wrote:
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Looks good, applied.
Actually I have my objections wrt to shared caches such as with SMP on
the 34K but that's another project.
Ralf
^ permalink raw reply
* Re: [ALSA 1/2] continue on IS_ERR from platform device registration
From: Rene Herman @ 2006-04-07 16:26 UTC (permalink / raw)
To: Takashi Iwai; +Cc: ALSA devel, Linux Kernel, Greg Kroah-Hartman
In-Reply-To: <s5h3bgqlcfd.wl%tiwai@suse.de>
[-- Attachment #1: Type: text/plain, Size: 4658 bytes --]
Takashi Iwai wrote:
[ unregistering platform devices again when no device found ]
> Well, I'm not so confident that it's the way to go.
Okay... Added Greg back to the CC. Don't know if he wants to comment or not.
> The problem is that currently the ALSA ISA driver wants to refuse
> loading (and modprobe returns an error) when no devices are found at
> loading time. On 2.2/2.4 kernels, PCI drivers also show the same
> behavior, but it was changed for a good reason.
>
> Then, shouldn't be the ISA drivers changed to follow the same style?
> That is, we keep pnp_driver and platform_driver regardless probe
> calls succeeded or not. They can be, in theory, later
> bound/activated over sysfs.
The thing I'm stumbling over is the non (generic) discoverability of ISA
versus busses such as ISA-PnP and PCI which makes for a big conceptual
difference.
A PnP/PCI device has a life all by itself by virtue of its bus knowing
that it's present. For one, the device will be present in /sys/devices/
without any specific driver for the device loaded yet. A platform device
on the other hand only "exists" by virtue of a driver creating it
because it might want to drive it. If we keep it registered even after
failing a probe, then /sys/devices/platform turns into a view of "what
drivers did we load" rather then "what's present in this system". As far
as I'm aware, that latter view of /sys/devices was at one time the idea.
Just imagine loading all ISA drivers for an appreciation of the amount
of pollution to this view always keeping the devices registered does.
However!
I must say I wasn't aware that ALSA PCI devices at the moment load
without devices. Wasn't there even an oft used ALSA configuration script
out there that worked by loading all drivers and checking which ones stuck?
I just checked the behaviour and yes, the drivers load. Most importantly
to the analogy, even without any of the supported IDs present.
I have a 125d:1978 (ESS Canyon3D) at PCI 0000\:00\:08\:0. If I remove
the 125d:1978 device ID from snd-es1968, then yes, snd-es1968 still
loads. With the ID still not present, a:
echo -n 0000\:00\:08.0 >"/sys/bus/pci/drivers/ES1968 (ESS Maestro)/bind"
runs into a bug somewhere it seems. The xterm I'm doing that in now
hangs (but is killable). Doing:
echo "125d 1978" >"/sys/bus/pci/drivers/ES1968 (ESS Maestro)/new_id"
instead does work fine, and after this binding and unbinding work fine
as well again, which means there at least seems to be some point.
In the analogy, given that the PCI driver loads even without any of its
IDs present means a platform_driver loading without anything present as
well isn't, from the view of the driver model, much of a difference
after all. PnP doesn't have a "new_id" field, but could have, and I
therefore in fact agree by now that it's best to follow PCI's lead here.
> At least it would make the code more simpler, I guess.
Not significantly. We'd need to seperate the probe() method a bit, so
that the things we need before a bind _could_ ever succeed were in the
main loop and would make the driver skip device registration if not
fullfilled. For example, if with the snd-adlib driver no port= is given,
then attempted binds would simply tell you "please specify port" over
and over again, something which can only be solved by unloading and
reloading the driver, this time specifying the port. This is still a
difference due to non-discoverability, and I feel this should still make
the driver fail to load.
For snd-adlib, this would look like the attached patch. I'm also being
more verbose about which bus_id is failing. The !cards printk() is gone,
as it is no longer a matter of "device not found or busy" (and there
will be a printk() from the actual error spot anyway) and changed the
-ENODEV there to -EINVAL.
It works. "modprobe snd-adlib" fails to load, and "modprobe snd-adlib
port=0x388" succeeds, with or without probe failures. I can for example
now do:
# modprobe snd-cs4236 // which claims 0x388
# modprobe snd-adlib port=0x388 // which has it load
# modprobe -r snd-cs4236 && modprobe snd-cs4236 fm_port=0
which enables the OPL at 0x388, but leaves it alone, so that I can then:
# echo -n snd_adlib.0 >/sys/bus/platform/drivers/snd_adlib/bind
to bind the snd_adlib driver to it. Which is... erm... great fun I guess.
(I am by the way being so specific about what I'm doing with these sysfs
things because until Dmitry pointed them out to me in the precursor
discussion, I was't even aware of bind/unbind. Want to make sure I
understand how to operate it all).
How do you feel about this one?
Rene.
[-- Attachment #2: adlib-platform_keep.diff --]
[-- Type: text/plain, Size: 3430 bytes --]
Index: local/sound/isa/adlib.c
===================================================================
--- local.orig/sound/isa/adlib.c 2006-04-06 23:10:52.000000000 +0200
+++ local/sound/isa/adlib.c 2006-04-07 01:42:11.000000000 +0200
@@ -43,25 +43,19 @@ static int __devinit snd_adlib_probe(str
struct snd_card *card;
struct snd_opl3 *opl3;
- int error;
- int i = device->id;
-
- if (port[i] == SNDRV_AUTO_PORT) {
- snd_printk(KERN_ERR DRV_NAME ": please specify port\n");
- error = -EINVAL;
- goto out0;
- }
+ int error, i = device->id;
+ char *bus_id = device->dev.bus_id;
card = snd_card_new(index[i], id[i], THIS_MODULE, 0);
if (!card) {
- snd_printk(KERN_ERR DRV_NAME ": could not create card\n");
+ snd_printk(KERN_ERR "%s: could not create card\n", bus_id);
error = -EINVAL;
goto out0;
}
card->private_data = request_region(port[i], 4, CRD_NAME);
if (!card->private_data) {
- snd_printk(KERN_ERR DRV_NAME ": could not grab ports\n");
+ snd_printk(KERN_ERR "%s: could not grab ports\n", bus_id);
error = -EBUSY;
goto out1;
}
@@ -69,13 +63,13 @@ static int __devinit snd_adlib_probe(str
error = snd_opl3_create(card, port[i], port[i] + 2, OPL3_HW_AUTO, 1, &opl3);
if (error < 0) {
- snd_printk(KERN_ERR DRV_NAME ": could not create OPL\n");
+ snd_printk(KERN_ERR "%s: could not create OPL\n", bus_id);
goto out1;
}
error = snd_opl3_hwdep_new(opl3, 0, 0, NULL);
if (error < 0) {
- snd_printk(KERN_ERR DRV_NAME ": could not create FM\n");
+ snd_printk(KERN_ERR "%s: could not create FM\n", bus_id);
goto out1;
}
@@ -87,7 +81,7 @@ static int __devinit snd_adlib_probe(str
error = snd_card_register(card);
if (error < 0) {
- snd_printk(KERN_ERR DRV_NAME ": could not register card\n");
+ snd_printk(KERN_ERR "%s: could not register card\n", bus_id);
goto out1;
}
@@ -95,8 +89,7 @@ static int __devinit snd_adlib_probe(str
return 0;
out1: snd_card_free(card);
- out0: error = -EINVAL; /* FIXME: should be the original error code */
- return error;
+out0: return error;
}
static int __devexit snd_adlib_remove(struct platform_device *device)
@@ -109,7 +102,6 @@ static int __devexit snd_adlib_remove(st
static struct platform_driver snd_adlib_driver = {
.probe = snd_adlib_probe,
.remove = __devexit_p(snd_adlib_remove),
-
.driver = {
.name = DRV_NAME
}
@@ -119,9 +111,10 @@ static int __init alsa_card_adlib_init(v
{
int i, cards;
- if (platform_driver_register(&snd_adlib_driver) < 0) {
+ i = platform_driver_register(&snd_adlib_driver);
+ if (i < 0) {
snd_printk(KERN_ERR DRV_NAME ": could not register driver\n");
- return -ENODEV;
+ return i;
}
for (cards = 0, i = 0; i < SNDRV_CARDS; i++) {
@@ -130,21 +123,26 @@ static int __init alsa_card_adlib_init(v
if (!enable[i])
continue;
+ if (port[i] == SNDRV_AUTO_PORT) {
+ snd_printk(KERN_ERR DRV_NAME ": please specify port for card %d\n", i);
+ continue;
+ }
+
device = platform_device_register_simple(DRV_NAME, i, NULL, 0);
- if (IS_ERR(device))
+ if (IS_ERR(device)) {
+ snd_printk(KERN_ERR DRV_NAME ": could not register device for card %d\n", i);
continue;
+ }
devices[i] = device;
cards++;
}
if (!cards) {
-#ifdef MODULE
- printk(KERN_ERR CRD_NAME " soundcard not found or device busy\n");
-#endif
platform_driver_unregister(&snd_adlib_driver);
- return -ENODEV;
+ return -EINVAL;
}
+
return 0;
}
^ permalink raw reply
* Re: cross automount issue
From: Joe Pruett @ 2006-04-07 16:24 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs
In-Reply-To: <Pine.LNX.4.58.0604072342530.24984@wombat.indigo.net.au>
after sending it, i started wondering what the lock was there for. i
wasn't sure if each automount daemon was multi-threaded or not. what
mount locking are you referring to?
^ permalink raw reply
* [PATCH] use __ffs() instead of ffs() on waybit calculation
From: Atsushi Nemoto @ 2006-04-07 16:33 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index d88c668..4182e11 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -750,12 +750,12 @@ static void __init probe_pcache(void)
icache_size = 1 << (12 + ((config & CONF_IC) >> 9));
c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
c->icache.ways = 2;
- c->icache.waybit = ffs(icache_size/2) - 1;
+ c->icache.waybit = __ffs(icache_size/2);
dcache_size = 1 << (12 + ((config & CONF_DC) >> 6));
c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
c->dcache.ways = 2;
- c->dcache.waybit= ffs(dcache_size/2) - 1;
+ c->dcache.waybit= __ffs(dcache_size/2);
c->options |= MIPS_CPU_CACHE_CDEX_P;
break;
@@ -838,12 +838,12 @@ static void __init probe_pcache(void)
icache_size = 1 << (10 + ((config & CONF_IC) >> 9));
c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
c->icache.ways = 2;
- c->icache.waybit = ffs(icache_size/2) - 1;
+ c->icache.waybit = __ffs(icache_size/2);
dcache_size = 1 << (10 + ((config & CONF_DC) >> 6));
c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
c->dcache.ways = 2;
- c->dcache.waybit = ffs(dcache_size/2) - 1;
+ c->dcache.waybit = __ffs(dcache_size/2);
c->options |= MIPS_CPU_CACHE_CDEX_P;
break;
@@ -874,12 +874,12 @@ static void __init probe_pcache(void)
icache_size = 1 << (12 + ((config & CONF_IC) >> 9));
c->icache.linesz = 16 << ((config & CONF_IB) >> 5);
c->icache.ways = 4;
- c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
+ c->icache.waybit = __ffs(icache_size / c->icache.ways);
dcache_size = 1 << (12 + ((config & CONF_DC) >> 6));
c->dcache.linesz = 16 << ((config & CONF_DB) >> 4);
c->dcache.ways = 4;
- c->dcache.waybit = ffs(dcache_size / c->dcache.ways) - 1;
+ c->dcache.waybit = __ffs(dcache_size / c->dcache.ways);
#if !defined(CONFIG_SMP) || !defined(RM9000_CDEX_SMP_WAR)
c->options |= MIPS_CPU_CACHE_CDEX_P;
@@ -907,7 +907,7 @@ static void __init probe_pcache(void)
icache_size = c->icache.sets *
c->icache.ways *
c->icache.linesz;
- c->icache.waybit = ffs(icache_size/c->icache.ways) - 1;
+ c->icache.waybit = __ffs(icache_size/c->icache.ways);
if (config & 0x8) /* VI bit */
c->icache.flags |= MIPS_CACHE_VTAG;
@@ -927,7 +927,7 @@ static void __init probe_pcache(void)
dcache_size = c->dcache.sets *
c->dcache.ways *
c->dcache.linesz;
- c->dcache.waybit = ffs(dcache_size/c->dcache.ways) - 1;
+ c->dcache.waybit = __ffs(dcache_size/c->dcache.ways);
c->options |= MIPS_CPU_PREFETCH;
break;
diff --git a/arch/mips/mm/sc-rm7k.c b/arch/mips/mm/sc-rm7k.c
index 3b6cc9b..31ec730 100644
--- a/arch/mips/mm/sc-rm7k.c
+++ b/arch/mips/mm/sc-rm7k.c
@@ -138,7 +138,7 @@ void __init rm7k_sc_init(void)
c->scache.linesz = sc_lsize;
c->scache.ways = 4;
- c->scache.waybit= ffs(scache_size / c->scache.ways) - 1;
+ c->scache.waybit= __ffs(scache_size / c->scache.ways);
c->scache.waysize = scache_size / c->scache.ways;
c->scache.sets = scache_size / (c->scache.linesz * c->scache.ways);
printk(KERN_INFO "Secondary cache size %dK, linesize %d bytes.\n",
^ permalink raw reply related
* Re: [Cbe-oss-dev] [PATCH 4/5] powerpc: export symbols for page size selection
From: Olof Johansson @ 2006-04-07 16:20 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, cbe-oss-dev
In-Reply-To: <200604071803.01836.arnd.bergmann@de.ibm.com>
On Fri, Apr 07, 2006 at 06:03:01PM +0200, Arnd Bergmann wrote:
> On Friday 07 April 2006 17:42, Olof Johansson wrote:
> > Yeah, what's the need for that, really? It needs to know so much of
> > kernel internals that it's getting silly to allow it to be a module.
>
> How about if I do a patch that always includes the base but not
> the actual file system?
Sounds like a decent tradeoff.
-Olof
^ permalink raw reply
* Re: Broadcast ARP packets on link local addresses (Version2).
From: David Daney @ 2006-04-07 16:18 UTC (permalink / raw)
To: hadi; +Cc: Janos Farkas, netdev, linux-kernel, pgf, freek
In-Reply-To: <1144416638.5082.33.camel@jzny2>
jamal wrote:
> On Thu, 2006-06-04 at 09:17 -0700, David Daney wrote:
>
>>Janos Farkas wrote:
>
>
>>>Sorry for chiming in this late in the discussion, but... Shouldn't it
>>>be more correct to not depend on the ip address of the used network,
>>>but to use the "scope" parameter of the given address?
>>>
>>
>
> Excellent point! It was bothering me as well but i couldnt express my
> view eloquently as you did.
>
>
>>RFC 3927 specifies the Ethernet arp broadcast behavior for only
>>169.254.0.0/16.
>
>
> Thats besides the point. You could, for example, use 1.1.1.1/24 in your
> network instead of the 10.x or 192.x; and i have seen people use 10.x
> in what appears to be public networks. We dont have speacial checks for
> RFC 1918 IP addresses for example.
>
Following your logic through, It seems that you are advocating
broadcasting *all* ARP packets on *all* link local addresses. That
would mean that on a 192.168.* switched Ethernet network with DHCP that
twice as many ARP packets would be broadcast.
I don't think that is a good idea. On networks with DHCP or statically
allocated addresses, it would be a hard sell to tell people that they
have to broadcast *all* ARP traffic even though there are neither
standards that require nor suggest such action.
The scope parameter, as far as I can tell, is used to make routing
decisions. Overloading it to also implement the RFC 3927 ARP
broadcasting requirement would result in generation of unnecessary
network traffic in configurations that are probably the majority of
Linux deployments.
> 169.254.0.0/16 is by definition link local. I think point made by Janos
> is we should look at the attributes rather than value.
>
The converse is not true. And that is my problem with this idea.
> Have your user space set it to be link local and then fix the kernel if
> it doesnt do the right thing.
>
I could see adding an additional interface attribute that specifies link
local, and then testing that. But that adds substantially more overhead
as you would have to allocate space for the attribute somewhere, and
have extra code to allow setting/querying of the attribute from user space.
The requirement of RFC 3927 is very tightly targeted. My patch does
only what is required, no more. It does not change ARP behavior for
commonly deployed configurations.
>
>> Presumably you could set the scope parameter to local
>>for addresses outside of that range or even for protocols other than
>>Ethernet. Since broadcasting ARP packets usually adversely effects
>>usable network bandwidth, we should probably only do it where it is
>>absolutely required. The overhead of testing the value required by the
>>RFC is quite low (3 machine instructions on i686 is the size of the
>>entire patch), so using some proxy like the scope parameter would not
>>even be a performance win.
>>
>
>
> Again, that is beside the point.
It may be beside your point, I happen to think that it has some relevance.
David Daney
^ permalink raw reply
* Re: Serial console problem with Xen 3.0
From: Michael Paesold @ 2006-04-07 16:17 UTC (permalink / raw)
To: Keir Fraser, Don Zickus; +Cc: xen-devel Devel, Jan Beulich
In-Reply-To: <ee1ef52f2c2c10eca767d403578d449d@cl.cam.ac.uk>
Keir Fraser wrote:
> On 7 Apr 2006, at 15:44, Don Zickus wrote:
>
>>> Me too. Adding "sync_console" at least repaired the console *output*. I
>>> still have the problem that keyboard input does not reach linux, as it
>>> seems. Here is my config:
>>>
>>
>> Adding "pnpacpi=off" to the command line is our quick and dirty hack >>
>> for
>> now. Don't know the root cause yet, but at least it will get you going.
>
> I have some suspicion that this, and the IRQ flooding issues that
> suse have been seeing, may be due to insufficient checking and
> translation and book-keeping at the ioapic management interface that Xen
> exports.
...
I just wanted to confirm that pnpacpi=off solves my problem and give me full
access over the serial console.
Should this get an issue in the bugtracker?
Best Regards,
Michael Paesold
^ permalink raw reply
* Git is one year old today
From: Luck, Tony @ 2006-04-07 16:16 UTC (permalink / raw)
To: git
Happy birthday to git ... one year old today. Counting
the "birth" as the point at which Linus made the first commit
of the git sources into git:
commit e83c5163316f89bfbde7d9ab23ca2e25604af290
Author: Linus Torvalds <torvalds@ppc970.osdl.org>
Date: Thu Apr 7 15:13:13 2005 -0700
Initial revision of "git", the information manager from hell
-Tony
^ permalink raw reply
* [PATCH] nullify __ide_flush_{prologue,epilogue} on UP
From: Atsushi Nemoto @ 2006-04-07 16:25 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h
index 44266e5..e331535 100644
--- a/include/asm-mips/mach-generic/ide.h
+++ b/include/asm-mips/mach-generic/ide.h
@@ -106,14 +106,18 @@ static __inline__ unsigned long ide_defa
/* MIPS port and memory-mapped I/O string operations. */
static inline void __ide_flush_prologue(void)
{
+#ifdef CONFIG_SMP
if (cpu_has_dc_aliases)
preempt_disable();
+#endif
}
static inline void __ide_flush_epilogue(void)
{
+#ifdef CONFIG_SMP
if (cpu_has_dc_aliases)
preempt_enable();
+#endif
}
static inline void __ide_flush_dcache_range(unsigned long addr, unsigned long size)
^ permalink raw reply related
* Re: IP22 doesn't shutdown properly
From: Martin Michlmayr @ 2006-04-07 16:21 UTC (permalink / raw)
To: Russell King; +Cc: linux-mips
In-Reply-To: <20060325173450.GC6100@flint.arm.linux.org.uk>
* Russell King <rmk@arm.linux.org.uk> [2006-03-25 17:34]:
> > - if ((status & DCD) ^ up->prev_status)
> > + if ((status ^ up->prev_status) ^ DCD)
> Shouldn't this be (status ^ up->prev_status) & DCD ?
>
> > - if ((status & CTS) ^ up->prev_status)
> > + if ((status ^ up->prev_status) ^ CTS)
> Shouldn't this be (status ^ up->prev_status) & CTS ?
Thanks for catching this! I obviously copied too much from sunzilog.c
without thinking. Below is a new version which has this fix and which
has been updated so it apples to 2.6.17-rc1.
[PATCH] Sync ip22zilog with latest sunzilog driver
ip22zilog is based on the sunzilog driver, but there hasn't been a sync
since 2.6.0-test7. Sync the relevant changes that have been made since
then.
Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -2,7 +2,7 @@
* Driver for Zilog serial chips found on SGI workstations and
* servers. This driver could actually be made more generic.
*
- * This is based on the drivers/serial/sunzilog.c code as of 2.6.0-test7 and the
+ * This is based on the drivers/serial/sunzilog.c code as of 2.6.17-rc1 and the
* old drivers/sgi/char/sgiserial.c code which itself is based of the original
* drivers/sbus/char/zs.c code. A lot of code has been simply moved over
* directly from there but much has been rewritten. Credits therefore go out
@@ -86,15 +86,11 @@ struct uart_ip22zilog_port {
unsigned int cflag;
- /* L1-A keyboard break state. */
- int kbd_id;
- int l1_down;
-
unsigned char parity_mask;
unsigned char prev_status;
};
-#define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel *)((PORT)->membase))
+#define ZILOG_CHANNEL_FROM_PORT(PORT) ((struct zilog_channel __iomem *)((PORT)->membase))
#define UART_ZILOG(PORT) ((struct uart_ip22zilog_port *)(PORT))
#define IP22ZILOG_GET_CURR_REG(PORT, REGNUM) \
(UART_ZILOG(PORT)->curregs[REGNUM])
@@ -116,7 +112,7 @@ struct uart_ip22zilog_port {
* The port lock must be held and local IRQs must be disabled
* when {read,write}_zsreg is invoked.
*/
-static unsigned char read_zsreg(struct zilog_channel *channel,
+static unsigned char read_zsreg(struct zilog_channel __iomem *channel,
unsigned char reg)
{
unsigned char retval;
@@ -129,7 +125,7 @@ static unsigned char read_zsreg(struct z
return retval;
}
-static void write_zsreg(struct zilog_channel *channel,
+static void write_zsreg(struct zilog_channel __iomem *channel,
unsigned char reg, unsigned char value)
{
writeb(reg, &channel->control);
@@ -138,7 +134,7 @@ static void write_zsreg(struct zilog_cha
ZSDELAY();
}
-static void ip22zilog_clear_fifo(struct zilog_channel *channel)
+static void ip22zilog_clear_fifo(struct zilog_channel __iomem *channel)
{
int i;
@@ -165,7 +161,7 @@ static void ip22zilog_clear_fifo(struct
/* This function must only be called when the TX is not busy. The UART
* port lock must be held and local interrupts disabled.
*/
-static void __load_zsregs(struct zilog_channel *channel, unsigned char *regs)
+static void __load_zsregs(struct zilog_channel __iomem *channel, unsigned char *regs)
{
int i;
@@ -241,7 +237,7 @@ static void __load_zsregs(struct zilog_c
* The UART port lock must be held and local interrupts disabled.
*/
static void ip22zilog_maybe_update_regs(struct uart_ip22zilog_port *up,
- struct zilog_channel *channel)
+ struct zilog_channel __iomem *channel)
{
if (!ZS_REGS_HELD(up)) {
if (ZS_TX_ACTIVE(up)) {
@@ -252,14 +248,20 @@ static void ip22zilog_maybe_update_regs(
}
}
-static void ip22zilog_receive_chars(struct uart_ip22zilog_port *up,
- struct zilog_channel *channel,
- struct pt_regs *regs)
-{
- struct tty_struct *tty = up->port.info->tty; /* XXX info==NULL? */
+static struct tty_struct *
+ip22zilog_receive_chars(struct uart_ip22zilog_port *up,
+ struct zilog_channel __iomem *channel,
+ struct pt_regs *regs)
+{
+ struct tty_struct *tty;
+ unsigned char ch, r1, flag;
+
+ tty = NULL;
+ if (up->port.info != NULL && /* Unopened serial console */
+ up->port.info->tty != NULL) /* Keyboard || mouse */
+ tty = up->port.info->tty;
while (1) {
- unsigned char ch, r1, flag;
r1 = read_zsreg(channel, R1);
if (r1 & (PAR_ERR | Rx_OVR | CRC_ERR)) {
@@ -277,23 +279,17 @@ static void ip22zilog_receive_chars(stru
if (ch & BRK_ABRT)
r1 |= BRK_ABRT;
+ if (!(ch & Rx_CH_AV))
+ break;
+
ch = readb(&channel->data);
ZSDELAY();
ch &= up->parity_mask;
- if (ZS_IS_CONS(up) && (r1 & BRK_ABRT)) {
- /* Wait for BREAK to deassert to avoid potentially
- * confusing the PROM.
- */
- while (1) {
- ch = readb(&channel->control);
- ZSDELAY();
- if (!(ch & BRK_ABRT))
- break;
- }
- ip22_do_break();
- return;
+ if (tty == NULL) {
+ uart_handle_sysrq_char(&up->port, ch, regs);
+ continue;
}
/* A real serial line, record the character and status. */
@@ -304,7 +300,7 @@ static void ip22zilog_receive_chars(stru
r1 &= ~(PAR_ERR | CRC_ERR);
up->port.icount.brk++;
if (uart_handle_break(&up->port))
- goto next_char;
+ continue;
}
else if (r1 & PAR_ERR)
up->port.icount.parity++;
@@ -321,7 +317,7 @@ static void ip22zilog_receive_chars(stru
flag = TTY_FRAME;
}
if (uart_handle_sysrq_char(&up->port, ch, regs))
- goto next_char;
+ continue;
if (up->port.ignore_status_mask == 0xff ||
(r1 & up->port.ignore_status_mask) == 0)
@@ -329,18 +325,13 @@ static void ip22zilog_receive_chars(stru
if (r1 & Rx_OVR)
tty_insert_flip_char(tty, 0, TTY_OVERRUN);
- next_char:
- ch = readb(&channel->control);
- ZSDELAY();
- if (!(ch & Rx_CH_AV))
- break;
}
- tty_flip_buffer_push(tty);
+ return tty;
}
static void ip22zilog_status_handle(struct uart_ip22zilog_port *up,
- struct zilog_channel *channel,
+ struct zilog_channel __iomem *channel,
struct pt_regs *regs)
{
unsigned char status;
@@ -352,6 +343,22 @@ static void ip22zilog_status_handle(stru
ZSDELAY();
ZS_WSYNC(channel);
+ if (status & BRK_ABRT) {
+ if (ZS_IS_CONS(up)) {
+ /* Wait for BREAK to deassert to avoid potentially
+ * confusing the PROM.
+ */
+ while (1) {
+ status = readb(&channel->control);
+ ZSDELAY();
+ if (!(status & BRK_ABRT))
+ break;
+ }
+ ip22_do_break();
+ return;
+ }
+ }
+
if (ZS_WANTS_MODEM_STATUS(up)) {
if (status & SYNC)
up->port.icount.dsr++;
@@ -360,10 +367,10 @@ static void ip22zilog_status_handle(stru
* But it does not tell us which bit has changed, we have to keep
* track of this ourselves.
*/
- if ((status & DCD) ^ up->prev_status)
+ if ((status ^ up->prev_status) & DCD)
uart_handle_dcd_change(&up->port,
(status & DCD));
- if ((status & CTS) ^ up->prev_status)
+ if ((status ^ up->prev_status) & CTS)
uart_handle_cts_change(&up->port,
(status & CTS));
@@ -374,7 +381,7 @@ static void ip22zilog_status_handle(stru
}
static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up,
- struct zilog_channel *channel)
+ struct zilog_channel __iomem *channel)
{
struct circ_buf *xmit;
@@ -449,21 +456,23 @@ static irqreturn_t ip22zilog_interrupt(i
struct uart_ip22zilog_port *up = dev_id;
while (up) {
- struct zilog_channel *channel
+ struct zilog_channel __iomem *channel
= ZILOG_CHANNEL_FROM_PORT(&up->port);
+ struct tty_struct *tty;
unsigned char r3;
spin_lock(&up->port.lock);
r3 = read_zsreg(channel, R3);
/* Channel A */
+ tty = NULL;
if (r3 & (CHAEXT | CHATxIP | CHARxIP)) {
writeb(RES_H_IUS, &channel->control);
ZSDELAY();
ZS_WSYNC(channel);
if (r3 & CHARxIP)
- ip22zilog_receive_chars(up, channel, regs);
+ tty = ip22zilog_receive_chars(up, channel, regs);
if (r3 & CHAEXT)
ip22zilog_status_handle(up, channel, regs);
if (r3 & CHATxIP)
@@ -471,18 +480,22 @@ static irqreturn_t ip22zilog_interrupt(i
}
spin_unlock(&up->port.lock);
+ if (tty)
+ tty_flip_buffer_push(tty);
+
/* Channel B */
up = up->next;
channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
spin_lock(&up->port.lock);
+ tty = NULL;
if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) {
writeb(RES_H_IUS, &channel->control);
ZSDELAY();
ZS_WSYNC(channel);
if (r3 & CHBRxIP)
- ip22zilog_receive_chars(up, channel, regs);
+ tty = ip22zilog_receive_chars(up, channel, regs);
if (r3 & CHBEXT)
ip22zilog_status_handle(up, channel, regs);
if (r3 & CHBTxIP)
@@ -490,6 +503,9 @@ static irqreturn_t ip22zilog_interrupt(i
}
spin_unlock(&up->port.lock);
+ if (tty)
+ tty_flip_buffer_push(tty);
+
up = up->next;
}
@@ -501,7 +517,7 @@ static irqreturn_t ip22zilog_interrupt(i
*/
static __inline__ unsigned char ip22zilog_read_channel_status(struct uart_port *port)
{
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
unsigned char status;
channel = ZILOG_CHANNEL_FROM_PORT(port);
@@ -555,7 +571,7 @@ static unsigned int ip22zilog_get_mctrl(
static void ip22zilog_set_mctrl(struct uart_port *port, unsigned int mctrl)
{
struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char set_bits, clear_bits;
set_bits = clear_bits = 0;
@@ -587,7 +603,7 @@ static void ip22zilog_stop_tx(struct uar
static void ip22zilog_start_tx(struct uart_port *port)
{
struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char status;
up->flags |= IP22ZILOG_FLAG_TX_ACTIVE;
@@ -629,7 +645,7 @@ static void ip22zilog_start_tx(struct ua
static void ip22zilog_stop_rx(struct uart_port *port)
{
struct uart_ip22zilog_port *up = UART_ZILOG(port);
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
if (ZS_IS_CONS(up))
return;
@@ -645,7 +661,7 @@ static void ip22zilog_stop_rx(struct uar
static void ip22zilog_enable_ms(struct uart_port *port)
{
struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char new_reg;
new_reg = up->curregs[R15] | (DCDIE | SYNCIE | CTSIE);
@@ -661,7 +677,7 @@ static void ip22zilog_enable_ms(struct u
static void ip22zilog_break_ctl(struct uart_port *port, int break_state)
{
struct uart_ip22zilog_port *up = (struct uart_ip22zilog_port *) port;
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
unsigned char set_bits, clear_bits, new_reg;
unsigned long flags;
@@ -687,7 +703,7 @@ static void ip22zilog_break_ctl(struct u
static void __ip22zilog_startup(struct uart_ip22zilog_port *up)
{
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
up->prev_status = readb(&channel->control);
@@ -742,7 +758,7 @@ static int ip22zilog_startup(struct uart
static void ip22zilog_shutdown(struct uart_port *port)
{
struct uart_ip22zilog_port *up = UART_ZILOG(port);
- struct zilog_channel *channel;
+ struct zilog_channel __iomem *channel;
unsigned long flags;
if (ZS_IS_CONS(up))
@@ -918,7 +934,7 @@ static struct uart_ops ip22zilog_pops =
};
static struct uart_ip22zilog_port *ip22zilog_port_table;
-static struct zilog_layout **ip22zilog_chip_regs;
+static struct zilog_layout __iomem **ip22zilog_chip_regs;
static struct uart_ip22zilog_port *ip22zilog_irq_chain;
static int zilog_irq = -1;
@@ -936,10 +952,10 @@ static void * __init alloc_one_table(uns
static void __init ip22zilog_alloc_tables(void)
{
- ip22zilog_port_table = (struct uart_ip22zilog_port *)
+ ip22zilog_port_table =
alloc_one_table(NUM_CHANNELS * sizeof(struct uart_ip22zilog_port));
- ip22zilog_chip_regs = (struct zilog_layout **)
- alloc_one_table(NUM_IP22ZILOG * sizeof(struct zilog_layout *));
+ ip22zilog_chip_regs =
+ alloc_one_table(NUM_IP22ZILOG * sizeof(struct zilog_layout __iomem *));
if (ip22zilog_port_table == NULL || ip22zilog_chip_regs == NULL) {
panic("IP22-Zilog: Cannot allocate IP22-Zilog tables.");
@@ -947,7 +963,7 @@ static void __init ip22zilog_alloc_table
}
/* Get the address of the registers for IP22-Zilog instance CHIP. */
-static struct zilog_layout * __init get_zs(int chip)
+static struct zilog_layout __iomem * __init get_zs(int chip)
{
unsigned long base;
@@ -961,13 +977,13 @@ static struct zilog_layout * __init get_
zilog_irq = SGI_SERIAL_IRQ;
request_mem_region(base, 8, "IP22-Zilog");
- return (struct zilog_layout *) base;
+ return (struct zilog_layout __iomem *) base;
}
#define ZS_PUT_CHAR_MAX_DELAY 2000 /* 10 ms */
#ifdef CONFIG_SERIAL_IP22_ZILOG_CONSOLE
-static void ip22zilog_put_char(struct uart_port *port, int ch)
+static void ip22zilog_putchar(struct uart_port *port, int ch)
{
struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port);
int loops = ZS_PUT_CHAR_MAX_DELAY;
@@ -996,7 +1012,7 @@ ip22zilog_console_write(struct console *
unsigned long flags;
spin_lock_irqsave(&up->port.lock, flags);
- uart_console_write(&up->port, s, count, ip22zilog_put_char);
+ uart_console_write(&up->port, s, count, ip22zilog_putchar);
udelay(2);
spin_unlock_irqrestore(&up->port.lock, flags);
}
@@ -1098,7 +1114,7 @@ static struct uart_driver ip22zilog_reg
static void __init ip22zilog_prepare(void)
{
struct uart_ip22zilog_port *up;
- struct zilog_layout *rp;
+ struct zilog_layout __iomem *rp;
int channel, chip;
/*
@@ -1117,8 +1133,8 @@ static void __init ip22zilog_prepare(voi
if (!ip22zilog_chip_regs[chip]) {
ip22zilog_chip_regs[chip] = rp = get_zs(chip);
- up[(chip * 2) + 0].port.membase = (char *) &rp->channelB;
- up[(chip * 2) + 1].port.membase = (char *) &rp->channelA;
+ up[(chip * 2) + 0].port.membase = (void __iomem *) &rp->channelB;
+ up[(chip * 2) + 1].port.membase = (void __iomem *) &rp->channelA;
/* In theory mapbase is the physical address ... */
up[(chip * 2) + 0].port.mapbase =
@@ -1157,7 +1173,7 @@ static void __init ip22zilog_init_hw(voi
for (i = 0; i < NUM_CHANNELS; i++) {
struct uart_ip22zilog_port *up = &ip22zilog_port_table[i];
- struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
+ struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(&up->port);
unsigned long flags;
int baud, brg;
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply
* Re: [spi-devel-general] Re: [PATCH] spi: Added spi master driver for Freescale MPC83xx SPI controller
From: David Brownell @ 2006-04-07 16:09 UTC (permalink / raw)
To: Vitaly Wool; +Cc: Kumar Gala, Greg KH, linux-kernel, spi-devel-general
In-Reply-To: <44362DDE.3010203@gmail.com>
On Friday 07 April 2006 2:16 am, Vitaly Wool wrote:
> Hi,
>
> > I guess I'm surprised you're not using txrx_buffers() and having
> > that whole thing be IRQ driven, so the per-word cost eliminates
> > the task scheduling. You already paid for IRQ handling ... why
> > not have it store the rx byte into the buffer, and write the tx
> > byte froom the other buffer? That'd be cheaper than what you're
> > doing now ... in both time and code. Only wake up a task at
> > the end of a given spi_transfer().
> >
> I might be completely wrong here, but I was asking myself this very
> question, and it looks like that's the way to implement full duplex
> transfers.
Well, not the _only_ way. The polling-type txrx_word() calls are
also full duplex. My point is more that it's bad/inefficient to
incur both IRQ _and_ task switch overheads per word, when it would
be a lot simpler to just have the IRQ handler do its normal job.
(And that's even true if you've turned hard IRQ handlers into threads
for PREEMPT_RT or whatever. In that case the "IRQ overhead" is a
task switch, but you're still saving _additional_ task switches.)
> For txrx_buffers to be properly implemented, you need to take a lot of
> things into account.
No more than the usual sort of driver thing. SPI is a lot simpler
than most hardware, it's just a fancy shift register. There's not
a lot of configuration possible, and not much can go wrong.
> The main idea is not to lose the data in the
> receive buffer due to overflow, and thus you need to set up 'Rx buffer
> not free' int or whatever similar which will actually trigger after the
> first word is sent.
I think of it more as "after first word is received", but they are
the same event ... you can't send a word without receiving one, or
receive one without sending one. SPI is fundamentally full duplex.
Now, if you have a FIFO as well as a shift register, then yes the
synchronization can get tricky. It should still be possible to
have the RX and TX buffers be identical though.
> So therefore implementing txrx_buffers within these
> conditions doesn't make much sense IMHO, unless you meant having a
> separate thread to read from the Rx buffer, which is woken up on, say,
> half-full Rx buffer.
I'll disagree on any need for a separate thread. Kumar's IRQ handler
was already reading the RX byte and storing it. However, he stored it
in a scratch byte ... rather than putting it right into the RX buffer.
There's no point to incurring extra costs like that (or like the extra
context switch overhead).
- Dave
^ permalink raw reply
* [PATCH] inotify: check for NULL inode in inotify_d_instantiate
From: Arnd Bergmann @ 2006-04-07 16:08 UTC (permalink / raw)
To: Nick Piggin; +Cc: cbe-oss-dev, linux-kernel
The spufs file system creates files in a directory before instantiating
the directory itself, which causes a NULL pointer access in
inotify_d_instantiate since c32ccd87bfd1414b0aabfcd8dbc7539ad23bcbaa.
I'd like to keep this behavior since it means that the user
will not have access to files in the directory before I know
that I succeed in creating everything in it. This patch adds
a simple check for the inode to keep that working.
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
diff --git a/fs/inotify.c b/fs/inotify.c
index 367c487..1f50302 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -538,7 +538,7 @@ void inotify_d_instantiate(struct dentry
WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
spin_lock(&entry->d_lock);
parent = entry->d_parent;
- if (inotify_inode_watched(parent->d_inode))
+ if (parent->d_inode && inotify_inode_watched(parent->d_inode))
entry->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
spin_unlock(&entry->d_lock);
}
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.