The resume bug was caused not by an early interrupt but because the idle
timeout was not being stopped on suspend. Also disable hardware IRQ's
on suspend. Will need to revisit this with hotplug?
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
The hardware should be fully shut off during suspend, and the base
irq mask restored during resume.
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
If the poll routine detects no hardware available, it needs to dequeue
it self from the network poll list. Linus didn't understand NAPI.
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
It is cleaner, to not loop over both ports if only one exists.
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
The set power state function is cleaner if it doesn't return anything.
The only caller that could fail is in suspend() and it can check the argument
there.
Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
...and __constant_ntohs, __constant_ntohl, __constant_cpu_to_be32 too
where possible. Htons and friends are resolved to constants in these
places anyway. Also fix an endianess glitch in a log message, spotted
by Alexey Dobriyan.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Replace spaces by tabulators, wrap lines at 80 columns, delete some
blank lines and superfluous braces. Collapse some if()-within-if()
constructs. Replace a literal CSR address by its preprocessor constant.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
ohci1394 and pcilynx call highlevel_host_reset from their hardware
interrupt handler (via hpsb_selfid_complete). Therefore all readers and
writers of hl_irqs_lock have to disable interrupts. Reported by Jiri
Slaby and J. A. Magallon.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
This gets also rid of the MODPOST warning "drivers/ieee1394/ieee1394.o -
Section mismatch: reference to .exit.text: from .smp_locks after '' (at
offset 0x18)".
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jody McIntyre <[email protected]>
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
We only support x86 and ppc, due to the use of bus_to_virt() and friends.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Replace occurrences of the magic value ~(u64)0 for invalid
CSR address spaces by a named constant for better readability.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
The proper designator of an invalid CSR address is ~(u64)0, not (u64)0.
Use the correct value in initialization and deregistration.
Also, scsi_id->sbp2_lun does not need to be initialized twice.
(scsi_id was kzalloc'd.)
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
I've been experimenting to track down the cause of suspend/resume problems
on my Compaq Presario X1050 laptop:
http://bugzilla.kernel.org/show_bug.cgi?id=6075
Essentially the ACPI Embedded Controller and keyboard controller would
get into a bizarre, confused state after resume.
I found that unloading the ohci1394 module before suspend and reloading it
after resume made the problem go away. Diffing the dmesg output from
resume, with and without the module loaded, I found that with the module
loaded I was missing these:
PM: Writing back config space on device 0000:02:00.0 at offset 1. (Was 2100080, writing 2100007)
PM: Writing back config space on device 0000:02:00.0 at offset 3. (Was 0, writing 8008)
PM: Writing back config space on device 0000:02:00.0 at offset 4. (Was 0, writing 90200000)
PM: Writing back config space on device 0000:02:00.0 at offset 5. (Was 1, writing 2401)
PM: Writing back config space on device 0000:02:00.0 at offset f. (Was 20000100, writing 2000010a)
The default PCI driver performs the pci_restore_state when no driver is
loaded for the device. When the ohci1394 driver is loaded, it is supposed
to do this, however it appears not to do so.
I created the patch below and tested it, and it appears to resolve the
suspend problems I was having with the module loaded. I only added in the
pci_save_state and pci_restore_state - however, though I know little of
this hardware, surely the driver should really be doing more than this when
suspending and resuming? Currently it does almost nothing, what if there
are commands in progress, etc?
Signed-off-by: Robert Hancock <[email protected]>
Cc: Jody McIntyre <[email protected]>
Cc: Ben Collins <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
It seems to have worked without the attribute during all the years
just because sizes of all struct members are multiples of 32 bits.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
If sbp2 is forced to move data via ARM handler, the maximum packet size
allowed for S800 transfers exceeds ohci1394's buffer size on platforms
where PAGE_SIZE is 4096.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Being able to switch physical DMA on and off at run time would be a nice
feature but a PITA to support by highlevel drivers and userspace apps.
Therefore allow it only to be set when the driver is being loaded.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
This patch supplies the API extension introduced by patch
"ieee1394: extend lowlevel API for address range properties"
with proper addresses.
Like in patch ''ohci1394, sbp2: fix "scsi_add_device failed"
with PL-3507 based devices'', 1 TeraByte is chosen as physical
upper bound. This leaves a window for the middle address range.
This choice is only relevant for adapters which actually have a
programmable pysical upper bound register. (Only ALi and
Fujitsu adapters are known for this. Most adapters have a fixed
bound at 4 GB.) The middle address range is suitable for posted
writes.
AFAIK, PCILynx does not support physical DMA nor posted writes,
therefore no equivalent change in the pcilynx driver is necessary.
There is also a driver for GP2Lynx, although not in mainline Linux.
I assume this hardware does not support these OHCI features either.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Host adapter hardware imposes certain restrictions and features on
address ranges. Instead of hard-wire such ranges into the ieee1394
core or even into protocol drivers, let lowlevel drivers specify
these ranges via struct hpsb_host.
Patch "ohci1394: set address range properties" must be applied too,
else hpsb_allocate_and_register_addrspace() won't work properly.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Since this is useful information, promote it from a debug macro to
a regular log message. The message appears only if the user set
exclusive_login=0, therefore won't clutter the logs in normal use.
Also update the comment on exclusive_login.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Jody McIntyre <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
This code became ineffective a few Linux releases ago and is not
required anyway.
Note from Christoph Hellwig: scsi_cmnd.request_buffer is always a
scatterlist these days. Checking random bites into it and then
mangling the data in sbp2_check_sbp2_response will cause really bad
memory corruption when you're not lucky enough to have the check not
trigger by luck.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Since broadcast transactions are already complete when the request has
been sent, the same transaction label can be reused all over again, see
IEEE 1394 7.3.2.5 and 6.2.4.3. Therefore we can reduce the footprint
of struct hpsb_host by the size of one struct hpsb_tlabel_pool.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
Add support for the following types of hardware:
+ nodes that have a link speed < PHY speed
+ 1394b PHYs that are less than S800 capable
+ 1394b/1394a adapter cable between two 1394b PHYs
Also, S1600 and S3200 are now supported if IEEE1394_SPEED_MAX is raised.
A probing function is added to nodemgr's config ROM fetching routine
which adjusts the allowable speed if an access problem was encountered.
Pros and Cons of the approach:
+ minimum code footprint to support this less widely used hardware
+ nearly no overhead for unaffected hardware
- ineffective before nodemgr began to read the ROM of affected nodes
- ineffective if ieee1394 is loaded with disable_nodemgr=1
The speed map CSRs which are published to the bus are not touched by the
patch.
Signed-off-by: Stefan Richter <[email protected]>
Cc: Hakan Ardo <[email protected]>
Cc: Calculex <[email protected]>
Cc: Robert J. Kosinski <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
This patch modifies the ohci1394.c file to enable and manage the "cycle too
long" interrupt.
If this interrupt occurs, the "LinkControl.CycleMaster" bit of the host
controller is reseted. This implies, that the host controller does not send
"cycle start" packet anymore freezing then the isochronous communication.
The management of the interrupt added by the patch is that when the interrupt
occurs, the OHCI irq handler prints a kernel log warning and then sets the
"LinkControl.CycleMaster" bit again resuming the isochronous communication.
Signed-off-by: Jean-Baptiste Mur <[email protected]>
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
The workarounds are not required for DViCO Momobay FX-3A and AFAIR not
for Momobay CX-2. These contain an TSB42AA9A but feature the same
firmware_revision value as the older DViCO Momobay CX-1.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
spotted by Adrian Bunk. Also remove some superfluous comments.
Signed-off-by: Stefan Richter <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
when attempting to find the 'last' part of the dma region continue the
search from where we left off, instead of starting the search over.
Signed-off-by: Jim Westfall <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
When working with multiple cameras and intensive applications, our logs
get flooded with video1394 information which isn't of much interest.
Any objections to demoting these messages to debug messages?
Signed-off-by: Daniel Drake <[email protected]>
Signed-off-by: Ben Collins <[email protected]>
shmem_rmdir() must undo the increment of i_nlink done in
shmem_get_inode() for directories, otherwise at least
IN_DELETE_SELF inotify event generation is broken.
Signed-off-by: Sergey Vlasov <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
On 64-bit machines, we just lost the uppermost 32 bits.
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Russell King <[email protected]>
I noticed a strange behavior in a tmpfs file system the other day, while
building packages - occasionally, and seemingly at random, make decided to
rebuild a target. However, only on tmpfs.
A file would be created, and if checked, it had a sub-second timestamp.
However, after an utimes related call where sub-seconds should be set, they
were zeroed instead. In the case that a file was created, and utimes(...,NULL)
was used on it in the same second, the timestamp on the file moved backwards.
After some digging, I found that this was being caused by tmpfs not having a
time granularity set, thus inheriting the default 1 second granularity.
Hugh adds: yes, we missed tmpfs when the s_time_gran mods went into 2.6.11.
Unfortunately, the granularity of CURRENT_TIME, often used in filesystems,
does not match the default granularity set by alloc_super. A few more such
discrepancies have been found, but this is the most important to fix now.
Signed-off-by: Robin H. Johnson <[email protected]>
Acked-by: Andi Kleen <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This fixes two independent problems: it would not save the PCI state on
suspend (and thus try to resume a nonexistent state on resume), and
while shut off, if an interrupt happened on the same shared irq, the irq
handler would react very badly to the interrupt status being an invalid
all-ones state.
Acked-by: Jeff Garzik <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Received from Mark Salyzyn
clear_user return is 0 for success, the code fragment is written to
assume that it is the count of the number of bytes zero'd.
Signed-off-by: Mark Haverkamp <[email protected]>
Signed-off-by: James Bottomley <[email protected]>