Merge branch 'x86/urgent' into x86/pat

This commit is contained in:
Ingo Molnar 2009-03-01 12:47:58 +01:00
commit 55f2b78995
143 changed files with 1731 additions and 992 deletions

View file

@ -1,3 +1,46 @@
What: /sys/bus/pci/drivers/.../bind
Date: December 2003
Contact: linux-pci@vger.kernel.org
Description:
Writing a device location to this file will cause
the driver to attempt to bind to the device found at
this location. This is useful for overriding default
bindings. The format for the location is: DDDD:BB:DD.F.
That is Domain:Bus:Device.Function and is the same as
found in /sys/bus/pci/devices/. For example:
# echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/bind
(Note: kernels before 2.6.28 may require echo -n).
What: /sys/bus/pci/drivers/.../unbind
Date: December 2003
Contact: linux-pci@vger.kernel.org
Description:
Writing a device location to this file will cause the
driver to attempt to unbind from the device found at
this location. This may be useful when overriding default
bindings. The format for the location is: DDDD:BB:DD.F.
That is Domain:Bus:Device.Function and is the same as
found in /sys/bus/pci/devices/. For example:
# echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/unbind
(Note: kernels before 2.6.28 may require echo -n).
What: /sys/bus/pci/drivers/.../new_id
Date: December 2003
Contact: linux-pci@vger.kernel.org
Description:
Writing a device ID to this file will attempt to
dynamically add a new device ID to a PCI device driver.
This may allow the driver to support more hardware than
was included in the driver's static device ID support
table at compile time. The format for the device ID is:
VVVV DDDD SVVV SDDD CCCC MMMM PPPP. That is Vendor ID,
Device ID, Subsystem Vendor ID, Subsystem Device ID,
Class, Class Mask, and Private Driver Data. The Vendor ID
and Device ID fields are required, the rest are optional.
Upon successfully adding an ID, the driver will probe
for the device and attempt to bind to it. For example:
# echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id
What: /sys/bus/pci/devices/.../vpd What: /sys/bus/pci/devices/.../vpd
Date: February 2008 Date: February 2008
Contact: Ben Hutchings <bhutchings@solarflare.com> Contact: Ben Hutchings <bhutchings@solarflare.com>

View file

@ -1,205 +0,0 @@
This README escorted the skystar2-driver rewriting procedure. It describes the
state of the new flexcop-driver set and some internals are written down here
too.
This document hopefully describes things about the flexcop and its
device-offsprings. Goal was to write an easy-to-write and easy-to-read set of
drivers based on the skystar2.c and other information.
Remark: flexcop-pci.c was a copy of skystar2.c, but every line has been
touched and rewritten.
History & News
==============
2005-04-01 - correct USB ISOC transfers (thanks to Vadim Catana)
General coding processing
=========================
We should proceed as follows (as long as no one complains):
0) Think before start writing code!
1) rewriting the skystar2.c with the help of the flexcop register descriptions
and splitting up the files to a pci-bus-part and a flexcop-part.
The new driver will be called b2c2-flexcop-pci.ko/b2c2-flexcop-usb.ko for the
device-specific part and b2c2-flexcop.ko for the common flexcop-functions.
2) Search for errors in the leftover of flexcop-pci.c (compare with pluto2.c
and other pci drivers)
3) make some beautification (see 'Improvements when rewriting (refactoring) is
done')
4) Testing the new driver and maybe substitute the skystar2.c with it, to reach
a wider tester audience.
5) creating an usb-bus-part using the already written flexcop code for the pci
card.
Idea: create a kernel-object for the flexcop and export all important
functions. This option saves kernel-memory, but maybe a lot of functions have
to be exported to kernel namespace.
Current situation
=================
0) Done :)
1) Done (some minor issues left)
2) Done
3) Not ready yet, more information is necessary
4) next to be done (see the table below)
5) USB driver is working (yes, there are some minor issues)
What seems to be ready?
-----------------------
1) Rewriting
1a) i2c is cut off from the flexcop-pci.c and seems to work
1b) moved tuner and demod stuff from flexcop-pci.c to flexcop-tuner-fe.c
1c) moved lnb and diseqc stuff from flexcop-pci.c to flexcop-tuner-fe.c
1e) eeprom (reading MAC address)
1d) sram (no dynamic sll size detection (commented out) (using default as JJ told me))
1f) misc. register accesses for reading parameters (e.g. resetting, revision)
1g) pid/mac filter (flexcop-hw-filter.c)
1i) dvb-stuff initialization in flexcop.c (done)
1h) dma stuff (now just using the size-irq, instead of all-together, to be done)
1j) remove flexcop initialization from flexcop-pci.c completely (done)
1l) use a well working dma IRQ method (done, see 'Known bugs and problems and TODO')
1k) cleanup flexcop-files (remove unused EXPORT_SYMBOLs, make static from
non-static where possible, moved code to proper places)
2) Search for errors in the leftover of flexcop-pci.c (partially done)
5a) add MAC address reading
5c) feeding of ISOC data to the software demux (format of the isochronous data
and speed optimization, no real error) (thanks to Vadim Catana)
What to do in the near future?
--------------------------------------
(no special order here)
5) USB driver
5b) optimize isoc-transfer (submitting/killing isoc URBs when transfer is starting)
Testing changes
---------------
O = item is working
P = item is partially working
X = item is not working
N = item does not apply here
<empty field> = item need to be examined
| PCI | USB
item | mt352 | nxt2002 | stv0299 | mt312 | mt352 | nxt2002 | stv0299 | mt312
-------+-------+---------+---------+-------+-------+---------+---------+-------
1a) | O | | | | N | N | N | N
1b) | O | | | | | | O |
1c) | N | N | | | N | N | O |
1d) | O | O
1e) | O | O
1f) | P
1g) | O
1h) | P |
1i) | O | N
1j) | O | N
1l) | O | N
2) | O | N
5a) | N | O
5b)* | N |
5c) | N | O
* - not done yet
Known bugs and problems and TODO
--------------------------------
1g/h/l) when pid filtering is enabled on the pci card
DMA usage currently:
The DMA is splitted in 2 equal-sized subbuffers. The Flexcop writes to first
address and triggers an IRQ when it's full and starts writing to the second
address. When the second address is full, the IRQ is triggered again, and
the flexcop writes to first address again, and so on.
The buffersize of each address is currently 640*188 bytes.
Problem is, when using hw-pid-filtering and doing some low-bandwidth
operation (like scanning) the buffers won't be filled enough to trigger
the IRQ. That's why:
When PID filtering is activated, the timer IRQ is used. Every 1.97 ms the IRQ
is triggered. Is the current write address of DMA1 different to the one
during the last IRQ, then the data is passed to the demuxer.
There is an additional DMA-IRQ-method: packet count IRQ. This isn't
implemented correctly yet.
The solution is to disable HW PID filtering, but I don't know how the DVB
API software demux behaves on slow systems with 45MBit/s TS.
Solved bugs :)
--------------
1g) pid-filtering (somehow pid index 4 and 5 (EMM_PID and ECM_PID) aren't
working)
SOLUTION: also index 0 was affected, because net_translation is done for
these indexes by default
5b) isochronous transfer does only work in the first attempt (for the Sky2PC
USB, Air2PC is working) SOLUTION: the flexcop was going asleep and never really
woke up again (don't know if this need fixes, see
flexcop-fe-tuner.c:flexcop_sleep)
NEWS: when the driver is loaded and unloaded and loaded again (w/o doing
anything in the while the driver is loaded the first time), no transfers take
place anymore.
Improvements when rewriting (refactoring) is done
=================================================
- split sleeping of the flexcop (misc_204.ACPI3_sig = 1;) from lnb_control
(enable sleeping for other demods than dvb-s)
- add support for CableStar (stv0297 Microtune 203x/ALPS) (almost done, incompatibilities with the Nexus-CA)
Debugging
---------
- add verbose debugging to skystar2.c (dump the reg_dw_data) and compare it
with this flexcop, this is important, because i2c is now using the
flexcop_ibi_value union from flexcop-reg.h (do you have a better idea for
that, please tell us so).
Everything which is identical in the following table, can be put into a common
flexcop-module.
PCI USB
-------------------------------------------------------------------------------
Different:
Register access: accessing IO memory USB control message
I2C bus: I2C bus of the FC USB control message
Data transfer: DMA isochronous transfer
EEPROM transfer: through i2c bus not clear yet
Identical:
Streaming: accessing registers
PID Filtering: accessing registers
Sram destinations: accessing registers
Tuner/Demod: I2C bus
DVB-stuff: can be written for common use
Acknowledgements (just for the rewriting part)
================
Bjarne Steinsbo thought a lot in the first place of the pci part for this code
sharing idea.
Andreas Oberritter for providing a recent PCI initialization template
(pluto2.c).
Boleslaw Ciesielski for pointing out a problem with firmware loader.
Vadim Catana for correcting the USB transfer.
comments, critics and ideas to linux-dvb@linuxtv.org.

View file

@ -1,5 +1,5 @@
How to set up the Technisat devices How to set up the Technisat/B2C2 Flexcop devices
=================================== ================================================
1) Find out what device you have 1) Find out what device you have
================================ ================================
@ -16,54 +16,60 @@ DVB: registering frontend 0 (Conexant CX24123/CX24109)...
If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one: If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one:
"Multimedia devices" => "Customise analog and hybrid tuner modules to build" "Multimedia devices" => "Customise analog and hybrid tuner modules to build"
In this directory uncheck every driver which is activated there. In this directory uncheck every driver which is activated there (except "Simple tuner support" for case 9 only).
Then please activate: Then please activate:
2a) Main module part: 2a) Main module part:
a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters"
b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card OR b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card
OR
c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter
d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers" d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers"
Notice: d.) is helpful for troubleshooting Notice: d.) is helpful for troubleshooting
2b) Frontend module part: 2b) Frontend module part:
1.) Revision 2.3: 1.) SkyStar DVB-S Revision 2.3:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based" b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based"
2.) Revision 2.6: 2.) SkyStar DVB-S Revision 2.6:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based" b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based"
3.) Revision 2.7: 3.) SkyStar DVB-S Revision 2.7:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based" b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based"
c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS" c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS"
d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller"
4.) Revision 2.8: 4.) SkyStar DVB-S Revision 2.8:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS" b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS"
c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based" c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based"
d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller"
5.) DVB-T card: 5.) AirStar DVB-T card:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based" b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based"
6.) DVB-C card: 6.) CableStar DVB-C card:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based" b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based"
7.) ATSC card 1st generation: 7.) AirStar ATSC card 1st generation:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510" b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510"
8.) ATSC card 2nd generation: 8.) AirStar ATSC card 2nd generation:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based" b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based"
c.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based" c.)"Multimedia devices" => "Customise DVB frontends" => "Generic I2C PLL based tuners"
Author: Uwe Bugla <uwe.bugla@gmx.de> December 2008 9.) AirStar ATSC card 3rd generation:
a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build"
b.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based"
c.)"Multimedia devices" => "Customise analog and hybrid tuner modules to build" => "Simple tuner support"
Author: Uwe Bugla <uwe.bugla@gmx.de> February 2009

View file

@ -868,8 +868,10 @@ and is between 256 and 4096 characters. It is defined in the file
icn= [HW,ISDN] icn= [HW,ISDN]
Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]] Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]
ide= [HW] (E)IDE subsystem ide-core.nodma= [HW] (E)IDE subsystem
Format: ide=nodma or ide=doubler Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
.chs .ignore_cable are additional options
See Documentation/ide/ide.txt. See Documentation/ide/ide.txt.
idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed

View file

@ -311,6 +311,9 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
gpio_request(gpio + 7, "nCF_SEL"); gpio_request(gpio + 7, "nCF_SEL");
gpio_direction_output(gpio + 7, 1); gpio_direction_output(gpio + 7, 1);
/* irlml6401 sustains over 3A, switches 5V in under 8 msec */
setup_usb(500, 8);
return 0; return 0;
} }
@ -417,9 +420,6 @@ static __init void davinci_evm_init(void)
platform_add_devices(davinci_evm_devices, platform_add_devices(davinci_evm_devices,
ARRAY_SIZE(davinci_evm_devices)); ARRAY_SIZE(davinci_evm_devices));
evm_init_i2c(); evm_init_i2c();
/* irlml6401 sustains over 3A, switches 5V in under 8 msec */
setup_usb(500, 8);
} }
static __init void davinci_evm_irq_init(void) static __init void davinci_evm_irq_init(void)

View file

@ -230,6 +230,11 @@ static struct clk davinci_clks[] = {
.rate = &commonrate, .rate = &commonrate,
.lpsc = DAVINCI_LPSC_GPIO, .lpsc = DAVINCI_LPSC_GPIO,
}, },
{
.name = "usb",
.rate = &commonrate,
.lpsc = DAVINCI_LPSC_USB,
},
{ {
.name = "AEMIFCLK", .name = "AEMIFCLK",
.rate = &commonrate, .rate = &commonrate,

View file

@ -47,6 +47,7 @@ static struct musb_hdrc_platform_data usb_data = {
#elif defined(CONFIG_USB_MUSB_HOST) #elif defined(CONFIG_USB_MUSB_HOST)
.mode = MUSB_HOST, .mode = MUSB_HOST,
#endif #endif
.clock = "usb",
.config = &musb_config, .config = &musb_config,
}; };

View file

@ -638,6 +638,17 @@ config DMAR
and include PCI device scope covered by these DMA and include PCI device scope covered by these DMA
remapping devices. remapping devices.
config DMAR_DEFAULT_ON
def_bool y
prompt "Enable DMA Remapping Devices by default"
depends on DMAR
help
Selecting this option will enable a DMAR device at boot time if
one is found. If this option is not selected, DMAR support can
be enabled by passing intel_iommu=on to the kernel. It is
recommended you say N here while the DMAR code remains
experimental.
endmenu endmenu
endif endif

View file

@ -507,7 +507,7 @@ static int iosapic_find_sharable_irq(unsigned long trigger, unsigned long pol)
if (trigger == IOSAPIC_EDGE) if (trigger == IOSAPIC_EDGE)
return -EINVAL; return -EINVAL;
for (i = 0; i <= NR_IRQS; i++) { for (i = 0; i < NR_IRQS; i++) {
info = &iosapic_intr_info[i]; info = &iosapic_intr_info[i];
if (info->trigger == trigger && info->polarity == pol && if (info->trigger == trigger && info->polarity == pol &&
(info->dmode == IOSAPIC_FIXED || (info->dmode == IOSAPIC_FIXED ||

View file

@ -2149,7 +2149,7 @@ unw_remove_unwind_table (void *handle)
/* next, remove hash table entries for this table */ /* next, remove hash table entries for this table */
for (index = 0; index <= UNW_HASH_SIZE; ++index) { for (index = 0; index < UNW_HASH_SIZE; ++index) {
tmp = unw.cache + unw.hash[index]; tmp = unw.cache + unw.hash[index];
if (unw.hash[index] >= UNW_CACHE_SIZE if (unw.hash[index] >= UNW_CACHE_SIZE
|| tmp->ip < table->start || tmp->ip >= table->end) || tmp->ip < table->start || tmp->ip >= table->end)

View file

@ -603,7 +603,7 @@ config CAVIUM_OCTEON_SIMULATOR
select SYS_SUPPORTS_64BIT_KERNEL select SYS_SUPPORTS_64BIT_KERNEL
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_HIGHMEM
select CPU_CAVIUM_OCTEON select SYS_HAS_CPU_CAVIUM_OCTEON
help help
The Octeon simulator is software performance model of the Cavium The Octeon simulator is software performance model of the Cavium
Octeon Processor. It supports simulating Octeon processors on x86 Octeon Processor. It supports simulating Octeon processors on x86
@ -618,7 +618,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD
select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_HIGHMEM
select SYS_HAS_EARLY_PRINTK select SYS_HAS_EARLY_PRINTK
select CPU_CAVIUM_OCTEON select SYS_HAS_CPU_CAVIUM_OCTEON
select SWAP_IO_SPACE select SWAP_IO_SPACE
help help
This option supports all of the Octeon reference boards from Cavium This option supports all of the Octeon reference boards from Cavium
@ -1234,6 +1234,7 @@ config CPU_SB1
config CPU_CAVIUM_OCTEON config CPU_CAVIUM_OCTEON
bool "Cavium Octeon processor" bool "Cavium Octeon processor"
depends on SYS_HAS_CPU_CAVIUM_OCTEON
select IRQ_CPU select IRQ_CPU
select IRQ_CPU_OCTEON select IRQ_CPU_OCTEON
select CPU_HAS_PREFETCH select CPU_HAS_PREFETCH
@ -1314,6 +1315,9 @@ config SYS_HAS_CPU_RM9000
config SYS_HAS_CPU_SB1 config SYS_HAS_CPU_SB1
bool bool
config SYS_HAS_CPU_CAVIUM_OCTEON
bool
# #
# CPU may reorder R->R, R->W, W->R, W->W # CPU may reorder R->R, R->W, W->R, W->W
# Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC
@ -1387,6 +1391,7 @@ config 32BIT
config 64BIT config 64BIT
bool "64-bit kernel" bool "64-bit kernel"
depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL
select HAVE_SYSCALL_WRAPPERS
help help
Select this option if you want to build a 64-bit kernel. Select this option if you want to build a 64-bit kernel.

View file

@ -118,7 +118,7 @@ void __init plat_time_init(void)
* setup counter 1 (RTC) to tick at full speed * setup counter 1 (RTC) to tick at full speed
*/ */
t = 0xffffff; t = 0xffffff;
while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--) while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && --t)
asm volatile ("nop"); asm volatile ("nop");
if (!t) if (!t)
goto cntr_err; goto cntr_err;
@ -127,7 +127,7 @@ void __init plat_time_init(void)
au_sync(); au_sync();
t = 0xffffff; t = 0xffffff;
while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t)
asm volatile ("nop"); asm volatile ("nop");
if (!t) if (!t)
goto cntr_err; goto cntr_err;
@ -135,7 +135,7 @@ void __init plat_time_init(void)
au_sync(); au_sync();
t = 0xffffff; t = 0xffffff;
while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t)
asm volatile ("nop"); asm volatile ("nop");
if (!t) if (!t)
goto cntr_err; goto cntr_err;

View file

@ -111,7 +111,6 @@ int show_interrupts(struct seq_file *p, void *v)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
#endif #endif
seq_printf(p, " %14s", irq_desc[i].chip->name); seq_printf(p, " %14s", irq_desc[i].chip->name);
seq_printf(p, "-%-8s", irq_desc[i].name);
seq_printf(p, " %s", action->name); seq_printf(p, " %s", action->name);
for (action=action->next; action; action = action->next) for (action=action->next; action; action = action->next)

View file

@ -32,6 +32,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/binfmts.h> #include <linux/binfmts.h>
#include <linux/security.h> #include <linux/security.h>
#include <linux/syscalls.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/vfs.h> #include <linux/vfs.h>
#include <linux/ipc.h> #include <linux/ipc.h>
@ -63,9 +64,9 @@
#define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL)) #define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL))
#endif #endif
asmlinkage unsigned long SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len,
sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long, prot, unsigned long, flags, unsigned long, fd,
unsigned long flags, unsigned long fd, unsigned long pgoff) unsigned long, pgoff)
{ {
struct file * file = NULL; struct file * file = NULL;
unsigned long error; unsigned long error;
@ -121,21 +122,21 @@ struct rlimit32 {
int rlim_max; int rlim_max;
}; };
asmlinkage long sys32_truncate64(const char __user * path, SYSCALL_DEFINE4(32_truncate64, const char __user *, path,
unsigned long __dummy, int a2, int a3) unsigned long, __dummy, unsigned long, a2, unsigned long, a3)
{ {
return sys_truncate(path, merge_64(a2, a3)); return sys_truncate(path, merge_64(a2, a3));
} }
asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long __dummy, SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy,
int a2, int a3) unsigned long, a2, unsigned long, a3)
{ {
return sys_ftruncate(fd, merge_64(a2, a3)); return sys_ftruncate(fd, merge_64(a2, a3));
} }
asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, SYSCALL_DEFINE5(32_llseek, unsigned long, fd, unsigned long, offset_high,
unsigned int offset_low, loff_t __user * result, unsigned long, offset_low, loff_t __user *, result,
unsigned int origin) unsigned long, origin)
{ {
return sys_llseek(fd, offset_high, offset_low, result, origin); return sys_llseek(fd, offset_high, offset_low, result, origin);
} }
@ -144,20 +145,20 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high,
lseek back to original location. They fail just like lseek does on lseek back to original location. They fail just like lseek does on
non-seekable files. */ non-seekable files. */
asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf, SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count,
size_t count, u32 unused, u64 a4, u64 a5) unsigned long, unused, unsigned long, a4, unsigned long, a5)
{ {
return sys_pread64(fd, buf, count, merge_64(a4, a5)); return sys_pread64(fd, buf, count, merge_64(a4, a5));
} }
asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf, SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
size_t count, u32 unused, u64 a4, u64 a5) size_t, count, u32, unused, u64, a4, u64, a5)
{ {
return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
} }
asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid,
struct compat_timespec __user *interval) struct compat_timespec __user *, interval)
{ {
struct timespec t; struct timespec t;
int ret; int ret;
@ -174,8 +175,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
#ifdef CONFIG_SYSVIPC #ifdef CONFIG_SYSVIPC
asmlinkage long SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third,
sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) unsigned long, ptr, unsigned long, fifth)
{ {
int version, err; int version, err;
@ -233,8 +234,8 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth)
#else #else
asmlinkage long SYSCALL_DEFINE6(32_ipc, u32, call, int, first, int, second, int, third,
sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) u32, ptr, u32 fifth)
{ {
return -ENOSYS; return -ENOSYS;
} }
@ -242,7 +243,7 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth)
#endif /* CONFIG_SYSVIPC */ #endif /* CONFIG_SYSVIPC */
#ifdef CONFIG_MIPS32_N32 #ifdef CONFIG_MIPS32_N32
asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg)
{ {
/* compat_sys_semctl expects a pointer to union semun */ /* compat_sys_semctl expects a pointer to union semun */
u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); u32 __user *uptr = compat_alloc_user_space(sizeof(u32));
@ -251,13 +252,14 @@ asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg)
return compat_sys_semctl(semid, semnum, cmd, uptr); return compat_sys_semctl(semid, semnum, cmd, uptr);
} }
asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg) SYSCALL_DEFINE4(n32_msgsnd, int, msqid, u32, msgp, unsigned int, msgsz,
int, msgflg)
{ {
return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp));
} }
asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp, SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
int msgflg) int, msgtyp, int, msgflg)
{ {
return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64,
compat_ptr(msgp)); compat_ptr(msgp));
@ -277,7 +279,7 @@ struct sysctl_args32
#ifdef CONFIG_SYSCTL_SYSCALL #ifdef CONFIG_SYSCTL_SYSCALL
asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args) SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
{ {
struct sysctl_args32 tmp; struct sysctl_args32 tmp;
int error; int error;
@ -316,9 +318,16 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args)
return error; return error;
} }
#else
SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
{
return -ENOSYS;
}
#endif /* CONFIG_SYSCTL_SYSCALL */ #endif /* CONFIG_SYSCTL_SYSCALL */
asmlinkage long sys32_newuname(struct new_utsname __user * name) SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
{ {
int ret = 0; int ret = 0;
@ -334,7 +343,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
return ret; return ret;
} }
asmlinkage int sys32_personality(unsigned long personality) SYSCALL_DEFINE1(32_personality, unsigned long, personality)
{ {
int ret; int ret;
personality &= 0xffffffff; personality &= 0xffffffff;
@ -357,7 +366,7 @@ struct ustat32 {
extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf); extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf);
asmlinkage int sys32_ustat(dev_t dev, struct ustat32 __user * ubuf32) SYSCALL_DEFINE2(32_ustat, dev_t, dev, struct ustat32 __user *, ubuf32)
{ {
int err; int err;
struct ustat tmp; struct ustat tmp;
@ -381,8 +390,8 @@ out:
return err; return err;
} }
asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd,
s32 count) compat_off_t __user *, offset, s32, count)
{ {
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
int ret; int ret;

View file

@ -399,7 +399,7 @@ einval: li v0, -ENOSYS
sys sys_swapon 2 sys sys_swapon 2
sys sys_reboot 3 sys sys_reboot 3
sys sys_old_readdir 3 sys sys_old_readdir 3
sys old_mmap 6 /* 4090 */ sys sys_mips_mmap 6 /* 4090 */
sys sys_munmap 2 sys sys_munmap 2
sys sys_truncate 2 sys sys_truncate 2
sys sys_ftruncate 2 sys sys_ftruncate 2
@ -519,7 +519,7 @@ einval: li v0, -ENOSYS
sys sys_sendfile 4 sys sys_sendfile 4
sys sys_ni_syscall 0 sys sys_ni_syscall 0
sys sys_ni_syscall 0 sys sys_ni_syscall 0
sys sys_mmap2 6 /* 4210 */ sys sys_mips_mmap2 6 /* 4210 */
sys sys_truncate64 4 sys sys_truncate64 4
sys sys_ftruncate64 4 sys sys_ftruncate64 4
sys sys_stat64 2 sys sys_stat64 2

View file

@ -207,7 +207,7 @@ sys_call_table:
PTR sys_newlstat PTR sys_newlstat
PTR sys_poll PTR sys_poll
PTR sys_lseek PTR sys_lseek
PTR old_mmap PTR sys_mips_mmap
PTR sys_mprotect /* 5010 */ PTR sys_mprotect /* 5010 */
PTR sys_munmap PTR sys_munmap
PTR sys_brk PTR sys_brk

View file

@ -129,12 +129,12 @@ EXPORT(sysn32_call_table)
PTR sys_newlstat PTR sys_newlstat
PTR sys_poll PTR sys_poll
PTR sys_lseek PTR sys_lseek
PTR old_mmap PTR sys_mips_mmap
PTR sys_mprotect /* 6010 */ PTR sys_mprotect /* 6010 */
PTR sys_munmap PTR sys_munmap
PTR sys_brk PTR sys_brk
PTR sys32_rt_sigaction PTR sys_32_rt_sigaction
PTR sys32_rt_sigprocmask PTR sys_32_rt_sigprocmask
PTR compat_sys_ioctl /* 6015 */ PTR compat_sys_ioctl /* 6015 */
PTR sys_pread64 PTR sys_pread64
PTR sys_pwrite64 PTR sys_pwrite64
@ -159,7 +159,7 @@ EXPORT(sysn32_call_table)
PTR compat_sys_setitimer PTR compat_sys_setitimer
PTR sys_alarm PTR sys_alarm
PTR sys_getpid PTR sys_getpid
PTR sys32_sendfile PTR sys_32_sendfile
PTR sys_socket /* 6040 */ PTR sys_socket /* 6040 */
PTR sys_connect PTR sys_connect
PTR sys_accept PTR sys_accept
@ -181,14 +181,14 @@ EXPORT(sysn32_call_table)
PTR sys_exit PTR sys_exit
PTR compat_sys_wait4 PTR compat_sys_wait4
PTR sys_kill /* 6060 */ PTR sys_kill /* 6060 */
PTR sys32_newuname PTR sys_32_newuname
PTR sys_semget PTR sys_semget
PTR sys_semop PTR sys_semop
PTR sysn32_semctl PTR sys_n32_semctl
PTR sys_shmdt /* 6065 */ PTR sys_shmdt /* 6065 */
PTR sys_msgget PTR sys_msgget
PTR sysn32_msgsnd PTR sys_n32_msgsnd
PTR sysn32_msgrcv PTR sys_n32_msgrcv
PTR compat_sys_msgctl PTR compat_sys_msgctl
PTR compat_sys_fcntl /* 6070 */ PTR compat_sys_fcntl /* 6070 */
PTR sys_flock PTR sys_flock
@ -245,15 +245,15 @@ EXPORT(sysn32_call_table)
PTR sys_getsid PTR sys_getsid
PTR sys_capget PTR sys_capget
PTR sys_capset PTR sys_capset
PTR sys32_rt_sigpending /* 6125 */ PTR sys_32_rt_sigpending /* 6125 */
PTR compat_sys_rt_sigtimedwait PTR compat_sys_rt_sigtimedwait
PTR sys32_rt_sigqueueinfo PTR sys_32_rt_sigqueueinfo
PTR sysn32_rt_sigsuspend PTR sysn32_rt_sigsuspend
PTR sys32_sigaltstack PTR sys32_sigaltstack
PTR compat_sys_utime /* 6130 */ PTR compat_sys_utime /* 6130 */
PTR sys_mknod PTR sys_mknod
PTR sys32_personality PTR sys_32_personality
PTR sys32_ustat PTR sys_32_ustat
PTR compat_sys_statfs PTR compat_sys_statfs
PTR compat_sys_fstatfs /* 6135 */ PTR compat_sys_fstatfs /* 6135 */
PTR sys_sysfs PTR sys_sysfs
@ -265,14 +265,14 @@ EXPORT(sysn32_call_table)
PTR sys_sched_getscheduler PTR sys_sched_getscheduler
PTR sys_sched_get_priority_max PTR sys_sched_get_priority_max
PTR sys_sched_get_priority_min PTR sys_sched_get_priority_min
PTR sys32_sched_rr_get_interval /* 6145 */ PTR sys_32_sched_rr_get_interval /* 6145 */
PTR sys_mlock PTR sys_mlock
PTR sys_munlock PTR sys_munlock
PTR sys_mlockall PTR sys_mlockall
PTR sys_munlockall PTR sys_munlockall
PTR sys_vhangup /* 6150 */ PTR sys_vhangup /* 6150 */
PTR sys_pivot_root PTR sys_pivot_root
PTR sys32_sysctl PTR sys_32_sysctl
PTR sys_prctl PTR sys_prctl
PTR compat_sys_adjtimex PTR compat_sys_adjtimex
PTR compat_sys_setrlimit /* 6155 */ PTR compat_sys_setrlimit /* 6155 */

View file

@ -265,12 +265,12 @@ sys_call_table:
PTR sys_olduname PTR sys_olduname
PTR sys_umask /* 4060 */ PTR sys_umask /* 4060 */
PTR sys_chroot PTR sys_chroot
PTR sys32_ustat PTR sys_32_ustat
PTR sys_dup2 PTR sys_dup2
PTR sys_getppid PTR sys_getppid
PTR sys_getpgrp /* 4065 */ PTR sys_getpgrp /* 4065 */
PTR sys_setsid PTR sys_setsid
PTR sys32_sigaction PTR sys_32_sigaction
PTR sys_sgetmask PTR sys_sgetmask
PTR sys_ssetmask PTR sys_ssetmask
PTR sys_setreuid /* 4070 */ PTR sys_setreuid /* 4070 */
@ -293,7 +293,7 @@ sys_call_table:
PTR sys_swapon PTR sys_swapon
PTR sys_reboot PTR sys_reboot
PTR compat_sys_old_readdir PTR compat_sys_old_readdir
PTR old_mmap /* 4090 */ PTR sys_mips_mmap /* 4090 */
PTR sys_munmap PTR sys_munmap
PTR sys_truncate PTR sys_truncate
PTR sys_ftruncate PTR sys_ftruncate
@ -320,12 +320,12 @@ sys_call_table:
PTR compat_sys_wait4 PTR compat_sys_wait4
PTR sys_swapoff /* 4115 */ PTR sys_swapoff /* 4115 */
PTR compat_sys_sysinfo PTR compat_sys_sysinfo
PTR sys32_ipc PTR sys_32_ipc
PTR sys_fsync PTR sys_fsync
PTR sys32_sigreturn PTR sys32_sigreturn
PTR sys32_clone /* 4120 */ PTR sys32_clone /* 4120 */
PTR sys_setdomainname PTR sys_setdomainname
PTR sys32_newuname PTR sys_32_newuname
PTR sys_ni_syscall /* sys_modify_ldt */ PTR sys_ni_syscall /* sys_modify_ldt */
PTR compat_sys_adjtimex PTR compat_sys_adjtimex
PTR sys_mprotect /* 4125 */ PTR sys_mprotect /* 4125 */
@ -339,11 +339,11 @@ sys_call_table:
PTR sys_fchdir PTR sys_fchdir
PTR sys_bdflush PTR sys_bdflush
PTR sys_sysfs /* 4135 */ PTR sys_sysfs /* 4135 */
PTR sys32_personality PTR sys_32_personality
PTR sys_ni_syscall /* for afs_syscall */ PTR sys_ni_syscall /* for afs_syscall */
PTR sys_setfsuid PTR sys_setfsuid
PTR sys_setfsgid PTR sys_setfsgid
PTR sys32_llseek /* 4140 */ PTR sys_32_llseek /* 4140 */
PTR compat_sys_getdents PTR compat_sys_getdents
PTR compat_sys_select PTR compat_sys_select
PTR sys_flock PTR sys_flock
@ -356,7 +356,7 @@ sys_call_table:
PTR sys_ni_syscall /* 4150 */ PTR sys_ni_syscall /* 4150 */
PTR sys_getsid PTR sys_getsid
PTR sys_fdatasync PTR sys_fdatasync
PTR sys32_sysctl PTR sys_32_sysctl
PTR sys_mlock PTR sys_mlock
PTR sys_munlock /* 4155 */ PTR sys_munlock /* 4155 */
PTR sys_mlockall PTR sys_mlockall
@ -368,7 +368,7 @@ sys_call_table:
PTR sys_sched_yield PTR sys_sched_yield
PTR sys_sched_get_priority_max PTR sys_sched_get_priority_max
PTR sys_sched_get_priority_min PTR sys_sched_get_priority_min
PTR sys32_sched_rr_get_interval /* 4165 */ PTR sys_32_sched_rr_get_interval /* 4165 */
PTR compat_sys_nanosleep PTR compat_sys_nanosleep
PTR sys_mremap PTR sys_mremap
PTR sys_accept PTR sys_accept
@ -397,25 +397,25 @@ sys_call_table:
PTR sys_getresgid PTR sys_getresgid
PTR sys_prctl PTR sys_prctl
PTR sys32_rt_sigreturn PTR sys32_rt_sigreturn
PTR sys32_rt_sigaction PTR sys_32_rt_sigaction
PTR sys32_rt_sigprocmask /* 4195 */ PTR sys_32_rt_sigprocmask /* 4195 */
PTR sys32_rt_sigpending PTR sys_32_rt_sigpending
PTR compat_sys_rt_sigtimedwait PTR compat_sys_rt_sigtimedwait
PTR sys32_rt_sigqueueinfo PTR sys_32_rt_sigqueueinfo
PTR sys32_rt_sigsuspend PTR sys32_rt_sigsuspend
PTR sys32_pread /* 4200 */ PTR sys_32_pread /* 4200 */
PTR sys32_pwrite PTR sys_32_pwrite
PTR sys_chown PTR sys_chown
PTR sys_getcwd PTR sys_getcwd
PTR sys_capget PTR sys_capget
PTR sys_capset /* 4205 */ PTR sys_capset /* 4205 */
PTR sys32_sigaltstack PTR sys32_sigaltstack
PTR sys32_sendfile PTR sys_32_sendfile
PTR sys_ni_syscall PTR sys_ni_syscall
PTR sys_ni_syscall PTR sys_ni_syscall
PTR sys32_mmap2 /* 4210 */ PTR sys_mips_mmap2 /* 4210 */
PTR sys32_truncate64 PTR sys_32_truncate64
PTR sys32_ftruncate64 PTR sys_32_ftruncate64
PTR sys_newstat PTR sys_newstat
PTR sys_newlstat PTR sys_newlstat
PTR sys_newfstat /* 4215 */ PTR sys_newfstat /* 4215 */
@ -481,7 +481,7 @@ sys_call_table:
PTR compat_sys_mq_notify /* 4275 */ PTR compat_sys_mq_notify /* 4275 */
PTR compat_sys_mq_getsetattr PTR compat_sys_mq_getsetattr
PTR sys_ni_syscall /* sys_vserver */ PTR sys_ni_syscall /* sys_vserver */
PTR sys32_waitid PTR sys_32_waitid
PTR sys_ni_syscall /* available, was setaltroot */ PTR sys_ni_syscall /* available, was setaltroot */
PTR sys_add_key /* 4280 */ PTR sys_add_key /* 4280 */
PTR sys_request_key PTR sys_request_key

View file

@ -19,6 +19,7 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/syscalls.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/abi.h> #include <asm/abi.h>
@ -338,8 +339,8 @@ asmlinkage int sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
} }
#ifdef CONFIG_TRAD_SIGNALS #ifdef CONFIG_TRAD_SIGNALS
asmlinkage int sys_sigaction(int sig, const struct sigaction __user *act, SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act,
struct sigaction __user *oact) struct sigaction __user *, oact)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;

View file

@ -349,8 +349,8 @@ asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
return -ERESTARTNOHAND; return -ERESTARTNOHAND;
} }
asmlinkage int sys32_sigaction(int sig, const struct sigaction32 __user *act, SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act,
struct sigaction32 __user *oact) struct sigaction32 __user *, oact)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
@ -704,9 +704,9 @@ struct mips_abi mips_abi_32 = {
.restart = __NR_O32_restart_syscall .restart = __NR_O32_restart_syscall
}; };
asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, SYSCALL_DEFINE4(32_rt_sigaction, int, sig,
struct sigaction32 __user *oact, const struct sigaction32 __user *, act,
unsigned int sigsetsize) struct sigaction32 __user *, oact, unsigned int, sigsetsize)
{ {
struct k_sigaction new_sa, old_sa; struct k_sigaction new_sa, old_sa;
int ret = -EINVAL; int ret = -EINVAL;
@ -748,8 +748,8 @@ out:
return ret; return ret;
} }
asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set,
compat_sigset_t __user *oset, unsigned int sigsetsize) compat_sigset_t __user *, oset, unsigned int, sigsetsize)
{ {
sigset_t old_set, new_set; sigset_t old_set, new_set;
int ret; int ret;
@ -770,8 +770,8 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
return ret; return ret;
} }
asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset, SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset,
unsigned int sigsetsize) unsigned int, sigsetsize)
{ {
int ret; int ret;
sigset_t set; sigset_t set;
@ -787,7 +787,8 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset,
return ret; return ret;
} }
asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig,
compat_siginfo_t __user *, uinfo)
{ {
siginfo_t info; siginfo_t info;
int ret; int ret;
@ -802,10 +803,9 @@ asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *
return ret; return ret;
} }
asmlinkage long SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid,
sys32_waitid(int which, compat_pid_t pid, compat_siginfo_t __user *, uinfo, int, options,
compat_siginfo_t __user *uinfo, int options, struct compat_rusage __user *, uru)
struct compat_rusage __user *uru)
{ {
siginfo_t info; siginfo_t info;
struct rusage ru; struct rusage ru;

View file

@ -152,9 +152,9 @@ out:
return error; return error;
} }
asmlinkage unsigned long SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len,
old_mmap(unsigned long addr, unsigned long len, int prot, unsigned long, prot, unsigned long, flags, unsigned long,
int flags, int fd, off_t offset) fd, off_t, offset)
{ {
unsigned long result; unsigned long result;
@ -168,9 +168,9 @@ out:
return result; return result;
} }
asmlinkage unsigned long SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,
sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long, prot, unsigned long, flags, unsigned long, fd,
unsigned long flags, unsigned long fd, unsigned long pgoff) unsigned long, pgoff)
{ {
if (pgoff & (~PAGE_MASK >> 12)) if (pgoff & (~PAGE_MASK >> 12))
return -EINVAL; return -EINVAL;
@ -240,7 +240,7 @@ out:
/* /*
* Compacrapability ... * Compacrapability ...
*/ */
asmlinkage int sys_uname(struct old_utsname __user * name) SYSCALL_DEFINE1(uname, struct old_utsname __user *, name)
{ {
if (name && !copy_to_user(name, utsname(), sizeof (*name))) if (name && !copy_to_user(name, utsname(), sizeof (*name)))
return 0; return 0;
@ -250,7 +250,7 @@ asmlinkage int sys_uname(struct old_utsname __user * name)
/* /*
* Compacrapability ... * Compacrapability ...
*/ */
asmlinkage int sys_olduname(struct oldold_utsname __user * name) SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
{ {
int error; int error;
@ -279,7 +279,7 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name)
return error; return error;
} }
asmlinkage int sys_set_thread_area(unsigned long addr) SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
{ {
struct thread_info *ti = task_thread_info(current); struct thread_info *ti = task_thread_info(current);
@ -290,7 +290,7 @@ asmlinkage int sys_set_thread_area(unsigned long addr)
return 0; return 0;
} }
asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) asmlinkage int _sys_sysmips(long cmd, long arg1, long arg2, long arg3)
{ {
switch (cmd) { switch (cmd) {
case MIPS_ATOMIC_SET: case MIPS_ATOMIC_SET:
@ -325,8 +325,8 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3)
* *
* This is really horribly ugly. * This is really horribly ugly.
*/ */
asmlinkage int sys_ipc(unsigned int call, int first, int second, SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second,
unsigned long third, void __user *ptr, long fifth) unsigned long, third, void __user *, ptr, long, fifth)
{ {
int version, ret; int version, ret;
@ -411,7 +411,7 @@ asmlinkage int sys_ipc(unsigned int call, int first, int second,
/* /*
* No implemented yet ... * No implemented yet ...
*/ */
asmlinkage int sys_cachectl(char *addr, int nbytes, int op) SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op)
{ {
return -ENOSYS; return -ENOSYS;
} }

View file

@ -13,6 +13,7 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/syscalls.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
@ -58,8 +59,8 @@ EXPORT_SYMBOL(_dma_cache_wback_inv);
* We could optimize the case where the cache argument is not BCACHE but * We could optimize the case where the cache argument is not BCACHE but
* that seems very atypical use ... * that seems very atypical use ...
*/ */
asmlinkage int sys_cacheflush(unsigned long addr, SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes,
unsigned long bytes, unsigned int cache) unsigned int, cache)
{ {
if (bytes == 0) if (bytes == 0)
return 0; return 0;

View file

@ -367,27 +367,24 @@ static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr,
static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg, static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg,
unsigned int flags) unsigned int flags)
{ {
char *ptr = (char *) &current->thread.TS_FPR(reg); char *ptr0 = (char *) &current->thread.TS_FPR(reg);
int i, ret; char *ptr1 = (char *) &current->thread.TS_FPR(reg+1);
int i, ret, sw = 0;
if (!(flags & F)) if (!(flags & F))
return 0; return 0;
if (reg & 1) if (reg & 1)
return 0; /* invalid form: FRS/FRT must be even */ return 0; /* invalid form: FRS/FRT must be even */
if (!(flags & SW)) { if (flags & SW)
/* not byte-swapped - easy */ sw = 7;
if (!(flags & ST)) ret = 0;
ret = __copy_from_user(ptr, addr, 16); for (i = 0; i < 8; ++i) {
else if (!(flags & ST)) {
ret = __copy_to_user(addr, ptr, 16); ret |= __get_user(ptr0[i^sw], addr + i);
} else { ret |= __get_user(ptr1[i^sw], addr + i + 8);
/* each FPR value is byte-swapped separately */ } else {
ret = 0; ret |= __put_user(ptr0[i^sw], addr + i);
for (i = 0; i < 16; ++i) { ret |= __put_user(ptr1[i^sw], addr + i + 8);
if (!(flags & ST))
ret |= __get_user(ptr[i^7], addr + i);
else
ret |= __put_user(ptr[i^7], addr + i);
} }
} }
if (ret) if (ret)

View file

@ -62,18 +62,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
72: std r8,8(r3) 72: std r8,8(r3)
beq+ 3f beq+ 3f
addi r3,r3,16 addi r3,r3,16
23: ld r9,8(r4)
.Ldo_tail: .Ldo_tail:
bf cr7*4+1,1f bf cr7*4+1,1f
rotldi r9,r9,32 23: lwz r9,8(r4)
addi r4,r4,4
73: stw r9,0(r3) 73: stw r9,0(r3)
addi r3,r3,4 addi r3,r3,4
1: bf cr7*4+2,2f 1: bf cr7*4+2,2f
rotldi r9,r9,16 44: lhz r9,8(r4)
addi r4,r4,2
74: sth r9,0(r3) 74: sth r9,0(r3)
addi r3,r3,2 addi r3,r3,2
2: bf cr7*4+3,3f 2: bf cr7*4+3,3f
rotldi r9,r9,8 45: lbz r9,8(r4)
75: stb r9,0(r3) 75: stb r9,0(r3)
3: li r3,0 3: li r3,0
blr blr
@ -141,11 +142,24 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
6: cmpwi cr1,r5,8 6: cmpwi cr1,r5,8
addi r3,r3,32 addi r3,r3,32
sld r9,r9,r10 sld r9,r9,r10
ble cr1,.Ldo_tail ble cr1,7f
34: ld r0,8(r4) 34: ld r0,8(r4)
srd r7,r0,r11 srd r7,r0,r11
or r9,r7,r9 or r9,r7,r9
b .Ldo_tail 7:
bf cr7*4+1,1f
rotldi r9,r9,32
94: stw r9,0(r3)
addi r3,r3,4
1: bf cr7*4+2,2f
rotldi r9,r9,16
95: sth r9,0(r3)
addi r3,r3,2
2: bf cr7*4+3,3f
rotldi r9,r9,8
96: stb r9,0(r3)
3: li r3,0
blr
.Ldst_unaligned: .Ldst_unaligned:
PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */ PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */
@ -218,7 +232,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
121: 121:
132: 132:
addi r3,r3,8 addi r3,r3,8
123:
134: 134:
135: 135:
138: 138:
@ -226,6 +239,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
140: 140:
141: 141:
142: 142:
123:
144:
145:
/* /*
* here we have had a fault on a load and r3 points to the first * here we have had a fault on a load and r3 points to the first
@ -309,6 +325,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
187: 187:
188: 188:
189: 189:
194:
195:
196:
1: 1:
ld r6,-24(r1) ld r6,-24(r1)
ld r5,-8(r1) ld r5,-8(r1)
@ -329,7 +348,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
.llong 72b,172b .llong 72b,172b
.llong 23b,123b .llong 23b,123b
.llong 73b,173b .llong 73b,173b
.llong 44b,144b
.llong 74b,174b .llong 74b,174b
.llong 45b,145b
.llong 75b,175b .llong 75b,175b
.llong 24b,124b .llong 24b,124b
.llong 25b,125b .llong 25b,125b
@ -347,6 +368,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
.llong 79b,179b .llong 79b,179b
.llong 80b,180b .llong 80b,180b
.llong 34b,134b .llong 34b,134b
.llong 94b,194b
.llong 95b,195b
.llong 96b,196b
.llong 35b,135b .llong 35b,135b
.llong 81b,181b .llong 81b,181b
.llong 36b,136b .llong 36b,136b

View file

@ -53,18 +53,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
3: std r8,8(r3) 3: std r8,8(r3)
beq 3f beq 3f
addi r3,r3,16 addi r3,r3,16
ld r9,8(r4)
.Ldo_tail: .Ldo_tail:
bf cr7*4+1,1f bf cr7*4+1,1f
rotldi r9,r9,32 lwz r9,8(r4)
addi r4,r4,4
stw r9,0(r3) stw r9,0(r3)
addi r3,r3,4 addi r3,r3,4
1: bf cr7*4+2,2f 1: bf cr7*4+2,2f
rotldi r9,r9,16 lhz r9,8(r4)
addi r4,r4,2
sth r9,0(r3) sth r9,0(r3)
addi r3,r3,2 addi r3,r3,2
2: bf cr7*4+3,3f 2: bf cr7*4+3,3f
rotldi r9,r9,8 lbz r9,8(r4)
stb r9,0(r3) stb r9,0(r3)
3: ld r3,48(r1) /* return dest pointer */ 3: ld r3,48(r1) /* return dest pointer */
blr blr
@ -133,11 +134,24 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
cmpwi cr1,r5,8 cmpwi cr1,r5,8
addi r3,r3,32 addi r3,r3,32
sld r9,r9,r10 sld r9,r9,r10
ble cr1,.Ldo_tail ble cr1,6f
ld r0,8(r4) ld r0,8(r4)
srd r7,r0,r11 srd r7,r0,r11
or r9,r7,r9 or r9,r7,r9
b .Ldo_tail 6:
bf cr7*4+1,1f
rotldi r9,r9,32
stw r9,0(r3)
addi r3,r3,4
1: bf cr7*4+2,2f
rotldi r9,r9,16
sth r9,0(r3)
addi r3,r3,2
2: bf cr7*4+3,3f
rotldi r9,r9,8
stb r9,0(r3)
3: ld r3,48(r1) /* return dest pointer */
blr
.Ldst_unaligned: .Ldst_unaligned:
PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7

View file

@ -204,6 +204,23 @@ static int __init ppc4xx_setup_one_pci_PMM(struct pci_controller *hose,
{ {
u32 ma, pcila, pciha; u32 ma, pcila, pciha;
/* Hack warning ! The "old" PCI 2.x cell only let us configure the low
* 32-bit of incoming PLB addresses. The top 4 bits of the 36-bit
* address are actually hard wired to a value that appears to depend
* on the specific SoC. For example, it's 0 on 440EP and 1 on 440EPx.
*
* The trick here is we just crop those top bits and ignore them when
* programming the chip. That means the device-tree has to be right
* for the specific part used (we don't print a warning if it's wrong
* but on the other hand, you'll crash quickly enough), but at least
* this code should work whatever the hard coded value is
*/
plb_addr &= 0xffffffffull;
/* Note: Due to the above hack, the test below doesn't actually test
* if you address is above 4G, but it tests that address and
* (address + size) are both contained in the same 4G
*/
if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) ||
size < 0x1000 || (plb_addr & (size - 1)) != 0) { size < 0x1000 || (plb_addr & (size - 1)) != 0) {
printk(KERN_WARNING "%s: Resource out of range\n", printk(KERN_WARNING "%s: Resource out of range\n",

View file

@ -22,7 +22,6 @@
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/spi_gpio.h> #include <linux/spi/spi_gpio.h>
#include <media/ov772x.h>
#include <media/soc_camera_platform.h> #include <media/soc_camera_platform.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
@ -224,7 +223,6 @@ static void camera_power(int val)
} }
#ifdef CONFIG_I2C #ifdef CONFIG_I2C
/* support for the old ncm03j camera */
static unsigned char camera_ncm03j_magic[] = static unsigned char camera_ncm03j_magic[] =
{ {
0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8, 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8,
@ -245,23 +243,6 @@ static unsigned char camera_ncm03j_magic[] =
0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F, 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F,
}; };
static int camera_probe(void)
{
struct i2c_adapter *a = i2c_get_adapter(0);
struct i2c_msg msg;
int ret;
camera_power(1);
msg.addr = 0x6e;
msg.buf = camera_ncm03j_magic;
msg.len = 2;
msg.flags = 0;
ret = i2c_transfer(a, &msg, 1);
camera_power(0);
return ret;
}
static int camera_set_capture(struct soc_camera_platform_info *info, static int camera_set_capture(struct soc_camera_platform_info *info,
int enable) int enable)
{ {
@ -313,35 +294,8 @@ static struct platform_device camera_device = {
.platform_data = &camera_info, .platform_data = &camera_info,
}, },
}; };
static int __init camera_setup(void)
{
if (camera_probe() > 0)
platform_device_register(&camera_device);
return 0;
}
late_initcall(camera_setup);
#endif /* CONFIG_I2C */ #endif /* CONFIG_I2C */
static int ov7725_power(struct device *dev, int mode)
{
camera_power(0);
if (mode)
camera_power(1);
return 0;
}
static struct ov772x_camera_info ov7725_info = {
.buswidth = SOCAM_DATAWIDTH_8,
.flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP,
.link = {
.power = ov7725_power,
},
};
static struct sh_mobile_ceu_info sh_mobile_ceu_info = { static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
.flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8,
@ -392,6 +346,9 @@ static struct platform_device *ap325rxa_devices[] __initdata = {
&ap325rxa_nor_flash_device, &ap325rxa_nor_flash_device,
&lcdc_device, &lcdc_device,
&ceu_device, &ceu_device,
#ifdef CONFIG_I2C
&camera_device,
#endif
&nand_flash_device, &nand_flash_device,
&sdcard_cn3_device, &sdcard_cn3_device,
}; };
@ -400,10 +357,6 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
{ {
I2C_BOARD_INFO("pcf8563", 0x51), I2C_BOARD_INFO("pcf8563", 0x51),
}, },
{
I2C_BOARD_INFO("ov772x", 0x21),
.platform_data = &ov7725_info,
},
}; };
static struct spi_board_info ap325rxa_spi_devices[] = { static struct spi_board_info ap325rxa_spi_devices[] = {

View file

@ -18,8 +18,8 @@
#include <asm/freq.h> #include <asm/freq.h>
#include <asm/io.h> #include <asm/io.h>
const static int pll1rate[]={1,2,3,4,6,8}; static const int pll1rate[]={1,2,3,4,6,8};
const static int pfc_divisors[]={1,2,3,4,6,8,12}; static const int pfc_divisors[]={1,2,3,4,6,8,12};
#define ifc_divisors pfc_divisors #define ifc_divisors pfc_divisors
#if (CONFIG_SH_CLK_MD == 0) #if (CONFIG_SH_CLK_MD == 0)

View file

@ -306,6 +306,7 @@ static int jbusmc_print_dimm(int syndrome_code,
buf[1] = '?'; buf[1] = '?';
buf[2] = '?'; buf[2] = '?';
buf[3] = '\0'; buf[3] = '\0';
return 0;
} }
p = dp->controller; p = dp->controller;
prop = &p->layout; prop = &p->layout;

View file

@ -1822,7 +1822,7 @@ config DMAR
remapping devices. remapping devices.
config DMAR_DEFAULT_ON config DMAR_DEFAULT_ON
def_bool n def_bool y
prompt "Enable DMA Remapping Devices by default" prompt "Enable DMA Remapping Devices by default"
depends on DMAR depends on DMAR
help help

View file

@ -20,23 +20,16 @@
#include <asm/pat.h> #include <asm/pat.h>
#include <linux/module.h> #include <linux/module.h>
#ifdef CONFIG_X86_PAE int is_io_mapping_possible(resource_size_t base, unsigned long size)
int
is_io_mapping_possible(resource_size_t base, unsigned long size)
{
return 1;
}
#else
int
is_io_mapping_possible(resource_size_t base, unsigned long size)
{ {
#ifndef CONFIG_X86_PAE
/* There is no way to map greater than 1 << 32 address without PAE */ /* There is no way to map greater than 1 << 32 address without PAE */
if (base + size > 0x100000000ULL) if (base + size > 0x100000000ULL)
return 0; return 0;
#endif
return 1; return 1;
} }
#endif EXPORT_SYMBOL_GPL(is_io_mapping_possible);
/* Map 'pfn' using fixed map 'type' and protections 'prot' /* Map 'pfn' using fixed map 'type' and protections 'prot'
*/ */

View file

@ -11,6 +11,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/fs.h> #include <linux/fs.h>
@ -889,6 +890,7 @@ pgprot_t pgprot_writecombine(pgprot_t prot)
else else
return pgprot_noncached(prot); return pgprot_noncached(prot);
} }
EXPORT_SYMBOL_GPL(pgprot_writecombine);
#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT)

View file

@ -38,72 +38,84 @@ void blk_recalc_rq_sectors(struct request *rq, int nsect)
} }
} }
void blk_recalc_rq_segments(struct request *rq) static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
struct bio *bio,
unsigned int *seg_size_ptr)
{ {
int nr_phys_segs;
unsigned int phys_size; unsigned int phys_size;
struct bio_vec *bv, *bvprv = NULL; struct bio_vec *bv, *bvprv = NULL;
int seg_size; int cluster, i, high, highprv = 1;
int cluster; unsigned int seg_size, nr_phys_segs;
struct req_iterator iter; struct bio *fbio;
int high, highprv = 1;
struct request_queue *q = rq->q;
if (!rq->bio) if (!bio)
return; return 0;
fbio = bio;
cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
seg_size = 0; seg_size = 0;
phys_size = nr_phys_segs = 0; phys_size = nr_phys_segs = 0;
rq_for_each_segment(bv, rq, iter) { for_each_bio(bio) {
/* bio_for_each_segment(bv, bio, i) {
* the trick here is making sure that a high page is never /*
* considered part of another segment, since that might * the trick here is making sure that a high page is
* change with the bounce page. * never considered part of another segment, since that
*/ * might change with the bounce page.
high = page_to_pfn(bv->bv_page) > q->bounce_pfn; */
if (high || highprv) high = page_to_pfn(bv->bv_page) > q->bounce_pfn;
goto new_segment; if (high || highprv)
if (cluster) {
if (seg_size + bv->bv_len > q->max_segment_size)
goto new_segment;
if (!BIOVEC_PHYS_MERGEABLE(bvprv, bv))
goto new_segment;
if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv))
goto new_segment; goto new_segment;
if (cluster) {
if (seg_size + bv->bv_len > q->max_segment_size)
goto new_segment;
if (!BIOVEC_PHYS_MERGEABLE(bvprv, bv))
goto new_segment;
if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bv))
goto new_segment;
seg_size += bv->bv_len; seg_size += bv->bv_len;
bvprv = bv; bvprv = bv;
continue; continue;
} }
new_segment: new_segment:
if (nr_phys_segs == 1 && seg_size > rq->bio->bi_seg_front_size) if (nr_phys_segs == 1 && seg_size >
rq->bio->bi_seg_front_size = seg_size; fbio->bi_seg_front_size)
fbio->bi_seg_front_size = seg_size;
nr_phys_segs++; nr_phys_segs++;
bvprv = bv; bvprv = bv;
seg_size = bv->bv_len; seg_size = bv->bv_len;
highprv = high; highprv = high;
}
} }
if (nr_phys_segs == 1 && seg_size > rq->bio->bi_seg_front_size) if (seg_size_ptr)
*seg_size_ptr = seg_size;
return nr_phys_segs;
}
void blk_recalc_rq_segments(struct request *rq)
{
unsigned int seg_size = 0, phys_segs;
phys_segs = __blk_recalc_rq_segments(rq->q, rq->bio, &seg_size);
if (phys_segs == 1 && seg_size > rq->bio->bi_seg_front_size)
rq->bio->bi_seg_front_size = seg_size; rq->bio->bi_seg_front_size = seg_size;
if (seg_size > rq->biotail->bi_seg_back_size) if (seg_size > rq->biotail->bi_seg_back_size)
rq->biotail->bi_seg_back_size = seg_size; rq->biotail->bi_seg_back_size = seg_size;
rq->nr_phys_segments = nr_phys_segs; rq->nr_phys_segments = phys_segs;
} }
void blk_recount_segments(struct request_queue *q, struct bio *bio) void blk_recount_segments(struct request_queue *q, struct bio *bio)
{ {
struct request rq;
struct bio *nxt = bio->bi_next; struct bio *nxt = bio->bi_next;
rq.q = q;
rq.bio = rq.biotail = bio;
bio->bi_next = NULL; bio->bi_next = NULL;
blk_recalc_rq_segments(&rq); bio->bi_phys_segments = __blk_recalc_rq_segments(q, bio, NULL);
bio->bi_next = nxt; bio->bi_next = nxt;
bio->bi_phys_segments = rq.nr_phys_segments;
bio->bi_flags |= (1 << BIO_SEG_VALID); bio->bi_flags |= (1 << BIO_SEG_VALID);
} }
EXPORT_SYMBOL(blk_recount_segments); EXPORT_SYMBOL(blk_recount_segments);

View file

@ -256,6 +256,22 @@ void blkdev_show(struct seq_file *seqf, off_t offset)
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
/**
* register_blkdev - register a new block device
*
* @major: the requested major device number [1..255]. If @major=0, try to
* allocate any unused major number.
* @name: the name of the new block device as a zero terminated string
*
* The @name must be unique within the system.
*
* The return value depends on the @major input parameter.
* - if a major device number was requested in range [1..255] then the
* function returns zero on success, or a negative error code
* - if any unused major number was requested with @major=0 parameter
* then the return value is the allocated major number in range
* [1..255] or a negative error code otherwise
*/
int register_blkdev(unsigned int major, const char *name) int register_blkdev(unsigned int major, const char *name)
{ {
struct blk_major_name **n, *p; struct blk_major_name **n, *p;

View file

@ -24,7 +24,7 @@
#include <linux/libata.h> #include <linux/libata.h>
#define DRV_NAME "pata_amd" #define DRV_NAME "pata_amd"
#define DRV_VERSION "0.3.11" #define DRV_VERSION "0.4.1"
/** /**
* timing_setup - shared timing computation and load * timing_setup - shared timing computation and load
@ -145,6 +145,13 @@ static int amd_pre_reset(struct ata_link *link, unsigned long deadline)
return ata_sff_prereset(link, deadline); return ata_sff_prereset(link, deadline);
} }
/**
* amd_cable_detect - report cable type
* @ap: port
*
* AMD controller/BIOS setups record the cable type in word 0x42
*/
static int amd_cable_detect(struct ata_port *ap) static int amd_cable_detect(struct ata_port *ap)
{ {
static const u32 bitmask[2] = {0x03, 0x0C}; static const u32 bitmask[2] = {0x03, 0x0C};
@ -157,6 +164,40 @@ static int amd_cable_detect(struct ata_port *ap)
return ATA_CBL_PATA40; return ATA_CBL_PATA40;
} }
/**
* amd_fifo_setup - set the PIO FIFO for ATA/ATAPI
* @ap: ATA interface
* @adev: ATA device
*
* Set the PCI fifo for this device according to the devices present
* on the bus at this point in time. We need to turn the post write buffer
* off for ATAPI devices as we may need to issue a word sized write to the
* device as the final I/O
*/
static void amd_fifo_setup(struct ata_port *ap)
{
struct ata_device *adev;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
static const u8 fifobit[2] = { 0xC0, 0x30};
u8 fifo = fifobit[ap->port_no];
u8 r;
ata_for_each_dev(adev, &ap->link, ENABLED) {
if (adev->class == ATA_DEV_ATAPI)
fifo = 0;
}
if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411) /* FIFO is broken */
fifo = 0;
/* On the later chips the read prefetch bits become no-op bits */
pci_read_config_byte(pdev, 0x41, &r);
r &= ~fifobit[ap->port_no];
r |= fifo;
pci_write_config_byte(pdev, 0x41, r);
}
/** /**
* amd33_set_piomode - set initial PIO mode data * amd33_set_piomode - set initial PIO mode data
* @ap: ATA interface * @ap: ATA interface
@ -167,21 +208,25 @@ static int amd_cable_detect(struct ata_port *ap)
static void amd33_set_piomode(struct ata_port *ap, struct ata_device *adev) static void amd33_set_piomode(struct ata_port *ap, struct ata_device *adev)
{ {
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 1); timing_setup(ap, adev, 0x40, adev->pio_mode, 1);
} }
static void amd66_set_piomode(struct ata_port *ap, struct ata_device *adev) static void amd66_set_piomode(struct ata_port *ap, struct ata_device *adev)
{ {
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 2); timing_setup(ap, adev, 0x40, adev->pio_mode, 2);
} }
static void amd100_set_piomode(struct ata_port *ap, struct ata_device *adev) static void amd100_set_piomode(struct ata_port *ap, struct ata_device *adev)
{ {
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 3); timing_setup(ap, adev, 0x40, adev->pio_mode, 3);
} }
static void amd133_set_piomode(struct ata_port *ap, struct ata_device *adev) static void amd133_set_piomode(struct ata_port *ap, struct ata_device *adev)
{ {
amd_fifo_setup(ap);
timing_setup(ap, adev, 0x40, adev->pio_mode, 4); timing_setup(ap, adev, 0x40, adev->pio_mode, 4);
} }
@ -397,6 +442,16 @@ static struct ata_port_operations nv133_port_ops = {
.set_dmamode = nv133_set_dmamode, .set_dmamode = nv133_set_dmamode,
}; };
static void amd_clear_fifo(struct pci_dev *pdev)
{
u8 fifo;
/* Disable the FIFO, the FIFO logic will re-enable it as
appropriate */
pci_read_config_byte(pdev, 0x41, &fifo);
fifo &= 0x0F;
pci_write_config_byte(pdev, 0x41, fifo);
}
static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
{ {
static const struct ata_port_info info[10] = { static const struct ata_port_info info[10] = {
@ -503,14 +558,8 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
if (type < 3) if (type < 3)
ata_pci_bmdma_clear_simplex(pdev); ata_pci_bmdma_clear_simplex(pdev);
if (pdev->vendor == PCI_VENDOR_ID_AMD)
/* Check for AMD7411 */ amd_clear_fifo(pdev);
if (type == 3)
/* FIFO is broken */
pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
else
pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
/* Cable detection on Nvidia chips doesn't work too well, /* Cable detection on Nvidia chips doesn't work too well,
* cache BIOS programmed UDMA mode. * cache BIOS programmed UDMA mode.
*/ */
@ -536,18 +585,11 @@ static int amd_reinit_one(struct pci_dev *pdev)
return rc; return rc;
if (pdev->vendor == PCI_VENDOR_ID_AMD) { if (pdev->vendor == PCI_VENDOR_ID_AMD) {
u8 fifo; amd_clear_fifo(pdev);
pci_read_config_byte(pdev, 0x41, &fifo);
if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
/* FIFO is broken */
pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
else
pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 || if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401) pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
ata_pci_bmdma_clear_simplex(pdev); ata_pci_bmdma_clear_simplex(pdev);
} }
ata_host_resume(host); ata_host_resume(host);
return 0; return 0;
} }

View file

@ -557,6 +557,9 @@ static unsigned int it821x_read_id(struct ata_device *adev,
id[83] |= 0x4400; /* Word 83 is valid and LBA48 */ id[83] |= 0x4400; /* Word 83 is valid and LBA48 */
id[86] |= 0x0400; /* LBA48 on */ id[86] |= 0x0400; /* LBA48 on */
id[ATA_ID_MAJOR_VER] |= 0x1F; id[ATA_ID_MAJOR_VER] |= 0x1F;
/* Clear the serial number because it's different each boot
which breaks validation on resume */
memset(&id[ATA_ID_SERNO], 0x20, ATA_ID_SERNO_LEN);
} }
return err_mask; return err_mask;
} }

View file

@ -283,9 +283,10 @@ static void pdc20230_set_piomode(struct ata_port *ap, struct ata_device *adev)
static unsigned int pdc_data_xfer_vlb(struct ata_device *dev, static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
unsigned char *buf, unsigned int buflen, int rw) unsigned char *buf, unsigned int buflen, int rw)
{ {
if (ata_id_has_dword_io(dev->id)) { int slop = buflen & 3;
/* 32bit I/O capable *and* we need to write a whole number of dwords */
if (ata_id_has_dword_io(dev->id) && (slop == 0 || slop == 3)) {
struct ata_port *ap = dev->link->ap; struct ata_port *ap = dev->link->ap;
int slop = buflen & 3;
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save(flags);
@ -735,7 +736,7 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
struct ata_port *ap = adev->link->ap; struct ata_port *ap = adev->link->ap;
int slop = buflen & 3; int slop = buflen & 3;
if (ata_id_has_dword_io(adev->id)) { if (ata_id_has_dword_io(adev->id) && (slop == 0 || slop == 3)) {
if (rw == WRITE) if (rw == WRITE)
iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
else else

View file

@ -3114,19 +3114,17 @@ static int mv_init_host(struct ata_host *host, unsigned int board_idx)
writelfl(0, hc_mmio + HC_IRQ_CAUSE_OFS); writelfl(0, hc_mmio + HC_IRQ_CAUSE_OFS);
} }
if (!IS_SOC(hpriv)) { /* Clear any currently outstanding host interrupt conditions */
/* Clear any currently outstanding host interrupt conditions */ writelfl(0, mmio + hpriv->irq_cause_ofs);
writelfl(0, mmio + hpriv->irq_cause_ofs);
/* and unmask interrupt generation for host regs */ /* and unmask interrupt generation for host regs */
writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs); writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);
/* /*
* enable only global host interrupts for now. * enable only global host interrupts for now.
* The per-port interrupts get done later as ports are set up. * The per-port interrupts get done later as ports are set up.
*/ */
mv_set_main_irq_mask(host, 0, PCI_ERR); mv_set_main_irq_mask(host, 0, PCI_ERR);
}
done: done:
return rc; return rc;
} }

View file

@ -3611,11 +3611,15 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
schedule_timeout_uninterruptible(30*HZ); schedule_timeout_uninterruptible(30*HZ);
/* Now try to get the controller to respond to a no-op */ /* Now try to get the controller to respond to a no-op */
for (i=0; i<12; i++) { for (i=0; i<30; i++) {
if (cciss_noop(pdev) == 0) if (cciss_noop(pdev) == 0)
break; break;
else
printk("cciss: no-op failed%s\n", (i < 11 ? "; re-trying" : "")); schedule_timeout_uninterruptible(HZ);
}
if (i == 30) {
printk(KERN_ERR "cciss: controller seems dead\n");
return -EBUSY;
} }
} }

View file

@ -40,6 +40,7 @@
#include <linux/hdreg.h> #include <linux/hdreg.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/scatterlist.h>
#include <xen/xenbus.h> #include <xen/xenbus.h>
#include <xen/grant_table.h> #include <xen/grant_table.h>
@ -82,6 +83,7 @@ struct blkfront_info
enum blkif_state connected; enum blkif_state connected;
int ring_ref; int ring_ref;
struct blkif_front_ring ring; struct blkif_front_ring ring;
struct scatterlist sg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
unsigned int evtchn, irq; unsigned int evtchn, irq;
struct request_queue *rq; struct request_queue *rq;
struct work_struct work; struct work_struct work;
@ -204,12 +206,11 @@ static int blkif_queue_request(struct request *req)
struct blkfront_info *info = req->rq_disk->private_data; struct blkfront_info *info = req->rq_disk->private_data;
unsigned long buffer_mfn; unsigned long buffer_mfn;
struct blkif_request *ring_req; struct blkif_request *ring_req;
struct req_iterator iter;
struct bio_vec *bvec;
unsigned long id; unsigned long id;
unsigned int fsect, lsect; unsigned int fsect, lsect;
int ref; int i, ref;
grant_ref_t gref_head; grant_ref_t gref_head;
struct scatterlist *sg;
if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) if (unlikely(info->connected != BLKIF_STATE_CONNECTED))
return 1; return 1;
@ -238,12 +239,13 @@ static int blkif_queue_request(struct request *req)
if (blk_barrier_rq(req)) if (blk_barrier_rq(req))
ring_req->operation = BLKIF_OP_WRITE_BARRIER; ring_req->operation = BLKIF_OP_WRITE_BARRIER;
ring_req->nr_segments = 0; ring_req->nr_segments = blk_rq_map_sg(req->q, req, info->sg);
rq_for_each_segment(bvec, req, iter) { BUG_ON(ring_req->nr_segments > BLKIF_MAX_SEGMENTS_PER_REQUEST);
BUG_ON(ring_req->nr_segments == BLKIF_MAX_SEGMENTS_PER_REQUEST);
buffer_mfn = pfn_to_mfn(page_to_pfn(bvec->bv_page)); for_each_sg(info->sg, sg, ring_req->nr_segments, i) {
fsect = bvec->bv_offset >> 9; buffer_mfn = pfn_to_mfn(page_to_pfn(sg_page(sg)));
lsect = fsect + (bvec->bv_len >> 9) - 1; fsect = sg->offset >> 9;
lsect = fsect + (sg->length >> 9) - 1;
/* install a grant reference. */ /* install a grant reference. */
ref = gnttab_claim_grant_reference(&gref_head); ref = gnttab_claim_grant_reference(&gref_head);
BUG_ON(ref == -ENOSPC); BUG_ON(ref == -ENOSPC);
@ -254,16 +256,12 @@ static int blkif_queue_request(struct request *req)
buffer_mfn, buffer_mfn,
rq_data_dir(req) ); rq_data_dir(req) );
info->shadow[id].frame[ring_req->nr_segments] = info->shadow[id].frame[i] = mfn_to_pfn(buffer_mfn);
mfn_to_pfn(buffer_mfn); ring_req->seg[i] =
ring_req->seg[ring_req->nr_segments] =
(struct blkif_request_segment) { (struct blkif_request_segment) {
.gref = ref, .gref = ref,
.first_sect = fsect, .first_sect = fsect,
.last_sect = lsect }; .last_sect = lsect };
ring_req->nr_segments++;
} }
info->ring.req_prod_pvt++; info->ring.req_prod_pvt++;
@ -622,6 +620,8 @@ static int setup_blkring(struct xenbus_device *dev,
SHARED_RING_INIT(sring); SHARED_RING_INIT(sring);
FRONT_RING_INIT(&info->ring, sring, PAGE_SIZE); FRONT_RING_INIT(&info->ring, sring, PAGE_SIZE);
sg_init_table(info->sg, BLKIF_MAX_SEGMENTS_PER_REQUEST);
err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring)); err = xenbus_grant_ring(dev, virt_to_mfn(info->ring.sring));
if (err < 0) { if (err < 0) {
free_page((unsigned long)sring); free_page((unsigned long)sring);

View file

@ -452,6 +452,59 @@ static void drm_setup_crtcs(struct drm_device *dev)
kfree(modes); kfree(modes);
kfree(enabled); kfree(enabled);
} }
/**
* drm_encoder_crtc_ok - can a given crtc drive a given encoder?
* @encoder: encoder to test
* @crtc: crtc to test
*
* Return false if @encoder can't be driven by @crtc, true otherwise.
*/
static bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
struct drm_crtc *crtc)
{
struct drm_device *dev;
struct drm_crtc *tmp;
int crtc_mask = 1;
WARN(!crtc, "checking null crtc?");
dev = crtc->dev;
list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) {
if (tmp == crtc)
break;
crtc_mask <<= 1;
}
if (encoder->possible_crtcs & crtc_mask)
return true;
return false;
}
/*
* Check the CRTC we're going to map each output to vs. its current
* CRTC. If they don't match, we have to disable the output and the CRTC
* since the driver will have to re-route things.
*/
static void
drm_crtc_prepare_encoders(struct drm_device *dev)
{
struct drm_encoder_helper_funcs *encoder_funcs;
struct drm_encoder *encoder;
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
encoder_funcs = encoder->helper_private;
/* Disable unused encoders */
if (encoder->crtc == NULL)
(*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
/* Disable encoders whose CRTC is about to change */
if (encoder_funcs->get_crtc &&
encoder->crtc != (*encoder_funcs->get_crtc)(encoder))
(*encoder_funcs->dpms)(encoder, DRM_MODE_DPMS_OFF);
}
}
/** /**
* drm_crtc_set_mode - set a mode * drm_crtc_set_mode - set a mode
* @crtc: CRTC to program * @crtc: CRTC to program
@ -547,6 +600,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
encoder_funcs->prepare(encoder); encoder_funcs->prepare(encoder);
} }
drm_crtc_prepare_encoders(dev);
crtc_funcs->prepare(crtc); crtc_funcs->prepare(crtc);
/* Set up the DPLL and any encoders state that needs to adjust or depend /* Set up the DPLL and any encoders state that needs to adjust or depend
@ -617,7 +672,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
struct drm_device *dev; struct drm_device *dev;
struct drm_crtc **save_crtcs, *new_crtc; struct drm_crtc **save_crtcs, *new_crtc;
struct drm_encoder **save_encoders, *new_encoder; struct drm_encoder **save_encoders, *new_encoder;
struct drm_framebuffer *old_fb; struct drm_framebuffer *old_fb = NULL;
bool save_enabled; bool save_enabled;
bool mode_changed = false; bool mode_changed = false;
bool fb_changed = false; bool fb_changed = false;
@ -668,9 +723,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
* and then just flip_or_move it */ * and then just flip_or_move it */
if (set->crtc->fb != set->fb) { if (set->crtc->fb != set->fb) {
/* If we have no fb then treat it as a full mode set */ /* If we have no fb then treat it as a full mode set */
if (set->crtc->fb == NULL) if (set->crtc->fb == NULL) {
DRM_DEBUG("crtc has no fb, full mode set\n");
mode_changed = true; mode_changed = true;
else if ((set->fb->bits_per_pixel != } else if ((set->fb->bits_per_pixel !=
set->crtc->fb->bits_per_pixel) || set->crtc->fb->bits_per_pixel) ||
set->fb->depth != set->crtc->fb->depth) set->fb->depth != set->crtc->fb->depth)
fb_changed = true; fb_changed = true;
@ -682,7 +738,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fb_changed = true; fb_changed = true;
if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) { if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
DRM_DEBUG("modes are different\n"); DRM_DEBUG("modes are different, full mode set\n");
drm_mode_debug_printmodeline(&set->crtc->mode); drm_mode_debug_printmodeline(&set->crtc->mode);
drm_mode_debug_printmodeline(set->mode); drm_mode_debug_printmodeline(set->mode);
mode_changed = true; mode_changed = true;
@ -708,6 +764,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
} }
if (new_encoder != connector->encoder) { if (new_encoder != connector->encoder) {
DRM_DEBUG("encoder changed, full mode switch\n");
mode_changed = true; mode_changed = true;
connector->encoder = new_encoder; connector->encoder = new_encoder;
} }
@ -734,10 +791,20 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
if (set->connectors[ro] == connector) if (set->connectors[ro] == connector)
new_crtc = set->crtc; new_crtc = set->crtc;
} }
/* Make sure the new CRTC will work with the encoder */
if (new_crtc &&
!drm_encoder_crtc_ok(connector->encoder, new_crtc)) {
ret = -EINVAL;
goto fail_set_mode;
}
if (new_crtc != connector->encoder->crtc) { if (new_crtc != connector->encoder->crtc) {
DRM_DEBUG("crtc changed, full mode switch\n");
mode_changed = true; mode_changed = true;
connector->encoder->crtc = new_crtc; connector->encoder->crtc = new_crtc;
} }
DRM_DEBUG("setting connector %d crtc to %p\n",
connector->base.id, new_crtc);
} }
/* mode_set_base is not a required function */ /* mode_set_base is not a required function */
@ -781,6 +848,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fail_set_mode: fail_set_mode:
set->crtc->enabled = save_enabled; set->crtc->enabled = save_enabled;
set->crtc->fb = old_fb;
count = 0; count = 0;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
if (!connector->encoder) if (!connector->encoder)

View file

@ -125,7 +125,7 @@ static bool edid_is_valid(struct edid *edid)
DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version); DRM_ERROR("EDID has major version %d, instead of 1\n", edid->version);
goto bad; goto bad;
} }
if (edid->revision <= 0 || edid->revision > 3) { if (edid->revision > 3) {
DRM_ERROR("EDID has minor version %d, which is not between 0-3\n", edid->revision); DRM_ERROR("EDID has minor version %d, which is not between 0-3\n", edid->revision);
goto bad; goto bad;
} }
@ -320,10 +320,10 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
mode->htotal = mode->hdisplay + ((pt->hblank_hi << 8) | pt->hblank_lo); mode->htotal = mode->hdisplay + ((pt->hblank_hi << 8) | pt->hblank_lo);
mode->vdisplay = (pt->vactive_hi << 8) | pt->vactive_lo; mode->vdisplay = (pt->vactive_hi << 8) | pt->vactive_lo;
mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 8) | mode->vsync_start = mode->vdisplay + ((pt->vsync_offset_hi << 4) |
pt->vsync_offset_lo); pt->vsync_offset_lo);
mode->vsync_end = mode->vsync_start + mode->vsync_end = mode->vsync_start +
((pt->vsync_pulse_width_hi << 8) | ((pt->vsync_pulse_width_hi << 4) |
pt->vsync_pulse_width_lo); pt->vsync_pulse_width_lo);
mode->vtotal = mode->vdisplay + ((pt->vblank_hi << 8) | pt->vblank_lo); mode->vtotal = mode->vdisplay + ((pt->vblank_hi << 8) | pt->vblank_lo);

View file

@ -435,6 +435,8 @@ EXPORT_SYMBOL(drm_vblank_get);
*/ */
void drm_vblank_put(struct drm_device *dev, int crtc) void drm_vblank_put(struct drm_device *dev, int crtc)
{ {
BUG_ON (atomic_read (&dev->vblank_refcount[crtc]) == 0);
/* Last user schedules interrupt disable */ /* Last user schedules interrupt disable */
if (atomic_dec_and_test(&dev->vblank_refcount[crtc])) if (atomic_dec_and_test(&dev->vblank_refcount[crtc]))
mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ); mod_timer(&dev->vblank_disable_timer, jiffies + 5*DRM_HZ);
@ -460,8 +462,9 @@ void drm_vblank_pre_modeset(struct drm_device *dev, int crtc)
* so that interrupts remain enabled in the interim. * so that interrupts remain enabled in the interim.
*/ */
if (!dev->vblank_inmodeset[crtc]) { if (!dev->vblank_inmodeset[crtc]) {
dev->vblank_inmodeset[crtc] = 1; dev->vblank_inmodeset[crtc] = 0x1;
drm_vblank_get(dev, crtc); if (drm_vblank_get(dev, crtc) == 0)
dev->vblank_inmodeset[crtc] |= 0x2;
} }
} }
EXPORT_SYMBOL(drm_vblank_pre_modeset); EXPORT_SYMBOL(drm_vblank_pre_modeset);
@ -473,9 +476,12 @@ void drm_vblank_post_modeset(struct drm_device *dev, int crtc)
if (dev->vblank_inmodeset[crtc]) { if (dev->vblank_inmodeset[crtc]) {
spin_lock_irqsave(&dev->vbl_lock, irqflags); spin_lock_irqsave(&dev->vbl_lock, irqflags);
dev->vblank_disable_allowed = 1; dev->vblank_disable_allowed = 1;
dev->vblank_inmodeset[crtc] = 0;
spin_unlock_irqrestore(&dev->vbl_lock, irqflags); spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
drm_vblank_put(dev, crtc);
if (dev->vblank_inmodeset[crtc] & 0x2)
drm_vblank_put(dev, crtc);
dev->vblank_inmodeset[crtc] = 0;
} }
} }
EXPORT_SYMBOL(drm_vblank_post_modeset); EXPORT_SYMBOL(drm_vblank_post_modeset);

View file

@ -811,7 +811,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data,
dev_priv->hws_map.flags = 0; dev_priv->hws_map.flags = 0;
dev_priv->hws_map.mtrr = 0; dev_priv->hws_map.mtrr = 0;
drm_core_ioremap(&dev_priv->hws_map, dev); drm_core_ioremap_wc(&dev_priv->hws_map, dev);
if (dev_priv->hws_map.handle == NULL) { if (dev_priv->hws_map.handle == NULL) {
i915_dma_cleanup(dev); i915_dma_cleanup(dev);
dev_priv->status_gfx_addr = 0; dev_priv->status_gfx_addr = 0;

View file

@ -3548,7 +3548,7 @@ i915_gem_phys_pwrite(struct drm_device *dev, struct drm_gem_object *obj,
user_data = (char __user *) (uintptr_t) args->data_ptr; user_data = (char __user *) (uintptr_t) args->data_ptr;
obj_addr = obj_priv->phys_obj->handle->vaddr + args->offset; obj_addr = obj_priv->phys_obj->handle->vaddr + args->offset;
DRM_ERROR("obj_addr %p, %lld\n", obj_addr, args->size); DRM_DEBUG("obj_addr %p, %lld\n", obj_addr, args->size);
ret = copy_from_user(obj_addr, user_data, args->size); ret = copy_from_user(obj_addr, user_data, args->size);
if (ret) if (ret)
return -EFAULT; return -EFAULT;

View file

@ -111,6 +111,12 @@ parse_panel_data(struct drm_i915_private *dev_priv, struct bdb_header *bdb)
panel_fixed_mode->clock = dvo_timing->clock * 10; panel_fixed_mode->clock = dvo_timing->clock * 10;
panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED; panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
/* Some VBTs have bogus h/vtotal values */
if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
drm_mode_set_name(panel_fixed_mode); drm_mode_set_name(panel_fixed_mode);
dev_priv->vbt_mode = panel_fixed_mode; dev_priv->vbt_mode = panel_fixed_mode;

View file

@ -217,7 +217,7 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
return false; return false;
} }
#define INTELPllInvalid(s) do { DRM_DEBUG(s); return false; } while (0) #define INTELPllInvalid(s) do { /* DRM_DEBUG(s); */ return false; } while (0)
/** /**
* Returns whether the given set of divisors are valid for a given refclk with * Returns whether the given set of divisors are valid for a given refclk with
* the given connectors. * the given connectors.

View file

@ -46,7 +46,7 @@ menuconfig IDE
SMART parameters from disk drives. SMART parameters from disk drives.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here: the
module will be called ide. module will be called ide-core.ko.
For further information, please read <file:Documentation/ide/ide.txt>. For further information, please read <file:Documentation/ide/ide.txt>.

View file

@ -166,7 +166,7 @@ static unsigned int init_chipset_amd74xx(struct pci_dev *dev)
* Check for broken FIFO support. * Check for broken FIFO support.
*/ */
if (dev->vendor == PCI_VENDOR_ID_AMD && if (dev->vendor == PCI_VENDOR_ID_AMD &&
dev->vendor == PCI_DEVICE_ID_AMD_VIPER_7411) dev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
t &= 0x0f; t &= 0x0f;
else else
t |= 0xf0; t |= 0xf0;

View file

@ -52,7 +52,7 @@ static void atiixp_set_pio_mode(ide_drive_t *drive, const u8 pio)
{ {
struct pci_dev *dev = to_pci_dev(drive->hwif->dev); struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
unsigned long flags; unsigned long flags;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8; int timing_shift = (drive->dn ^ 1) * 8;
u32 pio_timing_data; u32 pio_timing_data;
u16 pio_mode_data; u16 pio_mode_data;
@ -85,7 +85,7 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed)
{ {
struct pci_dev *dev = to_pci_dev(drive->hwif->dev); struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
unsigned long flags; unsigned long flags;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8; int timing_shift = (drive->dn ^ 1) * 8;
u32 tmp32; u32 tmp32;
u16 tmp16; u16 tmp16;
u16 udma_ctl = 0; u16 udma_ctl = 0;

View file

@ -55,7 +55,7 @@
static DEFINE_MUTEX(idecd_ref_mutex); static DEFINE_MUTEX(idecd_ref_mutex);
static void ide_cd_release(struct kref *); static void ide_cd_release(struct device *);
static struct cdrom_info *ide_cd_get(struct gendisk *disk) static struct cdrom_info *ide_cd_get(struct gendisk *disk)
{ {
@ -67,7 +67,7 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk)
if (ide_device_get(cd->drive)) if (ide_device_get(cd->drive))
cd = NULL; cd = NULL;
else else
kref_get(&cd->kref); get_device(&cd->dev);
} }
mutex_unlock(&idecd_ref_mutex); mutex_unlock(&idecd_ref_mutex);
@ -79,7 +79,7 @@ static void ide_cd_put(struct cdrom_info *cd)
ide_drive_t *drive = cd->drive; ide_drive_t *drive = cd->drive;
mutex_lock(&idecd_ref_mutex); mutex_lock(&idecd_ref_mutex);
kref_put(&cd->kref, ide_cd_release); put_device(&cd->dev);
ide_device_put(drive); ide_device_put(drive);
mutex_unlock(&idecd_ref_mutex); mutex_unlock(&idecd_ref_mutex);
} }
@ -194,6 +194,14 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive,
bio_sectors = max(bio_sectors(failed_command->bio), 4U); bio_sectors = max(bio_sectors(failed_command->bio), 4U);
sector &= ~(bio_sectors - 1); sector &= ~(bio_sectors - 1);
/*
* The SCSI specification allows for the value
* returned by READ CAPACITY to be up to 75 2K
* sectors past the last readable block.
* Therefore, if we hit a medium error within the
* last 75 2K sectors, we decrease the saved size
* value.
*/
if (sector < get_capacity(info->disk) && if (sector < get_capacity(info->disk) &&
drive->probed_capacity - sector < 4 * 75) drive->probed_capacity - sector < 4 * 75)
set_capacity(info->disk, sector); set_capacity(info->disk, sector);
@ -1790,15 +1798,17 @@ static void ide_cd_remove(ide_drive_t *drive)
ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__);
ide_proc_unregister_driver(drive, info->driver); ide_proc_unregister_driver(drive, info->driver);
device_del(&info->dev);
del_gendisk(info->disk); del_gendisk(info->disk);
ide_cd_put(info); mutex_lock(&idecd_ref_mutex);
put_device(&info->dev);
mutex_unlock(&idecd_ref_mutex);
} }
static void ide_cd_release(struct kref *kref) static void ide_cd_release(struct device *dev)
{ {
struct cdrom_info *info = to_ide_drv(kref, cdrom_info); struct cdrom_info *info = to_ide_drv(dev, cdrom_info);
struct cdrom_device_info *devinfo = &info->devinfo; struct cdrom_device_info *devinfo = &info->devinfo;
ide_drive_t *drive = info->drive; ide_drive_t *drive = info->drive;
struct gendisk *g = info->disk; struct gendisk *g = info->disk;
@ -1997,7 +2007,12 @@ static int ide_cd_probe(ide_drive_t *drive)
ide_init_disk(g, drive); ide_init_disk(g, drive);
kref_init(&info->kref); info->dev.parent = &drive->gendev;
info->dev.release = ide_cd_release;
dev_set_name(&info->dev, dev_name(&drive->gendev));
if (device_register(&info->dev))
goto out_free_disk;
info->drive = drive; info->drive = drive;
info->driver = &ide_cdrom_driver; info->driver = &ide_cdrom_driver;
@ -2011,7 +2026,7 @@ static int ide_cd_probe(ide_drive_t *drive)
g->driverfs_dev = &drive->gendev; g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
if (ide_cdrom_setup(drive)) { if (ide_cdrom_setup(drive)) {
ide_cd_release(&info->kref); put_device(&info->dev);
goto failed; goto failed;
} }
@ -2021,6 +2036,8 @@ static int ide_cd_probe(ide_drive_t *drive)
add_disk(g); add_disk(g);
return 0; return 0;
out_free_disk:
put_disk(g);
out_free_cd: out_free_cd:
kfree(info); kfree(info);
failed: failed:

View file

@ -80,7 +80,7 @@ struct cdrom_info {
ide_drive_t *drive; ide_drive_t *drive;
struct ide_driver *driver; struct ide_driver *driver;
struct gendisk *disk; struct gendisk *disk;
struct kref kref; struct device dev;
/* Buffer for table of contents. NULL if we haven't allocated /* Buffer for table of contents. NULL if we haven't allocated
a TOC buffer for this device yet. */ a TOC buffer for this device yet. */

View file

@ -25,7 +25,7 @@ module_param(debug_mask, ulong, 0644);
static DEFINE_MUTEX(ide_disk_ref_mutex); static DEFINE_MUTEX(ide_disk_ref_mutex);
static void ide_disk_release(struct kref *); static void ide_disk_release(struct device *);
static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
{ {
@ -37,7 +37,7 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
if (ide_device_get(idkp->drive)) if (ide_device_get(idkp->drive))
idkp = NULL; idkp = NULL;
else else
kref_get(&idkp->kref); get_device(&idkp->dev);
} }
mutex_unlock(&ide_disk_ref_mutex); mutex_unlock(&ide_disk_ref_mutex);
return idkp; return idkp;
@ -48,7 +48,7 @@ static void ide_disk_put(struct ide_disk_obj *idkp)
ide_drive_t *drive = idkp->drive; ide_drive_t *drive = idkp->drive;
mutex_lock(&ide_disk_ref_mutex); mutex_lock(&ide_disk_ref_mutex);
kref_put(&idkp->kref, ide_disk_release); put_device(&idkp->dev);
ide_device_put(drive); ide_device_put(drive);
mutex_unlock(&ide_disk_ref_mutex); mutex_unlock(&ide_disk_ref_mutex);
} }
@ -66,17 +66,18 @@ static void ide_gd_remove(ide_drive_t *drive)
struct gendisk *g = idkp->disk; struct gendisk *g = idkp->disk;
ide_proc_unregister_driver(drive, idkp->driver); ide_proc_unregister_driver(drive, idkp->driver);
device_del(&idkp->dev);
del_gendisk(g); del_gendisk(g);
drive->disk_ops->flush(drive); drive->disk_ops->flush(drive);
ide_disk_put(idkp); mutex_lock(&ide_disk_ref_mutex);
put_device(&idkp->dev);
mutex_unlock(&ide_disk_ref_mutex);
} }
static void ide_disk_release(struct kref *kref) static void ide_disk_release(struct device *dev)
{ {
struct ide_disk_obj *idkp = to_ide_drv(kref, ide_disk_obj); struct ide_disk_obj *idkp = to_ide_drv(dev, ide_disk_obj);
ide_drive_t *drive = idkp->drive; ide_drive_t *drive = idkp->drive;
struct gendisk *g = idkp->disk; struct gendisk *g = idkp->disk;
@ -348,7 +349,12 @@ static int ide_gd_probe(ide_drive_t *drive)
ide_init_disk(g, drive); ide_init_disk(g, drive);
kref_init(&idkp->kref); idkp->dev.parent = &drive->gendev;
idkp->dev.release = ide_disk_release;
dev_set_name(&idkp->dev, dev_name(&drive->gendev));
if (device_register(&idkp->dev))
goto out_free_disk;
idkp->drive = drive; idkp->drive = drive;
idkp->driver = &ide_gd_driver; idkp->driver = &ide_gd_driver;
@ -373,6 +379,8 @@ static int ide_gd_probe(ide_drive_t *drive)
add_disk(g); add_disk(g);
return 0; return 0;
out_free_disk:
put_disk(g);
out_free_idkp: out_free_idkp:
kfree(idkp); kfree(idkp);
failed: failed:

View file

@ -17,7 +17,7 @@ struct ide_disk_obj {
ide_drive_t *drive; ide_drive_t *drive;
struct ide_driver *driver; struct ide_driver *driver;
struct gendisk *disk; struct gendisk *disk;
struct kref kref; struct device dev;
unsigned int openers; /* protected by BKL for now */ unsigned int openers; /* protected by BKL for now */
/* Last failed packet command */ /* Last failed packet command */

View file

@ -169,7 +169,7 @@ typedef struct ide_tape_obj {
ide_drive_t *drive; ide_drive_t *drive;
struct ide_driver *driver; struct ide_driver *driver;
struct gendisk *disk; struct gendisk *disk;
struct kref kref; struct device dev;
/* /*
* failed_pc points to the last failed packet command, or contains * failed_pc points to the last failed packet command, or contains
@ -267,7 +267,7 @@ static DEFINE_MUTEX(idetape_ref_mutex);
static struct class *idetape_sysfs_class; static struct class *idetape_sysfs_class;
static void ide_tape_release(struct kref *); static void ide_tape_release(struct device *);
static struct ide_tape_obj *ide_tape_get(struct gendisk *disk) static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
{ {
@ -279,7 +279,7 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
if (ide_device_get(tape->drive)) if (ide_device_get(tape->drive))
tape = NULL; tape = NULL;
else else
kref_get(&tape->kref); get_device(&tape->dev);
} }
mutex_unlock(&idetape_ref_mutex); mutex_unlock(&idetape_ref_mutex);
return tape; return tape;
@ -290,7 +290,7 @@ static void ide_tape_put(struct ide_tape_obj *tape)
ide_drive_t *drive = tape->drive; ide_drive_t *drive = tape->drive;
mutex_lock(&idetape_ref_mutex); mutex_lock(&idetape_ref_mutex);
kref_put(&tape->kref, ide_tape_release); put_device(&tape->dev);
ide_device_put(drive); ide_device_put(drive);
mutex_unlock(&idetape_ref_mutex); mutex_unlock(&idetape_ref_mutex);
} }
@ -308,7 +308,7 @@ static struct ide_tape_obj *ide_tape_chrdev_get(unsigned int i)
mutex_lock(&idetape_ref_mutex); mutex_lock(&idetape_ref_mutex);
tape = idetape_devs[i]; tape = idetape_devs[i];
if (tape) if (tape)
kref_get(&tape->kref); get_device(&tape->dev);
mutex_unlock(&idetape_ref_mutex); mutex_unlock(&idetape_ref_mutex);
return tape; return tape;
} }
@ -2256,15 +2256,17 @@ static void ide_tape_remove(ide_drive_t *drive)
idetape_tape_t *tape = drive->driver_data; idetape_tape_t *tape = drive->driver_data;
ide_proc_unregister_driver(drive, tape->driver); ide_proc_unregister_driver(drive, tape->driver);
device_del(&tape->dev);
ide_unregister_region(tape->disk); ide_unregister_region(tape->disk);
ide_tape_put(tape); mutex_lock(&idetape_ref_mutex);
put_device(&tape->dev);
mutex_unlock(&idetape_ref_mutex);
} }
static void ide_tape_release(struct kref *kref) static void ide_tape_release(struct device *dev)
{ {
struct ide_tape_obj *tape = to_ide_drv(kref, ide_tape_obj); struct ide_tape_obj *tape = to_ide_drv(dev, ide_tape_obj);
ide_drive_t *drive = tape->drive; ide_drive_t *drive = tape->drive;
struct gendisk *g = tape->disk; struct gendisk *g = tape->disk;
@ -2407,7 +2409,12 @@ static int ide_tape_probe(ide_drive_t *drive)
ide_init_disk(g, drive); ide_init_disk(g, drive);
kref_init(&tape->kref); tape->dev.parent = &drive->gendev;
tape->dev.release = ide_tape_release;
dev_set_name(&tape->dev, dev_name(&drive->gendev));
if (device_register(&tape->dev))
goto out_free_disk;
tape->drive = drive; tape->drive = drive;
tape->driver = &idetape_driver; tape->driver = &idetape_driver;
@ -2436,6 +2443,8 @@ static int ide_tape_probe(ide_drive_t *drive)
return 0; return 0;
out_free_disk:
put_disk(g);
out_free_tape: out_free_tape:
kfree(tape); kfree(tape);
failed: failed:

View file

@ -337,6 +337,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
int a, b, i, j = 1; int a, b, i, j = 1;
unsigned int *dev_param_mask = (unsigned int *)kp->arg; unsigned int *dev_param_mask = (unsigned int *)kp->arg;
/* controller . device (0 or 1) [ : 1 (set) | 0 (clear) ] */
if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 && if (sscanf(s, "%d.%d:%d", &a, &b, &j) != 3 &&
sscanf(s, "%d.%d", &a, &b) != 2) sscanf(s, "%d.%d", &a, &b) != 2)
return -EINVAL; return -EINVAL;
@ -349,7 +350,7 @@ static int ide_set_dev_param_mask(const char *s, struct kernel_param *kp)
if (j) if (j)
*dev_param_mask |= (1 << i); *dev_param_mask |= (1 << i);
else else
*dev_param_mask &= (1 << i); *dev_param_mask &= ~(1 << i);
return 0; return 0;
} }
@ -392,6 +393,8 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
{ {
int a, b, c = 0, h = 0, s = 0, i, j = 1; int a, b, c = 0, h = 0, s = 0, i, j = 1;
/* controller . device (0 or 1) : Cylinders , Heads , Sectors */
/* controller . device (0 or 1) : 1 (use CHS) | 0 (ignore CHS) */
if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 && if (sscanf(str, "%d.%d:%d,%d,%d", &a, &b, &c, &h, &s) != 5 &&
sscanf(str, "%d.%d:%d", &a, &b, &j) != 3) sscanf(str, "%d.%d:%d", &a, &b, &j) != 3)
return -EINVAL; return -EINVAL;
@ -407,7 +410,7 @@ static int ide_set_disk_chs(const char *str, struct kernel_param *kp)
if (j) if (j)
ide_disks |= (1 << i); ide_disks |= (1 << i);
else else
ide_disks &= (1 << i); ide_disks &= ~(1 << i);
ide_disks_chs[i].cyl = c; ide_disks_chs[i].cyl = c;
ide_disks_chs[i].head = h; ide_disks_chs[i].head = h;
@ -469,6 +472,8 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
{ {
int i, j = 1; int i, j = 1;
/* controller (ignore) */
/* controller : 1 (ignore) | 0 (use) */
if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1) if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1)
return -EINVAL; return -EINVAL;
@ -478,7 +483,7 @@ static int ide_set_ignore_cable(const char *s, struct kernel_param *kp)
if (j) if (j)
ide_ignore_cable |= (1 << i); ide_ignore_cable |= (1 << i);
else else
ide_ignore_cable &= (1 << i); ide_ignore_cable &= ~(1 << i);
return 0; return 0;
} }

View file

@ -5,9 +5,8 @@
* May be copied or modified under the terms of the GNU General Public License * May be copied or modified under the terms of the GNU General Public License
* Based in part on the ITE vendor provided SCSI driver. * Based in part on the ITE vendor provided SCSI driver.
* *
* Documentation available from * Documentation:
* http://www.ite.com.tw/pc/IT8212F_V04.pdf * Datasheet is freely available, some other documents under NDA.
* Some other documents are NDA.
* *
* The ITE8212 isn't exactly a standard IDE controller. It has two * The ITE8212 isn't exactly a standard IDE controller. It has two
* modes. In pass through mode then it is an IDE controller. In its smart * modes. In pass through mode then it is an IDE controller. In its smart

View file

@ -1275,7 +1275,7 @@ static void __exit ieee1394_cleanup(void)
unregister_chrdev_region(IEEE1394_CORE_DEV, 256); unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
} }
module_init(ieee1394_init); fs_initcall(ieee1394_init);
module_exit(ieee1394_cleanup); module_exit(ieee1394_cleanup);
/* Exported symbols */ /* Exported symbols */

View file

@ -1237,8 +1237,9 @@ static void end_sync_write(struct bio *bio, int error)
update_head_pos(mirror, r1_bio); update_head_pos(mirror, r1_bio);
if (atomic_dec_and_test(&r1_bio->remaining)) { if (atomic_dec_and_test(&r1_bio->remaining)) {
md_done_sync(mddev, r1_bio->sectors, uptodate); sector_t s = r1_bio->sectors;
put_buf(r1_bio); put_buf(r1_bio);
md_done_sync(mddev, s, uptodate);
} }
} }

View file

@ -1236,6 +1236,7 @@ static void end_sync_read(struct bio *bio, int error)
/* for reconstruct, we always reschedule after a read. /* for reconstruct, we always reschedule after a read.
* for resync, only after all reads * for resync, only after all reads
*/ */
rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev);
if (test_bit(R10BIO_IsRecover, &r10_bio->state) || if (test_bit(R10BIO_IsRecover, &r10_bio->state) ||
atomic_dec_and_test(&r10_bio->remaining)) { atomic_dec_and_test(&r10_bio->remaining)) {
/* we have read all the blocks, /* we have read all the blocks,
@ -1243,7 +1244,6 @@ static void end_sync_read(struct bio *bio, int error)
*/ */
reschedule_retry(r10_bio); reschedule_retry(r10_bio);
} }
rdev_dec_pending(conf->mirrors[d].rdev, conf->mddev);
} }
static void end_sync_write(struct bio *bio, int error) static void end_sync_write(struct bio *bio, int error)
@ -1264,11 +1264,13 @@ static void end_sync_write(struct bio *bio, int error)
update_head_pos(i, r10_bio); update_head_pos(i, r10_bio);
rdev_dec_pending(conf->mirrors[d].rdev, mddev);
while (atomic_dec_and_test(&r10_bio->remaining)) { while (atomic_dec_and_test(&r10_bio->remaining)) {
if (r10_bio->master_bio == NULL) { if (r10_bio->master_bio == NULL) {
/* the primary of several recovery bios */ /* the primary of several recovery bios */
md_done_sync(mddev, r10_bio->sectors, 1); sector_t s = r10_bio->sectors;
put_buf(r10_bio); put_buf(r10_bio);
md_done_sync(mddev, s, 1);
break; break;
} else { } else {
r10bio_t *r10_bio2 = (r10bio_t *)r10_bio->master_bio; r10bio_t *r10_bio2 = (r10bio_t *)r10_bio->master_bio;
@ -1276,7 +1278,6 @@ static void end_sync_write(struct bio *bio, int error)
r10_bio = r10_bio2; r10_bio = r10_bio2;
} }
} }
rdev_dec_pending(conf->mirrors[d].rdev, mddev);
} }
/* /*
@ -1749,8 +1750,6 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
if (!go_faster && conf->nr_waiting) if (!go_faster && conf->nr_waiting)
msleep_interruptible(1000); msleep_interruptible(1000);
bitmap_cond_end_sync(mddev->bitmap, sector_nr);
/* Again, very different code for resync and recovery. /* Again, very different code for resync and recovery.
* Both must result in an r10bio with a list of bios that * Both must result in an r10bio with a list of bios that
* have bi_end_io, bi_sector, bi_bdev set, * have bi_end_io, bi_sector, bi_bdev set,
@ -1886,6 +1885,8 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
/* resync. Schedule a read for every block at this virt offset */ /* resync. Schedule a read for every block at this virt offset */
int count = 0; int count = 0;
bitmap_cond_end_sync(mddev->bitmap, sector_nr);
if (!bitmap_start_sync(mddev->bitmap, sector_nr, if (!bitmap_start_sync(mddev->bitmap, sector_nr,
&sync_blocks, mddev->degraded) && &sync_blocks, mddev->degraded) &&
!conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { !conf->fullsync && !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) {
@ -2010,13 +2011,13 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
/* There is nowhere to write, so all non-sync /* There is nowhere to write, so all non-sync
* drives must be failed, so try the next chunk... * drives must be failed, so try the next chunk...
*/ */
{ if (sector_nr + max_sync < max_sector)
sector_t sec = max_sector - sector_nr; max_sector = sector_nr + max_sync;
sectors_skipped += sec;
sectors_skipped += (max_sector - sector_nr);
chunks_skipped ++; chunks_skipped ++;
sector_nr = max_sector; sector_nr = max_sector;
goto skipped; goto skipped;
}
} }
static int run(mddev_t *mddev) static int run(mddev_t *mddev)

View file

@ -192,6 +192,7 @@ int flexcop_pid_feed_control(struct flexcop_device *fc, struct dvb_demux_feed *d
return 0; return 0;
} }
EXPORT_SYMBOL(flexcop_pid_feed_control);
void flexcop_hw_filter_init(struct flexcop_device *fc) void flexcop_hw_filter_init(struct flexcop_device *fc)
{ {

View file

@ -13,9 +13,9 @@ static int enable_pid_filtering = 1;
module_param(enable_pid_filtering, int, 0444); module_param(enable_pid_filtering, int, 0444);
MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1"); MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1");
static int irq_chk_intv; static int irq_chk_intv = 100;
module_param(irq_chk_intv, int, 0644); module_param(irq_chk_intv, int, 0644);
MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently just debugging)."); MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog.");
#ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG
#define dprintk(level,args...) \ #define dprintk(level,args...) \
@ -34,7 +34,9 @@ MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently jus
static int debug; static int debug;
module_param(debug, int, 0644); module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "set debug level (1=info,2=regs,4=TS,8=irqdma (|-able))." DEBSTATUS); MODULE_PARM_DESC(debug,
"set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))."
DEBSTATUS);
#define DRIVER_VERSION "0.1" #define DRIVER_VERSION "0.1"
#define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver"
@ -58,6 +60,8 @@ struct flexcop_pci {
int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */
u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */
int count; int count;
int count_prev;
int stream_problem;
spinlock_t irq_lock; spinlock_t irq_lock;
@ -103,18 +107,32 @@ static void flexcop_pci_irq_check_work(struct work_struct *work)
container_of(work, struct flexcop_pci, irq_check_work.work); container_of(work, struct flexcop_pci, irq_check_work.work);
struct flexcop_device *fc = fc_pci->fc_dev; struct flexcop_device *fc = fc_pci->fc_dev;
flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); if (fc->feedcount) {
flexcop_dump_reg(fc_pci->fc_dev,dma1_000,4); if (fc_pci->count == fc_pci->count_prev) {
deb_chk("no IRQ since the last check\n");
if (fc_pci->stream_problem++ == 3) {
struct dvb_demux_feed *feed;
if (v.sram_dest_reg_714.net_ovflow_error) spin_lock_irq(&fc->demux.lock);
deb_chk("sram net_ovflow_error\n"); list_for_each_entry(feed, &fc->demux.feed_list,
if (v.sram_dest_reg_714.media_ovflow_error) list_head) {
deb_chk("sram media_ovflow_error\n"); flexcop_pid_feed_control(fc, feed, 0);
if (v.sram_dest_reg_714.cai_ovflow_error) }
deb_chk("sram cai_ovflow_error\n");
if (v.sram_dest_reg_714.cai_ovflow_error) list_for_each_entry(feed, &fc->demux.feed_list,
deb_chk("sram cai_ovflow_error\n"); list_head) {
flexcop_pid_feed_control(fc, feed, 1);
}
spin_unlock_irq(&fc->demux.lock);
fc_pci->stream_problem = 0;
}
} else {
fc_pci->stream_problem = 0;
fc_pci->count_prev = fc_pci->count;
}
}
schedule_delayed_work(&fc_pci->irq_check_work, schedule_delayed_work(&fc_pci->irq_check_work,
msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
@ -216,16 +234,12 @@ static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff)
flexcop_dma_control_timer_irq(fc,FC_DMA_1,1); flexcop_dma_control_timer_irq(fc,FC_DMA_1,1);
deb_irq("IRQ enabled\n"); deb_irq("IRQ enabled\n");
fc_pci->count_prev = fc_pci->count;
// fc_pci->active_dma1_addr = 0; // fc_pci->active_dma1_addr = 0;
// flexcop_dma_control_size_irq(fc,FC_DMA_1,1); // flexcop_dma_control_size_irq(fc,FC_DMA_1,1);
if (irq_chk_intv > 0)
schedule_delayed_work(&fc_pci->irq_check_work,
msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
} else { } else {
if (irq_chk_intv > 0)
cancel_delayed_work(&fc_pci->irq_check_work);
flexcop_dma_control_timer_irq(fc,FC_DMA_1,0); flexcop_dma_control_timer_irq(fc,FC_DMA_1,0);
deb_irq("IRQ disabled\n"); deb_irq("IRQ disabled\n");
@ -299,8 +313,6 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0)
goto err_pci_iounmap; goto err_pci_iounmap;
fc_pci->init_state |= FC_PCI_INIT; fc_pci->init_state |= FC_PCI_INIT;
return ret; return ret;
@ -375,6 +387,10 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work);
if (irq_chk_intv > 0)
schedule_delayed_work(&fc_pci->irq_check_work,
msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv));
return ret; return ret;
err_fc_exit: err_fc_exit:
@ -393,6 +409,9 @@ static void flexcop_pci_remove(struct pci_dev *pdev)
{ {
struct flexcop_pci *fc_pci = pci_get_drvdata(pdev); struct flexcop_pci *fc_pci = pci_get_drvdata(pdev);
if (irq_chk_intv > 0)
cancel_delayed_work(&fc_pci->irq_check_work);
flexcop_pci_dma_exit(fc_pci); flexcop_pci_dma_exit(fc_pci);
flexcop_device_exit(fc_pci->fc_dev); flexcop_device_exit(fc_pci->fc_dev);
flexcop_pci_exit(fc_pci); flexcop_pci_exit(fc_pci);

View file

@ -212,8 +212,7 @@ void flexcop_reset_block_300(struct flexcop_device *fc)
v210.sw_reset_210.Block_reset_enable = 0xb2; v210.sw_reset_210.Block_reset_enable = 0xb2;
fc->write_ibi_reg(fc,sw_reset_210,v210); fc->write_ibi_reg(fc,sw_reset_210,v210);
msleep(1); udelay(1000);
fc->write_ibi_reg(fc,ctrl_208,v208_save); fc->write_ibi_reg(fc,ctrl_208,v208_save);
} }

View file

@ -463,6 +463,8 @@ static int em28xx_audio_init(struct em28xx *dev)
pcm->info_flags = 0; pcm->info_flags = 0;
pcm->private_data = dev; pcm->private_data = dev;
strcpy(pcm->name, "Empia 28xx Capture"); strcpy(pcm->name, "Empia 28xx Capture");
snd_card_set_dev(card, &dev->udev->dev);
strcpy(card->driver, "Empia Em28xx Audio"); strcpy(card->driver, "Empia Em28xx Audio");
strcpy(card->shortname, "Em28xx Audio"); strcpy(card->shortname, "Em28xx Audio");
strcpy(card->longname, "Empia Em28xx Audio"); strcpy(card->longname, "Empia Em28xx Audio");

View file

@ -1155,24 +1155,24 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
{ {
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct pxa_camera_dev *pcdev = ici->priv; struct pxa_camera_dev *pcdev = ici->priv;
const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL; const struct soc_camera_data_format *cam_fmt = NULL;
const struct soc_camera_format_xlate *xlate; const struct soc_camera_format_xlate *xlate = NULL;
struct soc_camera_sense sense = { struct soc_camera_sense sense = {
.master_clock = pcdev->mclk, .master_clock = pcdev->mclk,
.pixel_clock_max = pcdev->ciclk / 4, .pixel_clock_max = pcdev->ciclk / 4,
}; };
int ret, buswidth; int ret;
xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); if (pixfmt) {
if (!xlate) { xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
dev_warn(&ici->dev, "Format %x not found\n", pixfmt); if (!xlate) {
return -EINVAL; dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
return -EINVAL;
}
cam_fmt = xlate->cam_fmt;
} }
buswidth = xlate->buswidth;
host_fmt = xlate->host_fmt;
cam_fmt = xlate->cam_fmt;
/* If PCLK is used to latch data from the sensor, check sense */ /* If PCLK is used to latch data from the sensor, check sense */
if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN)
icd->sense = &sense; icd->sense = &sense;
@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd,
} }
if (pixfmt && !ret) { if (pixfmt && !ret) {
icd->buswidth = buswidth; icd->buswidth = xlate->buswidth;
icd->current_fmt = host_fmt; icd->current_fmt = xlate->host_fmt;
} }
return ret; return ret;

View file

@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd,
const struct soc_camera_format_xlate *xlate; const struct soc_camera_format_xlate *xlate;
int ret; int ret;
if (!pixfmt)
return icd->ops->set_fmt(icd, pixfmt, rect);
xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
if (!xlate) { if (!xlate) {
dev_warn(&ici->dev, "Format %x not found\n", pixfmt); dev_warn(&ici->dev, "Format %x not found\n", pixfmt);
return -EINVAL; return -EINVAL;
} }
switch (pixfmt) { ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
case 0: /* Only geometry change */
ret = icd->ops->set_fmt(icd, pixfmt, rect);
break;
default:
ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect);
}
if (pixfmt && !ret) { if (!ret) {
icd->buswidth = xlate->buswidth; icd->buswidth = xlate->buswidth;
icd->current_fmt = xlate->host_fmt; icd->current_fmt = xlate->host_fmt;
pcdev->camera_fmt = xlate->cam_fmt; pcdev->camera_fmt = xlate->cam_fmt;

View file

@ -710,6 +710,7 @@ out:
static struct pci_device_id ilo_devices[] = { static struct pci_device_id ilo_devices[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) }, { PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) },
{ PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) },
{ } { }
}; };
MODULE_DEVICE_TABLE(pci, ilo_devices); MODULE_DEVICE_TABLE(pci, ilo_devices);
@ -758,7 +759,7 @@ static void __exit ilo_exit(void)
class_destroy(ilo_class); class_destroy(ilo_class);
} }
MODULE_VERSION("0.06"); MODULE_VERSION("1.0");
MODULE_ALIAS(ILO_NAME); MODULE_ALIAS(ILO_NAME);
MODULE_DESCRIPTION(ILO_NAME); MODULE_DESCRIPTION(ILO_NAME);
MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>"); MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>");

View file

@ -19,6 +19,7 @@ static int maprom_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *); static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static void maprom_nop (struct mtd_info *); static void maprom_nop (struct mtd_info *);
static struct mtd_info *map_rom_probe(struct map_info *map); static struct mtd_info *map_rom_probe(struct map_info *map);
static int maprom_erase (struct mtd_info *mtd, struct erase_info *info);
static struct mtd_chip_driver maprom_chipdrv = { static struct mtd_chip_driver maprom_chipdrv = {
.probe = map_rom_probe, .probe = map_rom_probe,
@ -42,6 +43,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
mtd->read = maprom_read; mtd->read = maprom_read;
mtd->write = maprom_write; mtd->write = maprom_write;
mtd->sync = maprom_nop; mtd->sync = maprom_nop;
mtd->erase = maprom_erase;
mtd->flags = MTD_CAP_ROM; mtd->flags = MTD_CAP_ROM;
mtd->erasesize = map->size; mtd->erasesize = map->size;
mtd->writesize = 1; mtd->writesize = 1;
@ -71,6 +73,12 @@ static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *re
return -EIO; return -EIO;
} }
static int maprom_erase (struct mtd_info *mtd, struct erase_info *info)
{
/* We do our best 8) */
return -EROFS;
}
static int __init map_rom_init(void) static int __init map_rom_init(void)
{ {
register_mtd_chip_driver(&maprom_chipdrv); register_mtd_chip_driver(&maprom_chipdrv);

View file

@ -267,22 +267,28 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength)
if (*(szlength) != '+') { if (*(szlength) != '+') {
devlength = simple_strtoul(szlength, &buffer, 0); devlength = simple_strtoul(szlength, &buffer, 0);
devlength = handle_unit(devlength, buffer) - devstart; devlength = handle_unit(devlength, buffer) - devstart;
if (devlength < devstart)
goto err_out;
devlength -= devstart;
} else { } else {
devlength = simple_strtoul(szlength + 1, &buffer, 0); devlength = simple_strtoul(szlength + 1, &buffer, 0);
devlength = handle_unit(devlength, buffer); devlength = handle_unit(devlength, buffer);
} }
T("slram: devname=%s, devstart=0x%lx, devlength=0x%lx\n", T("slram: devname=%s, devstart=0x%lx, devlength=0x%lx\n",
devname, devstart, devlength); devname, devstart, devlength);
if ((devstart < 0) || (devlength < 0) || (devlength % SLRAM_BLK_SZ != 0)) { if (devlength % SLRAM_BLK_SZ != 0)
E("slram: Illegal start / length parameter.\n"); goto err_out;
return(-EINVAL);
}
if ((devstart = register_device(devname, devstart, devlength))){ if ((devstart = register_device(devname, devstart, devlength))){
unregister_devices(); unregister_devices();
return((int)devstart); return((int)devstart);
} }
return(0); return(0);
err_out:
E("slram: Illegal length parameter.\n");
return(-EINVAL);
} }
#ifndef MODULE #ifndef MODULE

View file

@ -12,6 +12,7 @@ config MTD_LPDDR
DDR memories, intended for battery-operated systems. DDR memories, intended for battery-operated systems.
config MTD_QINFO_PROBE config MTD_QINFO_PROBE
depends on MTD_LPDDR
tristate "Detect flash chips by QINFO probe" tristate "Detect flash chips by QINFO probe"
help help
Device Information for LPDDR chips is offered through the Overlay Device Information for LPDDR chips is offered through the Overlay

View file

@ -491,7 +491,7 @@ config MTD_PCMCIA_ANONYMOUS
config MTD_BFIN_ASYNC config MTD_BFIN_ASYNC
tristate "Blackfin BF533-STAMP Flash Chip Support" tristate "Blackfin BF533-STAMP Flash Chip Support"
depends on BFIN533_STAMP && MTD_CFI depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS
select MTD_PARTITIONS select MTD_PARTITIONS
default y default y
help help

View file

@ -152,14 +152,18 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev)
if (gpio_request(state->enet_flash_pin, DRIVER_NAME)) { if (gpio_request(state->enet_flash_pin, DRIVER_NAME)) {
pr_devinit(KERN_ERR DRIVER_NAME ": Failed to request gpio %d\n", state->enet_flash_pin); pr_devinit(KERN_ERR DRIVER_NAME ": Failed to request gpio %d\n", state->enet_flash_pin);
kfree(state);
return -EBUSY; return -EBUSY;
} }
gpio_direction_output(state->enet_flash_pin, 1); gpio_direction_output(state->enet_flash_pin, 1);
pr_devinit(KERN_NOTICE DRIVER_NAME ": probing %d-bit flash bus\n", state->map.bankwidth * 8); pr_devinit(KERN_NOTICE DRIVER_NAME ": probing %d-bit flash bus\n", state->map.bankwidth * 8);
state->mtd = do_map_probe(memory->name, &state->map); state->mtd = do_map_probe(memory->name, &state->map);
if (!state->mtd) if (!state->mtd) {
gpio_free(state->enet_flash_pin);
kfree(state);
return -ENXIO; return -ENXIO;
}
#ifdef CONFIG_MTD_PARTITIONS #ifdef CONFIG_MTD_PARTITIONS
ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0); ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0);

View file

@ -342,9 +342,9 @@ static struct pci_device_id ck804xrom_pci_tbl[] = {
{ 0, } { 0, }
}; };
#if 0
MODULE_DEVICE_TABLE(pci, ck804xrom_pci_tbl); MODULE_DEVICE_TABLE(pci, ck804xrom_pci_tbl);
#if 0
static struct pci_driver ck804xrom_driver = { static struct pci_driver ck804xrom_driver = {
.name = MOD_NAME, .name = MOD_NAME,
.id_table = ck804xrom_pci_tbl, .id_table = ck804xrom_pci_tbl,

View file

@ -29,6 +29,7 @@ struct physmap_flash_info {
struct map_info map[MAX_RESOURCES]; struct map_info map[MAX_RESOURCES];
#ifdef CONFIG_MTD_PARTITIONS #ifdef CONFIG_MTD_PARTITIONS
int nr_parts; int nr_parts;
struct mtd_partition *parts;
#endif #endif
}; };
@ -45,25 +46,26 @@ static int physmap_flash_remove(struct platform_device *dev)
physmap_data = dev->dev.platform_data; physmap_data = dev->dev.platform_data;
#ifdef CONFIG_MTD_CONCAT #ifdef CONFIG_MTD_PARTITIONS
if (info->cmtd != info->mtd[0]) { if (info->nr_parts) {
del_mtd_partitions(info->cmtd);
kfree(info->parts);
} else if (physmap_data->nr_parts)
del_mtd_partitions(info->cmtd);
else
del_mtd_device(info->cmtd); del_mtd_device(info->cmtd);
#else
del_mtd_device(info->cmtd);
#endif
#ifdef CONFIG_MTD_CONCAT
if (info->cmtd != info->mtd[0])
mtd_concat_destroy(info->cmtd); mtd_concat_destroy(info->cmtd);
}
#endif #endif
for (i = 0; i < MAX_RESOURCES; i++) { for (i = 0; i < MAX_RESOURCES; i++) {
if (info->mtd[i] != NULL) { if (info->mtd[i] != NULL)
#ifdef CONFIG_MTD_PARTITIONS
if (info->nr_parts || physmap_data->nr_parts)
del_mtd_partitions(info->mtd[i]);
else
del_mtd_device(info->mtd[i]);
#else
del_mtd_device(info->mtd[i]);
#endif
map_destroy(info->mtd[i]); map_destroy(info->mtd[i]);
}
} }
return 0; return 0;
} }
@ -86,9 +88,6 @@ static int physmap_flash_probe(struct platform_device *dev)
int err = 0; int err = 0;
int i; int i;
int devices_found = 0; int devices_found = 0;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *parts;
#endif
physmap_data = dev->dev.platform_data; physmap_data = dev->dev.platform_data;
if (physmap_data == NULL) if (physmap_data == NULL)
@ -167,10 +166,11 @@ static int physmap_flash_probe(struct platform_device *dev)
goto err_out; goto err_out;
#ifdef CONFIG_MTD_PARTITIONS #ifdef CONFIG_MTD_PARTITIONS
err = parse_mtd_partitions(info->cmtd, part_probe_types, &parts, 0); err = parse_mtd_partitions(info->cmtd, part_probe_types,
&info->parts, 0);
if (err > 0) { if (err > 0) {
add_mtd_partitions(info->cmtd, parts, err); add_mtd_partitions(info->cmtd, info->parts, err);
kfree(parts); info->nr_parts = err;
return 0; return 0;
} }

View file

@ -148,7 +148,7 @@ static void iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
pci_unmap_single(dev, pci_unmap_single(dev,
pci_unmap_addr(&txq->cmd[index]->meta, mapping), pci_unmap_addr(&txq->cmd[index]->meta, mapping),
pci_unmap_len(&txq->cmd[index]->meta, len), pci_unmap_len(&txq->cmd[index]->meta, len),
PCI_DMA_TODEVICE); PCI_DMA_BIDIRECTIONAL);
/* Unmap chunks, if any. */ /* Unmap chunks, if any. */
for (i = 1; i < num_tbs; i++) { for (i = 1; i < num_tbs; i++) {
@ -964,7 +964,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
* within command buffer array. */ * within command buffer array. */
txcmd_phys = pci_map_single(priv->pci_dev, txcmd_phys = pci_map_single(priv->pci_dev,
out_cmd, sizeof(struct iwl_cmd), out_cmd, sizeof(struct iwl_cmd),
PCI_DMA_TODEVICE); PCI_DMA_BIDIRECTIONAL);
pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys); pci_unmap_addr_set(&out_cmd->meta, mapping, txcmd_phys);
pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd)); pci_unmap_len_set(&out_cmd->meta, len, sizeof(struct iwl_cmd));
/* Add buffer containing Tx command and MAC(!) header to TFD's /* Add buffer containing Tx command and MAC(!) header to TFD's
@ -1115,7 +1115,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd); IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd);
phys_addr = pci_map_single(priv->pci_dev, out_cmd, phys_addr = pci_map_single(priv->pci_dev, out_cmd,
len, PCI_DMA_TODEVICE); len, PCI_DMA_BIDIRECTIONAL);
pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr); pci_unmap_addr_set(&out_cmd->meta, mapping, phys_addr);
pci_unmap_len_set(&out_cmd->meta, len, len); pci_unmap_len_set(&out_cmd->meta, len, len);
phys_addr += offsetof(struct iwl_cmd, hdr); phys_addr += offsetof(struct iwl_cmd, hdr);
@ -1212,7 +1212,7 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id,
pci_unmap_single(priv->pci_dev, pci_unmap_single(priv->pci_dev,
pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping), pci_unmap_addr(&txq->cmd[cmd_idx]->meta, mapping),
pci_unmap_len(&txq->cmd[cmd_idx]->meta, len), pci_unmap_len(&txq->cmd[cmd_idx]->meta, len),
PCI_DMA_TODEVICE); PCI_DMA_BIDIRECTIONAL);
for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx; for (idx = iwl_queue_inc_wrap(idx, q->n_bd); q->read_ptr != idx;
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {

View file

@ -332,6 +332,14 @@ parse_dmar_table(void)
entry_header = (struct acpi_dmar_header *)(dmar + 1); entry_header = (struct acpi_dmar_header *)(dmar + 1);
while (((unsigned long)entry_header) < while (((unsigned long)entry_header) <
(((unsigned long)dmar) + dmar_tbl->length)) { (((unsigned long)dmar) + dmar_tbl->length)) {
/* Avoid looping forever on bad ACPI tables */
if (entry_header->length == 0) {
printk(KERN_WARNING PREFIX
"Invalid 0-length structure\n");
ret = -EINVAL;
break;
}
dmar_table_print_dmar_entry(entry_header); dmar_table_print_dmar_entry(entry_header);
switch (entry_header->type) { switch (entry_header->type) {
@ -494,7 +502,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
int map_size; int map_size;
u32 ver; u32 ver;
static int iommu_allocated = 0; static int iommu_allocated = 0;
int agaw; int agaw = 0;
iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); iommu = kzalloc(sizeof(*iommu), GFP_KERNEL);
if (!iommu) if (!iommu)
@ -510,6 +518,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG); iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG);
iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG); iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG);
#ifdef CONFIG_DMAR
agaw = iommu_calculate_agaw(iommu); agaw = iommu_calculate_agaw(iommu);
if (agaw < 0) { if (agaw < 0) {
printk(KERN_ERR printk(KERN_ERR
@ -517,6 +526,7 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
iommu->seq_id); iommu->seq_id);
goto error; goto error;
} }
#endif
iommu->agaw = agaw; iommu->agaw = agaw;
/* the registers might be more than one page */ /* the registers might be more than one page */
@ -574,19 +584,49 @@ static inline void reclaim_free_desc(struct q_inval *qi)
} }
} }
static int qi_check_fault(struct intel_iommu *iommu, int index)
{
u32 fault;
int head;
struct q_inval *qi = iommu->qi;
int wait_index = (index + 1) % QI_LENGTH;
fault = readl(iommu->reg + DMAR_FSTS_REG);
/*
* If IQE happens, the head points to the descriptor associated
* with the error. No new descriptors are fetched until the IQE
* is cleared.
*/
if (fault & DMA_FSTS_IQE) {
head = readl(iommu->reg + DMAR_IQH_REG);
if ((head >> 4) == index) {
memcpy(&qi->desc[index], &qi->desc[wait_index],
sizeof(struct qi_desc));
__iommu_flush_cache(iommu, &qi->desc[index],
sizeof(struct qi_desc));
writel(DMA_FSTS_IQE, iommu->reg + DMAR_FSTS_REG);
return -EINVAL;
}
}
return 0;
}
/* /*
* Submit the queued invalidation descriptor to the remapping * Submit the queued invalidation descriptor to the remapping
* hardware unit and wait for its completion. * hardware unit and wait for its completion.
*/ */
void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu) int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu)
{ {
int rc = 0;
struct q_inval *qi = iommu->qi; struct q_inval *qi = iommu->qi;
struct qi_desc *hw, wait_desc; struct qi_desc *hw, wait_desc;
int wait_index, index; int wait_index, index;
unsigned long flags; unsigned long flags;
if (!qi) if (!qi)
return; return 0;
hw = qi->desc; hw = qi->desc;
@ -604,7 +644,8 @@ void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu)
hw[index] = *desc; hw[index] = *desc;
wait_desc.low = QI_IWD_STATUS_DATA(2) | QI_IWD_STATUS_WRITE | QI_IWD_TYPE; wait_desc.low = QI_IWD_STATUS_DATA(QI_DONE) |
QI_IWD_STATUS_WRITE | QI_IWD_TYPE;
wait_desc.high = virt_to_phys(&qi->desc_status[wait_index]); wait_desc.high = virt_to_phys(&qi->desc_status[wait_index]);
hw[wait_index] = wait_desc; hw[wait_index] = wait_desc;
@ -615,13 +656,11 @@ void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu)
qi->free_head = (qi->free_head + 2) % QI_LENGTH; qi->free_head = (qi->free_head + 2) % QI_LENGTH;
qi->free_cnt -= 2; qi->free_cnt -= 2;
spin_lock(&iommu->register_lock);
/* /*
* update the HW tail register indicating the presence of * update the HW tail register indicating the presence of
* new descriptors. * new descriptors.
*/ */
writel(qi->free_head << 4, iommu->reg + DMAR_IQT_REG); writel(qi->free_head << 4, iommu->reg + DMAR_IQT_REG);
spin_unlock(&iommu->register_lock);
while (qi->desc_status[wait_index] != QI_DONE) { while (qi->desc_status[wait_index] != QI_DONE) {
/* /*
@ -631,15 +670,21 @@ void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu)
* a deadlock where the interrupt context can wait indefinitely * a deadlock where the interrupt context can wait indefinitely
* for free slots in the queue. * for free slots in the queue.
*/ */
rc = qi_check_fault(iommu, index);
if (rc)
goto out;
spin_unlock(&qi->q_lock); spin_unlock(&qi->q_lock);
cpu_relax(); cpu_relax();
spin_lock(&qi->q_lock); spin_lock(&qi->q_lock);
} }
out:
qi->desc_status[index] = QI_DONE; qi->desc_status[index] = qi->desc_status[wait_index] = QI_DONE;
reclaim_free_desc(qi); reclaim_free_desc(qi);
spin_unlock_irqrestore(&qi->q_lock, flags); spin_unlock_irqrestore(&qi->q_lock, flags);
return rc;
} }
/* /*
@ -652,13 +697,13 @@ void qi_global_iec(struct intel_iommu *iommu)
desc.low = QI_IEC_TYPE; desc.low = QI_IEC_TYPE;
desc.high = 0; desc.high = 0;
/* should never fail */
qi_submit_sync(&desc, iommu); qi_submit_sync(&desc, iommu);
} }
int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm, int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm,
u64 type, int non_present_entry_flush) u64 type, int non_present_entry_flush)
{ {
struct qi_desc desc; struct qi_desc desc;
if (non_present_entry_flush) { if (non_present_entry_flush) {
@ -672,10 +717,7 @@ int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm,
| QI_CC_GRAN(type) | QI_CC_TYPE; | QI_CC_GRAN(type) | QI_CC_TYPE;
desc.high = 0; desc.high = 0;
qi_submit_sync(&desc, iommu); return qi_submit_sync(&desc, iommu);
return 0;
} }
int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
@ -705,10 +747,7 @@ int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
desc.high = QI_IOTLB_ADDR(addr) | QI_IOTLB_IH(ih) desc.high = QI_IOTLB_ADDR(addr) | QI_IOTLB_IH(ih)
| QI_IOTLB_AM(size_order); | QI_IOTLB_AM(size_order);
qi_submit_sync(&desc, iommu); return qi_submit_sync(&desc, iommu);
return 0;
} }
/* /*

View file

@ -111,6 +111,7 @@ struct controller {
int cmd_busy; int cmd_busy;
unsigned int no_cmd_complete:1; unsigned int no_cmd_complete:1;
unsigned int link_active_reporting:1; unsigned int link_active_reporting:1;
unsigned int notification_enabled:1;
}; };
#define INT_BUTTON_IGNORE 0 #define INT_BUTTON_IGNORE 0
@ -170,6 +171,7 @@ extern int pciehp_configure_device(struct slot *p_slot);
extern int pciehp_unconfigure_device(struct slot *p_slot); extern int pciehp_unconfigure_device(struct slot *p_slot);
extern void pciehp_queue_pushbutton_work(struct work_struct *work); extern void pciehp_queue_pushbutton_work(struct work_struct *work);
struct controller *pcie_init(struct pcie_device *dev); struct controller *pcie_init(struct pcie_device *dev);
int pcie_init_notification(struct controller *ctrl);
int pciehp_enable_slot(struct slot *p_slot); int pciehp_enable_slot(struct slot *p_slot);
int pciehp_disable_slot(struct slot *p_slot); int pciehp_disable_slot(struct slot *p_slot);
int pcie_enable_notification(struct controller *ctrl); int pcie_enable_notification(struct controller *ctrl);

View file

@ -434,6 +434,13 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
goto err_out_release_ctlr; goto err_out_release_ctlr;
} }
/* Enable events after we have setup the data structures */
rc = pcie_init_notification(ctrl);
if (rc) {
ctrl_err(ctrl, "Notification initialization failed\n");
goto err_out_release_ctlr;
}
/* Check if slot is occupied */ /* Check if slot is occupied */
t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
t_slot->hpc_ops->get_adapter_status(t_slot, &value); t_slot->hpc_ops->get_adapter_status(t_slot, &value);

View file

@ -934,7 +934,7 @@ static void pcie_disable_notification(struct controller *ctrl)
ctrl_warn(ctrl, "Cannot disable software notification\n"); ctrl_warn(ctrl, "Cannot disable software notification\n");
} }
static int pcie_init_notification(struct controller *ctrl) int pcie_init_notification(struct controller *ctrl)
{ {
if (pciehp_request_irq(ctrl)) if (pciehp_request_irq(ctrl))
return -1; return -1;
@ -942,13 +942,17 @@ static int pcie_init_notification(struct controller *ctrl)
pciehp_free_irq(ctrl); pciehp_free_irq(ctrl);
return -1; return -1;
} }
ctrl->notification_enabled = 1;
return 0; return 0;
} }
static void pcie_shutdown_notification(struct controller *ctrl) static void pcie_shutdown_notification(struct controller *ctrl)
{ {
pcie_disable_notification(ctrl); if (ctrl->notification_enabled) {
pciehp_free_irq(ctrl); pcie_disable_notification(ctrl);
pciehp_free_irq(ctrl);
ctrl->notification_enabled = 0;
}
} }
static int pcie_init_slot(struct controller *ctrl) static int pcie_init_slot(struct controller *ctrl)
@ -1110,13 +1114,8 @@ struct controller *pcie_init(struct pcie_device *dev)
if (pcie_init_slot(ctrl)) if (pcie_init_slot(ctrl))
goto abort_ctrl; goto abort_ctrl;
if (pcie_init_notification(ctrl))
goto abort_slot;
return ctrl; return ctrl;
abort_slot:
pcie_cleanup_slot(ctrl);
abort_ctrl: abort_ctrl:
kfree(ctrl); kfree(ctrl);
abort: abort:

View file

@ -208,7 +208,7 @@ int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
return index; return index;
} }
static void qi_flush_iec(struct intel_iommu *iommu, int index, int mask) static int qi_flush_iec(struct intel_iommu *iommu, int index, int mask)
{ {
struct qi_desc desc; struct qi_desc desc;
@ -216,7 +216,7 @@ static void qi_flush_iec(struct intel_iommu *iommu, int index, int mask)
| QI_IEC_SELECTIVE; | QI_IEC_SELECTIVE;
desc.high = 0; desc.high = 0;
qi_submit_sync(&desc, iommu); return qi_submit_sync(&desc, iommu);
} }
int map_irq_to_irte_handle(int irq, u16 *sub_handle) int map_irq_to_irte_handle(int irq, u16 *sub_handle)
@ -284,6 +284,7 @@ int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index)
int modify_irte(int irq, struct irte *irte_modified) int modify_irte(int irq, struct irte *irte_modified)
{ {
int rc;
int index; int index;
struct irte *irte; struct irte *irte;
struct intel_iommu *iommu; struct intel_iommu *iommu;
@ -304,14 +305,15 @@ int modify_irte(int irq, struct irte *irte_modified)
set_64bit((unsigned long *)irte, irte_modified->low | (1 << 1)); set_64bit((unsigned long *)irte, irte_modified->low | (1 << 1));
__iommu_flush_cache(iommu, irte, sizeof(*irte)); __iommu_flush_cache(iommu, irte, sizeof(*irte));
qi_flush_iec(iommu, index, 0); rc = qi_flush_iec(iommu, index, 0);
spin_unlock(&irq_2_ir_lock); spin_unlock(&irq_2_ir_lock);
return 0;
return rc;
} }
int flush_irte(int irq) int flush_irte(int irq)
{ {
int rc;
int index; int index;
struct intel_iommu *iommu; struct intel_iommu *iommu;
struct irq_2_iommu *irq_iommu; struct irq_2_iommu *irq_iommu;
@ -327,10 +329,10 @@ int flush_irte(int irq)
index = irq_iommu->irte_index + irq_iommu->sub_handle; index = irq_iommu->irte_index + irq_iommu->sub_handle;
qi_flush_iec(iommu, index, irq_iommu->irte_mask); rc = qi_flush_iec(iommu, index, irq_iommu->irte_mask);
spin_unlock(&irq_2_ir_lock); spin_unlock(&irq_2_ir_lock);
return 0; return rc;
} }
struct intel_iommu *map_ioapic_to_ir(int apic) struct intel_iommu *map_ioapic_to_ir(int apic)
@ -356,6 +358,7 @@ struct intel_iommu *map_dev_to_ir(struct pci_dev *dev)
int free_irte(int irq) int free_irte(int irq)
{ {
int rc = 0;
int index, i; int index, i;
struct irte *irte; struct irte *irte;
struct intel_iommu *iommu; struct intel_iommu *iommu;
@ -376,7 +379,7 @@ int free_irte(int irq)
if (!irq_iommu->sub_handle) { if (!irq_iommu->sub_handle) {
for (i = 0; i < (1 << irq_iommu->irte_mask); i++) for (i = 0; i < (1 << irq_iommu->irte_mask); i++)
set_64bit((unsigned long *)irte, 0); set_64bit((unsigned long *)irte, 0);
qi_flush_iec(iommu, index, irq_iommu->irte_mask); rc = qi_flush_iec(iommu, index, irq_iommu->irte_mask);
} }
irq_iommu->iommu = NULL; irq_iommu->iommu = NULL;
@ -386,7 +389,7 @@ int free_irte(int irq)
spin_unlock(&irq_2_ir_lock); spin_unlock(&irq_2_ir_lock);
return 0; return rc;
} }
static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode) static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode)

View file

@ -108,6 +108,34 @@ int pci_cleanup_aer_correct_error_status(struct pci_dev *dev)
} }
#endif /* 0 */ #endif /* 0 */
static void set_device_error_reporting(struct pci_dev *dev, void *data)
{
bool enable = *((bool *)data);
if (dev->pcie_type != PCIE_RC_PORT &&
dev->pcie_type != PCIE_SW_UPSTREAM_PORT &&
dev->pcie_type != PCIE_SW_DOWNSTREAM_PORT)
return;
if (enable)
pci_enable_pcie_error_reporting(dev);
else
pci_disable_pcie_error_reporting(dev);
}
/**
* set_downstream_devices_error_reporting - enable/disable the error reporting bits on the root port and its downstream ports.
* @dev: pointer to root port's pci_dev data structure
* @enable: true = enable error reporting, false = disable error reporting.
*/
static void set_downstream_devices_error_reporting(struct pci_dev *dev,
bool enable)
{
set_device_error_reporting(dev, &enable);
pci_walk_bus(dev->subordinate, set_device_error_reporting, &enable);
}
static int find_device_iter(struct device *device, void *data) static int find_device_iter(struct device *device, void *data)
{ {
struct pci_dev *dev; struct pci_dev *dev;
@ -525,15 +553,11 @@ void aer_enable_rootport(struct aer_rpc *rpc)
pci_read_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, &reg32); pci_read_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, &reg32);
pci_write_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, reg32); pci_write_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, reg32);
/* Enable Root Port device reporting error itself */ /*
pci_read_config_word(pdev, pos+PCI_EXP_DEVCTL, &reg16); * Enable error reporting for the root port device and downstream port
reg16 = reg16 | * devices.
PCI_EXP_DEVCTL_CERE | */
PCI_EXP_DEVCTL_NFERE | set_downstream_devices_error_reporting(pdev, true);
PCI_EXP_DEVCTL_FERE |
PCI_EXP_DEVCTL_URRE;
pci_write_config_word(pdev, pos+PCI_EXP_DEVCTL,
reg16);
/* Enable Root Port's interrupt in response to error messages */ /* Enable Root Port's interrupt in response to error messages */
pci_write_config_dword(pdev, pci_write_config_dword(pdev,
@ -553,6 +577,12 @@ static void disable_root_aer(struct aer_rpc *rpc)
u32 reg32; u32 reg32;
int pos; int pos;
/*
* Disable error reporting for the root port device and downstream port
* devices.
*/
set_downstream_devices_error_reporting(pdev, false);
pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
/* Disable Root's interrupt in response to error messages */ /* Disable Root's interrupt in response to error messages */
pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_COMMAND, 0); pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_COMMAND, 0);

View file

@ -97,8 +97,6 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
pcie_portdrv_save_config(dev); pcie_portdrv_save_config(dev);
pci_enable_pcie_error_reporting(dev);
return 0; return 0;
} }

View file

@ -1584,6 +1584,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_
*/ */
#define AMD_813X_MISC 0x40 #define AMD_813X_MISC 0x40
#define AMD_813X_NOIOAMODE (1<<0) #define AMD_813X_NOIOAMODE (1<<0)
#define AMD_813X_REV_B2 0x13
static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev) static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev)
{ {
@ -1591,6 +1592,8 @@ static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev)
if (noioapicquirk) if (noioapicquirk)
return; return;
if (dev->revision == AMD_813X_REV_B2)
return;
pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword); pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword);
pci_config_dword &= ~AMD_813X_NOIOAMODE; pci_config_dword &= ~AMD_813X_NOIOAMODE;
@ -1981,7 +1984,6 @@ static void __devinit quirk_msi_ht_cap(struct pci_dev *dev)
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE, DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE,
quirk_msi_ht_cap); quirk_msi_ht_cap);
/* The nVidia CK804 chipset may have 2 HT MSI mappings. /* The nVidia CK804 chipset may have 2 HT MSI mappings.
* MSI are supported if the MSI capability set in any of these mappings. * MSI are supported if the MSI capability set in any of these mappings.
*/ */
@ -2032,6 +2034,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB,
ht_enable_msi_mapping); ht_enable_msi_mapping);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
ht_enable_msi_mapping);
/* The P5N32-SLI Premium motherboard from Asus has a problem with msi /* The P5N32-SLI Premium motherboard from Asus has a problem with msi
* for the MCP55 NIC. It is not yet determined whether the msi problem * for the MCP55 NIC. It is not yet determined whether the msi problem
* also affects other devices. As for now, turn off msi for this device. * also affects other devices. As for now, turn off msi for this device.
@ -2048,10 +2053,100 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA,
PCI_DEVICE_ID_NVIDIA_NVENET_15, PCI_DEVICE_ID_NVIDIA_NVENET_15,
nvenet_msi_disable); nvenet_msi_disable);
static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev)
{
struct pci_dev *host_bridge;
int pos;
int i, dev_no;
int found = 0;
dev_no = dev->devfn >> 3;
for (i = dev_no; i >= 0; i--) {
host_bridge = pci_get_slot(dev->bus, PCI_DEVFN(i, 0));
if (!host_bridge)
continue;
pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE);
if (pos != 0) {
found = 1;
break;
}
pci_dev_put(host_bridge);
}
if (!found)
return;
/* root did that ! */
if (msi_ht_cap_enabled(host_bridge))
goto out;
ht_enable_msi_mapping(dev);
out:
pci_dev_put(host_bridge);
}
static void __devinit ht_disable_msi_mapping(struct pci_dev *dev)
{
int pos, ttl = 48;
pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING);
while (pos && ttl--) {
u8 flags;
if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS,
&flags) == 0) {
dev_info(&dev->dev, "Enabling HT MSI Mapping\n");
pci_write_config_byte(dev, pos + HT_MSI_FLAGS,
flags & ~HT_MSI_FLAGS_ENABLE);
}
pos = pci_find_next_ht_capability(dev, pos,
HT_CAPTYPE_MSI_MAPPING);
}
}
static int __devinit ht_check_msi_mapping(struct pci_dev *dev)
{
int pos, ttl = 48;
int found = 0;
/* check if there is HT MSI cap or enabled on this device */
pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING);
while (pos && ttl--) {
u8 flags;
if (found < 1)
found = 1;
if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS,
&flags) == 0) {
if (flags & HT_MSI_FLAGS_ENABLE) {
if (found < 2) {
found = 2;
break;
}
}
}
pos = pci_find_next_ht_capability(dev, pos,
HT_CAPTYPE_MSI_MAPPING);
}
return found;
}
static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev)
{ {
struct pci_dev *host_bridge; struct pci_dev *host_bridge;
int pos, ttl = 48; int pos;
int found;
/* check if there is HT MSI cap or enabled on this device */
found = ht_check_msi_mapping(dev);
/* no HT MSI CAP */
if (found == 0)
return;
/* /*
* HT MSI mapping should be disabled on devices that are below * HT MSI mapping should be disabled on devices that are below
@ -2067,24 +2162,19 @@ static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev)
pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE);
if (pos != 0) { if (pos != 0) {
/* Host bridge is to HT */ /* Host bridge is to HT */
ht_enable_msi_mapping(dev); if (found == 1) {
/* it is not enabled, try to enable it */
nv_ht_enable_msi_mapping(dev);
}
return; return;
} }
/* Host bridge is not to HT, disable HT MSI mapping on this device */ /* HT MSI is not enabled */
pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); if (found == 1)
while (pos && ttl--) { return;
u8 flags;
if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, /* Host bridge is not to HT, disable HT MSI mapping on this device */
&flags) == 0) { ht_disable_msi_mapping(dev);
dev_info(&dev->dev, "Disabling HT MSI mapping");
pci_write_config_byte(dev, pos + HT_MSI_FLAGS,
flags & ~HT_MSI_FLAGS_ENABLE);
}
pos = pci_find_next_ht_capability(dev, pos,
HT_CAPTYPE_MSI_MAPPING);
}
} }
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk);

View file

@ -133,7 +133,7 @@
# define SCSPTR3 0xffed0024 /* 16 bit SCIF */ # define SCSPTR3 0xffed0024 /* 16 bit SCIF */
# define SCSPTR4 0xffee0024 /* 16 bit SCIF */ # define SCSPTR4 0xffee0024 /* 16 bit SCIF */
# define SCSPTR5 0xffef0024 /* 16 bit SCIF */ # define SCSPTR5 0xffef0024 /* 16 bit SCIF */
# define SCIF_OPER 0x0001 /* Overrun error bit */ # define SCIF_ORER 0x0001 /* Overrun error bit */
# define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */
#elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \ #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \
defined(CONFIG_CPU_SUBTYPE_SH7203) || \ defined(CONFIG_CPU_SUBTYPE_SH7203) || \

View file

@ -2164,19 +2164,20 @@ static void __exit panel_cleanup_module(void)
if (scan_timer.function != NULL) if (scan_timer.function != NULL)
del_timer(&scan_timer); del_timer(&scan_timer);
if (keypad_enabled) if (pprt != NULL) {
misc_deregister(&keypad_dev); if (keypad_enabled)
misc_deregister(&keypad_dev);
if (lcd_enabled) { if (lcd_enabled) {
panel_lcd_print("\x0cLCD driver " PANEL_VERSION panel_lcd_print("\x0cLCD driver " PANEL_VERSION
"\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-"); "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-");
misc_deregister(&lcd_dev); misc_deregister(&lcd_dev);
}
/* TODO: free all input signals */
parport_release(pprt);
parport_unregister_device(pprt);
} }
/* TODO: free all input signals */
parport_release(pprt);
parport_unregister_device(pprt);
parport_unregister_driver(&panel_driver); parport_unregister_driver(&panel_driver);
} }

View file

@ -1,5 +1,6 @@
config RTL8187SE config RTL8187SE
tristate "RealTek RTL8187SE Wireless LAN NIC driver" tristate "RealTek RTL8187SE Wireless LAN NIC driver"
depends on PCI depends on PCI
depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS
default N default N
---help--- ---help---

View file

@ -234,20 +234,21 @@ out:
void ieee80211_crypto_deinit(void) void ieee80211_crypto_deinit(void)
{ {
struct list_head *ptr, *n; struct list_head *ptr, *n;
struct ieee80211_crypto_alg *alg = NULL;
if (hcrypt == NULL) if (hcrypt == NULL)
return; return;
for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs; list_for_each_safe(ptr, n, &hcrypt->algs) {
ptr = n, n = ptr->next) { alg = list_entry(ptr, struct ieee80211_crypto_alg, list);
struct ieee80211_crypto_alg *alg = if (alg) {
(struct ieee80211_crypto_alg *) ptr; list_del(ptr);
list_del(ptr); printk(KERN_DEBUG
printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm " "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n",
"'%s' (deinit)\n", alg->ops->name); alg->ops->name);
kfree(alg); kfree(alg);
}
} }
kfree(hcrypt); kfree(hcrypt);
} }

View file

@ -6161,10 +6161,10 @@ static void __exit rtl8180_pci_module_exit(void)
{ {
pci_unregister_driver (&rtl8180_pci_driver); pci_unregister_driver (&rtl8180_pci_driver);
rtl8180_proc_module_remove(); rtl8180_proc_module_remove();
ieee80211_crypto_deinit();
ieee80211_crypto_tkip_exit(); ieee80211_crypto_tkip_exit();
ieee80211_crypto_ccmp_exit(); ieee80211_crypto_ccmp_exit();
ieee80211_crypto_wep_exit(); ieee80211_crypto_wep_exit();
ieee80211_crypto_deinit();
DMESG("Exiting"); DMESG("Exiting");
} }

View file

@ -319,16 +319,18 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
struct usb_device *udev = interface_to_usbdev(intf); struct usb_device *udev = interface_to_usbdev(intf);
struct wbsoft_priv *priv; struct wbsoft_priv *priv;
struct ieee80211_hw *dev; struct ieee80211_hw *dev;
int err; int nr, err;
usb_get_dev(udev); usb_get_dev(udev);
// 20060630.2 Check the device if it already be opened // 20060630.2 Check the device if it already be opened
err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ), nr = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ),
0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN, 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN,
0x0, 0x400, &ltmp, 4, HZ*100 ); 0x0, 0x400, &ltmp, 4, HZ*100 );
if (err) if (nr < 0) {
err = nr;
goto error; goto error;
}
ltmp = cpu_to_le32(ltmp); ltmp = cpu_to_le32(ltmp);
if (ltmp) { // Is already initialized? if (ltmp) { // Is already initialized?
@ -337,8 +339,10 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
} }
dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops); dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops);
if (!dev) if (!dev) {
err = -ENOMEM;
goto error; goto error;
}
priv = dev->priv; priv = dev->priv;
@ -369,9 +373,11 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id
} }
dev->extra_tx_headroom = 12; /* FIXME */ dev->extra_tx_headroom = 12; /* FIXME */
dev->flags = 0; dev->flags = IEEE80211_HW_SIGNAL_UNSPEC;
dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
dev->channel_change_time = 1000; dev->channel_change_time = 1000;
dev->max_signal = 100;
dev->queues = 1; dev->queues = 1;
dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz; dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz;

View file

@ -1376,6 +1376,15 @@ static struct usb_device_id acm_ids[] = {
{ USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */ { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
}, },
{ USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
},
{ USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
.driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on
data interface instead of
communications interface.
Maybe we should define a new
quirk for this. */
},
/* control interfaces with various AT-command sets */ /* control interfaces with various AT-command sets */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,

View file

@ -653,7 +653,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type,
if (result <= 0 && result != -ETIMEDOUT) if (result <= 0 && result != -ETIMEDOUT)
continue; continue;
if (result > 1 && ((u8 *)buf)[1] != type) { if (result > 1 && ((u8 *)buf)[1] != type) {
result = -EPROTO; result = -ENODATA;
continue; continue;
} }
break; break;
@ -696,8 +696,13 @@ static int usb_get_string(struct usb_device *dev, unsigned short langid,
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
(USB_DT_STRING << 8) + index, langid, buf, size, (USB_DT_STRING << 8) + index, langid, buf, size,
USB_CTRL_GET_TIMEOUT); USB_CTRL_GET_TIMEOUT);
if (!(result == 0 || result == -EPIPE)) if (result == 0 || result == -EPIPE)
break; continue;
if (result > 1 && ((u8 *) buf)[1] != USB_DT_STRING) {
result = -ENODATA;
continue;
}
break;
} }
return result; return result;
} }

View file

@ -191,6 +191,7 @@ config USB_GADGET_OMAP
boolean "OMAP USB Device Controller" boolean "OMAP USB Device Controller"
depends on ARCH_OMAP depends on ARCH_OMAP
select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
select USB_OTG_UTILS if ARCH_OMAP
help help
Many Texas Instruments OMAP processors have flexible full Many Texas Instruments OMAP processors have flexible full
speed USB device controllers, with support for up to 30 speed USB device controllers, with support for up to 30

View file

@ -366,9 +366,9 @@ obex_bind(struct usb_configuration *c, struct usb_function *f)
f->hs_descriptors = usb_copy_descriptors(hs_function); f->hs_descriptors = usb_copy_descriptors(hs_function);
obex->hs.obex_in = usb_find_endpoint(hs_function, obex->hs.obex_in = usb_find_endpoint(hs_function,
f->descriptors, &obex_hs_ep_in_desc); f->hs_descriptors, &obex_hs_ep_in_desc);
obex->hs.obex_out = usb_find_endpoint(hs_function, obex->hs.obex_out = usb_find_endpoint(hs_function,
f->descriptors, &obex_hs_ep_out_desc); f->hs_descriptors, &obex_hs_ep_out_desc);
} }
/* Avoid letting this gadget enumerate until the userspace /* Avoid letting this gadget enumerate until the userspace

View file

@ -3879,7 +3879,11 @@ static int __init check_parameters(struct fsg_dev *fsg)
mod_data.protocol_type = USB_SC_SCSI; mod_data.protocol_type = USB_SC_SCSI;
mod_data.protocol_name = "Transparent SCSI"; mod_data.protocol_name = "Transparent SCSI";
if (gadget_is_sh(fsg->gadget)) /* Some peripheral controllers are known not to be able to
* halt bulk endpoints correctly. If one of them is present,
* disable stalls.
*/
if (gadget_is_sh(fsg->gadget) || gadget_is_at91(fsg->gadget))
mod_data.can_stall = 0; mod_data.can_stall = 0;
if (mod_data.release == 0xffff) { // Parameter wasn't set if (mod_data.release == 0xffff) { // Parameter wasn't set

View file

@ -404,7 +404,10 @@ static void struct_ep_qh_setup(struct fsl_udc *udc, unsigned char ep_num,
} }
if (zlt) if (zlt)
tmp |= EP_QUEUE_HEAD_ZLT_SEL; tmp |= EP_QUEUE_HEAD_ZLT_SEL;
p_QH->max_pkt_length = cpu_to_le32(tmp); p_QH->max_pkt_length = cpu_to_le32(tmp);
p_QH->next_dtd_ptr = 1;
p_QH->size_ioc_int_sts = 0;
return; return;
} }

View file

@ -485,6 +485,7 @@ static int ehci_init(struct usb_hcd *hcd)
* periodic_size can shrink by USBCMD update if hcc_params allows. * periodic_size can shrink by USBCMD update if hcc_params allows.
*/ */
ehci->periodic_size = DEFAULT_I_TDPS; ehci->periodic_size = DEFAULT_I_TDPS;
INIT_LIST_HEAD(&ehci->cached_itd_list);
if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
return retval; return retval;
@ -497,6 +498,7 @@ static int ehci_init(struct usb_hcd *hcd)
ehci->reclaim = NULL; ehci->reclaim = NULL;
ehci->next_uframe = -1; ehci->next_uframe = -1;
ehci->clock_frame = -1;
/* /*
* dedicate a qh for the async ring head, since we couldn't unlink * dedicate a qh for the async ring head, since we couldn't unlink

View file

@ -128,6 +128,7 @@ static inline void qh_put (struct ehci_qh *qh)
static void ehci_mem_cleanup (struct ehci_hcd *ehci) static void ehci_mem_cleanup (struct ehci_hcd *ehci)
{ {
free_cached_itd_list(ehci);
if (ehci->async) if (ehci->async)
qh_put (ehci->async); qh_put (ehci->async);
ehci->async = NULL; ehci->async = NULL;

View file

@ -1004,7 +1004,8 @@ iso_stream_put(struct ehci_hcd *ehci, struct ehci_iso_stream *stream)
is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0; is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0;
stream->bEndpointAddress &= 0x0f; stream->bEndpointAddress &= 0x0f;
stream->ep->hcpriv = NULL; if (stream->ep)
stream->ep->hcpriv = NULL;
if (stream->rescheduled) { if (stream->rescheduled) {
ehci_info (ehci, "ep%d%s-iso rescheduled " ehci_info (ehci, "ep%d%s-iso rescheduled "
@ -1653,14 +1654,28 @@ itd_complete (
(stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out");
} }
iso_stream_put (ehci, stream); iso_stream_put (ehci, stream);
/* OK to recycle this ITD now that its completion callback ran. */
done: done:
usb_put_urb(urb); usb_put_urb(urb);
itd->urb = NULL; itd->urb = NULL;
itd->stream = NULL; if (ehci->clock_frame != itd->frame || itd->index[7] != -1) {
list_move(&itd->itd_list, &stream->free_list); /* OK to recycle this ITD now. */
iso_stream_put(ehci, stream); itd->stream = NULL;
list_move(&itd->itd_list, &stream->free_list);
iso_stream_put(ehci, stream);
} else {
/* HW might remember this ITD, so we can't recycle it yet.
* Move it to a safe place until a new frame starts.
*/
list_move(&itd->itd_list, &ehci->cached_itd_list);
if (stream->refcount == 2) {
/* If iso_stream_put() were called here, stream
* would be freed. Instead, just prevent reuse.
*/
stream->ep->hcpriv = NULL;
stream->ep = NULL;
}
}
return retval; return retval;
} }
@ -2101,6 +2116,20 @@ done:
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static void free_cached_itd_list(struct ehci_hcd *ehci)
{
struct ehci_itd *itd, *n;
list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) {
struct ehci_iso_stream *stream = itd->stream;
itd->stream = NULL;
list_move(&itd->itd_list, &stream->free_list);
iso_stream_put(ehci, stream);
}
}
/*-------------------------------------------------------------------------*/
static void static void
scan_periodic (struct ehci_hcd *ehci) scan_periodic (struct ehci_hcd *ehci)
{ {
@ -2115,10 +2144,17 @@ scan_periodic (struct ehci_hcd *ehci)
* Touches as few pages as possible: cache-friendly. * Touches as few pages as possible: cache-friendly.
*/ */
now_uframe = ehci->next_uframe; now_uframe = ehci->next_uframe;
if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) if (HC_IS_RUNNING(ehci_to_hcd(ehci)->state)) {
clock = ehci_readl(ehci, &ehci->regs->frame_index); clock = ehci_readl(ehci, &ehci->regs->frame_index);
else clock_frame = (clock >> 3) % ehci->periodic_size;
} else {
clock = now_uframe + mod - 1; clock = now_uframe + mod - 1;
clock_frame = -1;
}
if (ehci->clock_frame != clock_frame) {
free_cached_itd_list(ehci);
ehci->clock_frame = clock_frame;
}
clock %= mod; clock %= mod;
clock_frame = clock >> 3; clock_frame = clock >> 3;
@ -2277,6 +2313,10 @@ restart:
/* rescan the rest of this frame, then ... */ /* rescan the rest of this frame, then ... */
clock = now; clock = now;
clock_frame = clock >> 3; clock_frame = clock >> 3;
if (ehci->clock_frame != clock_frame) {
free_cached_itd_list(ehci);
ehci->clock_frame = clock_frame;
}
} else { } else {
now_uframe++; now_uframe++;
now_uframe %= mod; now_uframe %= mod;

View file

@ -87,6 +87,10 @@ struct ehci_hcd { /* one per controller */
int next_uframe; /* scan periodic, start here */ int next_uframe; /* scan periodic, start here */
unsigned periodic_sched; /* periodic activity count */ unsigned periodic_sched; /* periodic activity count */
/* list of itds completed while clock_frame was still active */
struct list_head cached_itd_list;
unsigned clock_frame;
/* per root hub port */ /* per root hub port */
unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; unsigned long reset_done [EHCI_MAX_ROOT_PORTS];
@ -220,6 +224,8 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action)
} }
} }
static void free_cached_itd_list(struct ehci_hcd *ehci);
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
#include <linux/usb/ehci_def.h> #include <linux/usb/ehci_def.h>

View file

@ -377,18 +377,8 @@ int __init musb_platform_init(struct musb *musb)
u32 revision; u32 revision;
musb->mregs += DAVINCI_BASE_OFFSET; musb->mregs += DAVINCI_BASE_OFFSET;
#if 0
/* REVISIT there's something odd about clocking, this
* didn't appear do the job ...
*/
musb->clock = clk_get(pDevice, "usb");
if (IS_ERR(musb->clock))
return PTR_ERR(musb->clock);
status = clk_enable(musb->clock); clk_enable(musb->clock);
if (status < 0)
return -ENODEV;
#endif
/* returns zero if e.g. not clocked */ /* returns zero if e.g. not clocked */
revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG); revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG);
@ -453,5 +443,8 @@ int musb_platform_exit(struct musb *musb)
} }
phy_off(); phy_off();
clk_disable(musb->clock);
return 0; return 0;
} }

Some files were not shown because too many files have changed in this diff Show more