提交 2d610b80 编写于 作者: D Dave Kleikamp

Merge with /home/shaggy/git/linus-clean/

Signed-off-by: NDave Kleikamp <shaggy@austin.ibm.com>
...@@ -2380,8 +2380,8 @@ E: tmolina@cablespeed.com ...@@ -2380,8 +2380,8 @@ E: tmolina@cablespeed.com
D: bug fixes, documentation, minor hackery D: bug fixes, documentation, minor hackery
N: James Morris N: James Morris
E: jmorris@redhat.com E: jmorris@namei.org
W: http://www.intercode.com.au/jmorris/ W: http://namei.org/
D: Netfilter, Linux Security Modules (LSM), SELinux, IPSec, D: Netfilter, Linux Security Modules (LSM), SELinux, IPSec,
D: Crypto API, general networking, miscellaneous. D: Crypto API, general networking, miscellaneous.
S: PO Box 707 S: PO Box 707
......
...@@ -102,7 +102,7 @@ Here is the list of words, from left to right: ...@@ -102,7 +102,7 @@ Here is the list of words, from left to right:
- URB Status. This field makes no sense for submissions, but is present - URB Status. This field makes no sense for submissions, but is present
to help scripts with parsing. In error case, it contains the error code. to help scripts with parsing. In error case, it contains the error code.
In case of a setup packet, it contains a Setup Tag. If scripts read a number In case of a setup packet, it contains a Setup Tag. If scripts read a number
in this field, the proceed to read Data Length. Otherwise, they read in this field, they proceed to read Data Length. Otherwise, they read
the setup packet before reading the Data Length. the setup packet before reading the Data Length.
- Setup packet, if present, consists of 5 words: one of each for bmRequestType, - Setup packet, if present, consists of 5 words: one of each for bmRequestType,
bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0. bRequest, wValue, wIndex, wLength, as specified by the USB Specification 2.0.
......
...@@ -6,6 +6,11 @@ only the AMD64 specific ones are listed here. ...@@ -6,6 +6,11 @@ only the AMD64 specific ones are listed here.
Machine check Machine check
mce=off disable machine check mce=off disable machine check
mce=bootlog Enable logging of machine checks left over from booting.
Disabled by default because some BIOS leave bogus ones.
If your BIOS doesn't do that it's a good idea to enable though
to make sure you log even machine check events that result
in a reboot.
nomce (for compatibility with i386): same as mce=off nomce (for compatibility with i386): same as mce=off
......
...@@ -1658,7 +1658,7 @@ M: kuznet@ms2.inr.ac.ru ...@@ -1658,7 +1658,7 @@ M: kuznet@ms2.inr.ac.ru
P: Pekka Savola (ipv6) P: Pekka Savola (ipv6)
M: pekkas@netcore.fi M: pekkas@netcore.fi
P: James Morris P: James Morris
M: jmorris@redhat.com M: jmorris@namei.org
P: Hideaki YOSHIFUJI P: Hideaki YOSHIFUJI
M: yoshfuji@linux-ipv6.org M: yoshfuji@linux-ipv6.org
P: Patrick McHardy P: Patrick McHardy
...@@ -2047,7 +2047,7 @@ SELINUX SECURITY MODULE ...@@ -2047,7 +2047,7 @@ SELINUX SECURITY MODULE
P: Stephen Smalley P: Stephen Smalley
M: sds@epoch.ncsc.mil M: sds@epoch.ncsc.mil
P: James Morris P: James Morris
M: jmorris@redhat.com M: jmorris@namei.org
L: linux-kernel@vger.kernel.org (kernel issues) L: linux-kernel@vger.kernel.org (kernel issues)
L: selinux@tycho.nsa.gov (general discussion) L: selinux@tycho.nsa.gov (general discussion)
W: http://www.nsa.gov/selinux W: http://www.nsa.gov/selinux
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 6 PATCHLEVEL = 6
SUBLEVEL = 13 SUBLEVEL = 13
EXTRAVERSION =-rc5 EXTRAVERSION =-rc6
NAME=Woozy Numbat NAME=Woozy Numbat
# *DOCUMENTATION* # *DOCUMENTATION*
......
...@@ -41,18 +41,19 @@ summary from [1.]>" for easy identification by the developers ...@@ -41,18 +41,19 @@ summary from [1.]>" for easy identification by the developers
[2.] Full description of the problem/report: [2.] Full description of the problem/report:
[3.] Keywords (i.e., modules, networking, kernel): [3.] Keywords (i.e., modules, networking, kernel):
[4.] Kernel version (from /proc/version): [4.] Kernel version (from /proc/version):
[5.] Output of Oops.. message (if applicable) with symbolic information [5.] Most recent kernel version which did not have the bug:
[6.] Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt) resolved (see Documentation/oops-tracing.txt)
[6.] A small shell script or example program which triggers the [7.] A small shell script or example program which triggers the
problem (if possible) problem (if possible)
[7.] Environment [8.] Environment
[7.1.] Software (add the output of the ver_linux script here) [8.1.] Software (add the output of the ver_linux script here)
[7.2.] Processor information (from /proc/cpuinfo): [8.2.] Processor information (from /proc/cpuinfo):
[7.3.] Module information (from /proc/modules): [8.3.] Module information (from /proc/modules):
[7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) [8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
[7.5.] PCI information ('lspci -vvv' as root) [8.5.] PCI information ('lspci -vvv' as root)
[7.6.] SCSI information (from /proc/scsi/scsi) [8.6.] SCSI information (from /proc/scsi/scsi)
[7.7.] Other information that might be relevant to the problem [8.7.] Other information that might be relevant to the problem
(please look in /proc and include all information that you (please look in /proc and include all information that you
think to be relevant): think to be relevant):
[X.] Other notes, patches, fixes, workarounds: [X.] Other notes, patches, fixes, workarounds:
......
...@@ -350,8 +350,24 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, ...@@ -350,8 +350,24 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
region->end = res->end - offset; region->end = res->end - offset;
} }
void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
struct pci_bus_region *region)
{
struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
unsigned long offset = 0;
if (res->flags & IORESOURCE_IO)
offset = hose->io_space->start;
else if (res->flags & IORESOURCE_MEM)
offset = hose->mem_space->start;
res->start = region->start + offset;
res->end = region->end + offset;
}
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pcibios_resource_to_bus); EXPORT_SYMBOL(pcibios_resource_to_bus);
EXPORT_SYMBOL(pcibios_bus_to_resource);
#endif #endif
int int
......
...@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, ...@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
region->end = res->end - offset; region->end = res->end - offset;
} }
void __devinit
pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
struct pci_bus_region *region)
{
struct pci_sys_data *root = dev->sysdata;
unsigned long offset = 0;
if (res->flags & IORESOURCE_IO)
offset = root->io_offset;
if (res->flags & IORESOURCE_MEM)
offset = root->mem_offset;
res->start = region->start + offset;
res->end = region->end + offset;
}
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pcibios_fixup_bus); EXPORT_SYMBOL(pcibios_fixup_bus);
EXPORT_SYMBOL(pcibios_resource_to_bus); EXPORT_SYMBOL(pcibios_resource_to_bus);
EXPORT_SYMBOL(pcibios_bus_to_resource);
#endif #endif
/* /*
......
...@@ -454,8 +454,9 @@ config HPET_TIMER ...@@ -454,8 +454,9 @@ config HPET_TIMER
Choose N to continue using the legacy 8254 timer. Choose N to continue using the legacy 8254 timer.
config HPET_EMULATE_RTC config HPET_EMULATE_RTC
bool "Provide RTC interrupt" bool
depends on HPET_TIMER && RTC=y depends on HPET_TIMER && RTC=y
default y
config SMP config SMP
bool "Symmetric multi-processing support" bool "Symmetric multi-processing support"
......
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
void (*pm_power_off)(void); void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off); EXPORT_SYMBOL(pm_power_off);
void machine_restart(char * __unused) void machine_shutdown(void)
{ {
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
smp_send_stop(); smp_send_stop();
#endif #endif
}
void machine_emergency_restart(void)
{
/* /*
* Visual Workstations restart after this * Visual Workstations restart after this
* register is poked on the PIIX4 * register is poked on the PIIX4
...@@ -22,6 +25,12 @@ void machine_restart(char * __unused) ...@@ -22,6 +25,12 @@ void machine_restart(char * __unused)
outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
} }
void machine_restart(char * __unused)
{
machine_shutdown();
machine_emergency_restart();
}
void machine_power_off(void) void machine_power_off(void)
{ {
unsigned short pm_status; unsigned short pm_status;
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include "cobalt.h" #include "cobalt.h"
#include "piix4.h" #include "piix4.h"
int no_broadcast;
char visws_board_type = -1; char visws_board_type = -1;
char visws_board_rev = -1; char visws_board_rev = -1;
......
...@@ -251,6 +251,12 @@ kb_wait(void) ...@@ -251,6 +251,12 @@ kb_wait(void)
break; break;
} }
void
machine_shutdown(void)
{
/* Architecture specific shutdown needed before a kexec */
}
void void
machine_restart(char *cmd) machine_restart(char *cmd)
{ {
...@@ -278,6 +284,13 @@ machine_restart(char *cmd) ...@@ -278,6 +284,13 @@ machine_restart(char *cmd)
} }
} }
void
machine_emergency_restart(void)
{
/*for now, just hook this to a warm restart */
machine_restart(NULL);
}
void void
mca_nmi_hook(void) mca_nmi_hook(void)
{ {
......
...@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void) ...@@ -243,14 +243,6 @@ static unsigned long calculate_numa_remap_pages(void)
/* now the roundup is correct, convert to PAGE_SIZE pages */ /* now the roundup is correct, convert to PAGE_SIZE pages */
size = size * PTRS_PER_PTE; size = size * PTRS_PER_PTE;
if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
/*
* Adjust size if node_end_pfn is not on a proper
* pmd boundary. remap_numa_kva will barf otherwise.
*/
size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
}
/* /*
* Validate the region we are allocating only contains valid * Validate the region we are allocating only contains valid
* pages. * pages.
...@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void) ...@@ -270,6 +262,17 @@ static unsigned long calculate_numa_remap_pages(void)
reserve_pages += size; reserve_pages += size;
printk("Shrinking node %d from %ld pages to %ld pages\n", printk("Shrinking node %d from %ld pages to %ld pages\n",
nid, node_end_pfn[nid], node_end_pfn[nid] - size); nid, node_end_pfn[nid], node_end_pfn[nid] - size);
if (node_end_pfn[nid] & (PTRS_PER_PTE-1)) {
/*
* Align node_end_pfn[] and node_remap_start_pfn[] to
* pmd boundary. remap_numa_kva will barf otherwise.
*/
printk("Shrinking node %d further by %ld pages for proper alignment\n",
nid, node_end_pfn[nid] & (PTRS_PER_PTE-1));
size += node_end_pfn[nid] & (PTRS_PER_PTE-1);
}
node_end_pfn[nid] -= size; node_end_pfn[nid] -= size;
node_remap_start_pfn[nid] = node_end_pfn[nid]; node_remap_start_pfn[nid] = node_end_pfn[nid];
} }
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
extern struct pci_raw_ops pci_direct_conf1; extern struct pci_raw_ops pci_direct_conf1;
static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
static void pci_visws_disable_irq(struct pci_dev *dev) { }
int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq; int (*pcibios_enable_irq)(struct pci_dev *dev) = &pci_visws_enable_irq;
void (*pcibios_disable_irq)(struct pci_dev *dev) = &pci_visws_disable_irq;
void __init pcibios_penalize_isa_irq(int irq, int active) {} void __init pcibios_penalize_isa_irq(int irq, int active) {}
......
...@@ -179,7 +179,7 @@ static int can_do_pal_halt = 1; ...@@ -179,7 +179,7 @@ static int can_do_pal_halt = 1;
static int __init nohalt_setup(char * str) static int __init nohalt_setup(char * str)
{ {
pal_halt = 0; pal_halt = can_do_pal_halt = 0;
return 1; return 1;
} }
__setup("nohalt", nohalt_setup); __setup("nohalt", nohalt_setup);
......
...@@ -69,9 +69,9 @@ config FEC_QS6612 ...@@ -69,9 +69,9 @@ config FEC_QS6612
config ENET_BIG_BUFFERS config ENET_BIG_BUFFERS
bool "Use Big CPM Ethernet Buffers" bool "Use Big CPM Ethernet Buffers"
depends on NET_ETHERNET depends on SCC_ENET || FEC_ENET
help help
Allocate large buffers for MPC8xx Etherenet. Increases throughput Allocate large buffers for MPC8xx Ethernet. Increases throughput
and decreases the likelihood of dropped packets, but costs memory. and decreases the likelihood of dropped packets, but costs memory.
config HTDMSOUND config HTDMSOUND
......
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/rheap.h> #include <asm/rheap.h>
extern int get_pteptr(struct mm_struct *mm, unsigned long addr, pte_t **ptep);
static void m8xx_cpm_dpinit(void); static void m8xx_cpm_dpinit(void);
static uint host_buffer; /* One page of host buffer */ static uint host_buffer; /* One page of host buffer */
static uint host_end; /* end + 1 */ static uint host_end; /* end + 1 */
...@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = { ...@@ -108,14 +106,11 @@ struct hw_interrupt_type cpm_pic = {
.end = cpm_eoi, .end = cpm_eoi,
}; };
extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr);
void void
m8xx_cpm_reset(uint bootpage) m8xx_cpm_reset(void)
{ {
volatile immap_t *imp; volatile immap_t *imp;
volatile cpm8xx_t *commproc; volatile cpm8xx_t *commproc;
pte_t *pte;
imp = (immap_t *)IMAP_ADDR; imp = (immap_t *)IMAP_ADDR;
commproc = (cpm8xx_t *)&imp->im_cpm; commproc = (cpm8xx_t *)&imp->im_cpm;
...@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage) ...@@ -143,17 +138,6 @@ m8xx_cpm_reset(uint bootpage)
/* Reclaim the DP memory for our use. */ /* Reclaim the DP memory for our use. */
m8xx_cpm_dpinit(); m8xx_cpm_dpinit();
/* get the PTE for the bootpage */
if (!get_pteptr(&init_mm, bootpage, &pte))
panic("get_pteptr failed\n");
/* and make it uncachable */
pte_val(*pte) |= _PAGE_NO_CACHE;
_tlbie(bootpage);
host_buffer = bootpage;
host_end = host_buffer + PAGE_SIZE;
/* Tell everyone where the comm processor resides. /* Tell everyone where the comm processor resides.
*/ */
cpmp = (cpm8xx_t *)commproc; cpmp = (cpm8xx_t *)commproc;
...@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info; ...@@ -384,8 +368,6 @@ static rh_info_t cpm_dpmem_info;
void m8xx_cpm_dpinit(void) void m8xx_cpm_dpinit(void)
{ {
cpm8xx_t *cp = &((immap_t *)IMAP_ADDR)->im_cpm;
spin_lock_init(&cpm_dpmem_lock); spin_lock_init(&cpm_dpmem_lock);
/* Initialize the info header */ /* Initialize the info header */
......
...@@ -173,7 +173,7 @@ struct fec_enet_private { ...@@ -173,7 +173,7 @@ struct fec_enet_private {
uint phy_status; uint phy_status;
uint phy_speed; uint phy_speed;
phy_info_t *phy; phy_info_t *phy;
struct tq_struct phy_task; struct work_struct phy_task;
uint sequence_done; uint sequence_done;
...@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); ...@@ -199,7 +199,8 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
#ifdef CONFIG_USE_MDIO #ifdef CONFIG_USE_MDIO
static void fec_enet_mii(struct net_device *dev); static void fec_enet_mii(struct net_device *dev);
#endif /* CONFIG_USE_MDIO */ #endif /* CONFIG_USE_MDIO */
static void fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs); static irqreturn_t fec_enet_interrupt(int irq, void * dev_id,
struct pt_regs * regs);
#ifdef CONFIG_FEC_PACKETHOOK #ifdef CONFIG_FEC_PACKETHOOK
static void fec_enet_tx(struct net_device *dev, __u32 regval); static void fec_enet_tx(struct net_device *dev, __u32 regval);
static void fec_enet_rx(struct net_device *dev, __u32 regval); static void fec_enet_rx(struct net_device *dev, __u32 regval);
...@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev) ...@@ -471,7 +472,7 @@ fec_timeout(struct net_device *dev)
/* The interrupt handler. /* The interrupt handler.
* This is called from the MPC core interrupt. * This is called from the MPC core interrupt.
*/ */
static void static irqreturn_t
fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs) fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
{ {
struct net_device *dev = dev_id; struct net_device *dev = dev_id;
...@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO ...@@ -525,6 +526,7 @@ printk("%s[%d] %s: unexpected FEC_ENET_MII event\n", __FILE__,__LINE__,__FUNCTIO
} }
} }
return IRQ_RETVAL(IRQ_HANDLED);
} }
...@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev) ...@@ -1263,8 +1265,9 @@ static void mii_display_status(struct net_device *dev)
printk(".\n"); printk(".\n");
} }
static void mii_display_config(struct net_device *dev) static void mii_display_config(void *priv)
{ {
struct net_device *dev = (struct net_device *)priv;
struct fec_enet_private *fep = dev->priv; struct fec_enet_private *fep = dev->priv;
volatile uint *s = &(fep->phy_status); volatile uint *s = &(fep->phy_status);
...@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev) ...@@ -1294,8 +1297,9 @@ static void mii_display_config(struct net_device *dev)
fep->sequence_done = 1; fep->sequence_done = 1;
} }
static void mii_relink(struct net_device *dev) static void mii_relink(void *priv)
{ {
struct net_device *dev = (struct net_device *)priv;
struct fec_enet_private *fep = dev->priv; struct fec_enet_private *fep = dev->priv;
int duplex; int duplex;
...@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev) ...@@ -1323,18 +1327,16 @@ static void mii_queue_relink(uint mii_reg, struct net_device *dev)
{ {
struct fec_enet_private *fep = dev->priv; struct fec_enet_private *fep = dev->priv;
fep->phy_task.routine = (void *)mii_relink; INIT_WORK(&fep->phy_task, mii_relink, (void *)dev);
fep->phy_task.data = dev; schedule_work(&fep->phy_task);
schedule_task(&fep->phy_task);
} }
static void mii_queue_config(uint mii_reg, struct net_device *dev) static void mii_queue_config(uint mii_reg, struct net_device *dev)
{ {
struct fec_enet_private *fep = dev->priv; struct fec_enet_private *fep = dev->priv;
fep->phy_task.routine = (void *)mii_display_config; INIT_WORK(&fep->phy_task, mii_display_config, (void *)dev);
fep->phy_task.data = dev; schedule_work(&fep->phy_task);
schedule_task(&fep->phy_task);
} }
...@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) ...@@ -1403,11 +1405,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
/* This interrupt occurs when the PHY detects a link change. /* This interrupt occurs when the PHY detects a link change.
*/ */
static void static
#ifdef CONFIG_RPXCLASSIC #ifdef CONFIG_RPXCLASSIC
mii_link_interrupt(void *dev_id) void mii_link_interrupt(void *dev_id)
#else #else
mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) irqreturn_t mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
#endif #endif
{ {
#ifdef CONFIG_USE_MDIO #ifdef CONFIG_USE_MDIO
...@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) ...@@ -1440,6 +1442,9 @@ mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs)
printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__); printk("%s[%d] %s: unexpected Link interrupt\n", __FILE__,__LINE__,__FUNCTION__);
#endif /* CONFIG_USE_MDIO */ #endif /* CONFIG_USE_MDIO */
#ifndef CONFIG_RPXCLASSIC
return IRQ_RETVAL(IRQ_HANDLED);
#endif /* CONFIG_RPXCLASSIC */
} }
static int static int
...@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void) ...@@ -1575,7 +1580,7 @@ static int __init fec_enet_init(void)
struct fec_enet_private *fep; struct fec_enet_private *fep;
int i, j, k, err; int i, j, k, err;
unsigned char *eap, *iap, *ba; unsigned char *eap, *iap, *ba;
unsigned long mem_addr; dma_addr_t mem_addr;
volatile cbd_t *bdp; volatile cbd_t *bdp;
cbd_t *cbd_base; cbd_t *cbd_base;
volatile immap_t *immap; volatile immap_t *immap;
...@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void) ...@@ -1640,7 +1645,8 @@ static int __init fec_enet_init(void)
printk("FEC initialization failed.\n"); printk("FEC initialization failed.\n");
return 1; return 1;
} }
cbd_base = (cbd_t *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); cbd_base = (cbd_t *)dma_alloc_coherent(dev->class_dev.dev, PAGE_SIZE,
&mem_addr, GFP_KERNEL);
/* Set receive and transmit descriptor base. /* Set receive and transmit descriptor base.
*/ */
...@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void) ...@@ -1657,7 +1663,10 @@ static int __init fec_enet_init(void)
/* Allocate a page. /* Allocate a page.
*/ */
ba = (unsigned char *)consistent_alloc(GFP_KERNEL, PAGE_SIZE, &mem_addr); ba = (unsigned char *)dma_alloc_coherent(dev->class_dev.dev,
PAGE_SIZE,
&mem_addr,
GFP_KERNEL);
/* BUG: no check for failure */ /* BUG: no check for failure */
/* Initialize the BD for every fragment in the page. /* Initialize the BD for every fragment in the page.
......
...@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, ...@@ -160,6 +160,21 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
} }
EXPORT_SYMBOL(pcibios_resource_to_bus); EXPORT_SYMBOL(pcibios_resource_to_bus);
void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
struct pci_bus_region *region)
{
unsigned long offset = 0;
struct pci_controller *hose = dev->sysdata;
if (hose && res->flags & IORESOURCE_IO)
offset = (unsigned long)hose->io_base_virt - isa_io_base;
else if (hose && res->flags & IORESOURCE_MEM)
offset = hose->pci_mem_offset;
res->start = region->start + offset;
res->end = region->end + offset;
}
EXPORT_SYMBOL(pcibios_bus_to_resource);
/* /*
* We need to avoid collisions with `mirrored' VGA ports * We need to avoid collisions with `mirrored' VGA ports
* and other strange ISA hardware, so we always want the * and other strange ISA hardware, so we always want the
......
...@@ -324,7 +324,7 @@ EXPORT_SYMBOL(__res); ...@@ -324,7 +324,7 @@ EXPORT_SYMBOL(__res);
EXPORT_SYMBOL(next_mmu_context); EXPORT_SYMBOL(next_mmu_context);
EXPORT_SYMBOL(set_context); EXPORT_SYMBOL(set_context);
EXPORT_SYMBOL(handle_mm_fault); /* For MOL */ EXPORT_SYMBOL_GPL(__handle_mm_fault); /* For MOL */
EXPORT_SYMBOL(disarm_decr); EXPORT_SYMBOL(disarm_decr);
#ifdef CONFIG_PPC_STD_MMU #ifdef CONFIG_PPC_STD_MMU
extern long mol_trampoline; extern long mol_trampoline;
......
...@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)]; ...@@ -57,7 +57,7 @@ unsigned char __res[sizeof(bd_t)];
extern void m8xx_ide_init(void); extern void m8xx_ide_init(void);
extern unsigned long find_available_memory(void); extern unsigned long find_available_memory(void);
extern void m8xx_cpm_reset(uint cpm_page); extern void m8xx_cpm_reset();
extern void m8xx_wdt_handler_install(bd_t *bp); extern void m8xx_wdt_handler_install(bd_t *bp);
extern void rpxfb_alloc_pages(void); extern void rpxfb_alloc_pages(void);
extern void cpm_interrupt_init(void); extern void cpm_interrupt_init(void);
...@@ -70,13 +70,9 @@ board_init(void) ...@@ -70,13 +70,9 @@ board_init(void)
void __init void __init
m8xx_setup_arch(void) m8xx_setup_arch(void)
{ {
int cpm_page;
cpm_page = (int) alloc_bootmem_pages(PAGE_SIZE);
/* Reset the Communication Processor Module. /* Reset the Communication Processor Module.
*/ */
m8xx_cpm_reset(cpm_page); m8xx_cpm_reset();
#ifdef CONFIG_FB_RPX #ifdef CONFIG_FB_RPX
rpxfb_alloc_pages(); rpxfb_alloc_pages();
......
...@@ -191,8 +191,8 @@ struct platform_device ppc_sys_platform_devices[] = { ...@@ -191,8 +191,8 @@ struct platform_device ppc_sys_platform_devices[] = {
.num_resources = 2, .num_resources = 2,
.resource = (struct resource[]) { .resource = (struct resource[]) {
{ {
.start = 0x22000, .start = 0x23000,
.end = 0x22fff, .end = 0x23fff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
{ {
...@@ -208,8 +208,8 @@ struct platform_device ppc_sys_platform_devices[] = { ...@@ -208,8 +208,8 @@ struct platform_device ppc_sys_platform_devices[] = {
.num_resources = 2, .num_resources = 2,
.resource = (struct resource[]) { .resource = (struct resource[]) {
{ {
.start = 0x23000, .start = 0x22000,
.end = 0x23fff, .end = 0x22fff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, },
{ {
......
...@@ -1307,7 +1307,7 @@ local int huft_build( ...@@ -1307,7 +1307,7 @@ local int huft_build(
{ {
*t = (inflate_huft *)Z_NULL; *t = (inflate_huft *)Z_NULL;
*m = 0; *m = 0;
return Z_OK; return Z_DATA_ERROR;
} }
...@@ -1351,6 +1351,7 @@ local int huft_build( ...@@ -1351,6 +1351,7 @@ local int huft_build(
if ((j = *p++) != 0) if ((j = *p++) != 0)
v[x[j]++] = i; v[x[j]++] = i;
} while (++i < n); } while (++i < n);
n = x[g]; /* set n to length of v */
/* Generate the Huffman codes and for each, make the table entries */ /* Generate the Huffman codes and for each, make the table entries */
......
此差异已折叠。
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.13-rc3 # Linux kernel version: 2.6.13-rc6
# Wed Jul 13 14:40:34 2005 # Mon Aug 8 14:16:59 2005
# #
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
...@@ -267,8 +267,6 @@ CONFIG_NET_CLS_ROUTE=y ...@@ -267,8 +267,6 @@ CONFIG_NET_CLS_ROUTE=y
# Network testing # Network testing
# #
# CONFIG_NET_PKTGEN is not set # CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set # CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
# CONFIG_BT is not set # CONFIG_BT is not set
...@@ -468,6 +466,7 @@ CONFIG_SCSI_QLA2XXX=y ...@@ -468,6 +466,7 @@ CONFIG_SCSI_QLA2XXX=y
# CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2300 is not set
# CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA2322 is not set
# CONFIG_SCSI_QLA6312 is not set # CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA24XX is not set
# CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
...@@ -539,11 +538,9 @@ CONFIG_IEEE1394_RAWIO=y ...@@ -539,11 +538,9 @@ CONFIG_IEEE1394_RAWIO=y
# #
# Macintosh device drivers # Macintosh device drivers
# #
CONFIG_ADB=y
CONFIG_ADB_PMU=y CONFIG_ADB_PMU=y
CONFIG_PMAC_SMU=y CONFIG_PMAC_SMU=y
# CONFIG_PMAC_BACKLIGHT is not set # CONFIG_PMAC_BACKLIGHT is not set
# CONFIG_INPUT_ADBHID is not set
CONFIG_THERM_PM72=y CONFIG_THERM_PM72=y
# #
...@@ -631,6 +628,8 @@ CONFIG_PPPOE=m ...@@ -631,6 +628,8 @@ CONFIG_PPPOE=m
# CONFIG_NET_FC is not set # CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set # CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# #
# ISDN subsystem # ISDN subsystem
...@@ -718,7 +717,6 @@ CONFIG_LEGACY_PTY_COUNT=256 ...@@ -718,7 +717,6 @@ CONFIG_LEGACY_PTY_COUNT=256
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set # CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set # CONFIG_APPLICOM is not set
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.13-rc3 # Linux kernel version: 2.6.13-rc6
# Wed Jul 13 14:43:39 2005 # Mon Aug 8 14:17:02 2005
# #
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
...@@ -257,10 +257,6 @@ CONFIG_NET_CLS_ROUTE=y ...@@ -257,10 +257,6 @@ CONFIG_NET_CLS_ROUTE=y
# Network testing # Network testing
# #
# CONFIG_NET_PKTGEN is not set # CONFIG_NET_PKTGEN is not set
CONFIG_NETPOLL=y
CONFIG_NETPOLL_RX=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
# CONFIG_HAMRADIO is not set # CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
# CONFIG_BT is not set # CONFIG_BT is not set
...@@ -388,6 +384,7 @@ CONFIG_SCSI_QLA2XXX=y ...@@ -388,6 +384,7 @@ CONFIG_SCSI_QLA2XXX=y
# CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2300 is not set
# CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA2322 is not set
# CONFIG_SCSI_QLA6312 is not set # CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA24XX is not set
# CONFIG_SCSI_LPFC is not set # CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
...@@ -537,6 +534,10 @@ CONFIG_PPPOE=m ...@@ -537,6 +534,10 @@ CONFIG_PPPOE=m
# CONFIG_NET_FC is not set # CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
CONFIG_NETCONSOLE=y CONFIG_NETCONSOLE=y
CONFIG_NETPOLL=y
CONFIG_NETPOLL_RX=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
# #
# ISDN subsystem # ISDN subsystem
...@@ -610,7 +611,6 @@ CONFIG_LEGACY_PTY_COUNT=256 ...@@ -610,7 +611,6 @@ CONFIG_LEGACY_PTY_COUNT=256
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set # CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set # CONFIG_APPLICOM is not set
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.13-rc3 # Linux kernel version: 2.6.13-rc6
# Wed Jul 13 14:46:18 2005 # Mon Aug 8 14:17:04 2005
# #
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
...@@ -193,8 +193,6 @@ CONFIG_TCP_CONG_BIC=y ...@@ -193,8 +193,6 @@ CONFIG_TCP_CONG_BIC=y
# Network testing # Network testing
# #
# CONFIG_NET_PKTGEN is not set # CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set # CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
# CONFIG_BT is not set # CONFIG_BT is not set
...@@ -433,6 +431,8 @@ CONFIG_E1000=y ...@@ -433,6 +431,8 @@ CONFIG_E1000=y
# CONFIG_SLIP is not set # CONFIG_SLIP is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set # CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# #
# ISDN subsystem # ISDN subsystem
...@@ -512,7 +512,6 @@ CONFIG_LEGACY_PTY_COUNT=256 ...@@ -512,7 +512,6 @@ CONFIG_LEGACY_PTY_COUNT=256
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set # CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set # CONFIG_APPLICOM is not set
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.13-rc3 # Linux kernel version: 2.6.13-rc6
# Wed Jul 13 14:47:54 2005 # Mon Aug 8 14:17:07 2005
# #
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
...@@ -287,10 +287,6 @@ CONFIG_NET_CLS_ROUTE=y ...@@ -287,10 +287,6 @@ CONFIG_NET_CLS_ROUTE=y
# Network testing # Network testing
# #
# CONFIG_NET_PKTGEN is not set # CONFIG_NET_PKTGEN is not set
CONFIG_NETPOLL=y
CONFIG_NETPOLL_RX=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
# CONFIG_HAMRADIO is not set # CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
# CONFIG_BT is not set # CONFIG_BT is not set
...@@ -488,6 +484,7 @@ CONFIG_SCSI_QLA22XX=m ...@@ -488,6 +484,7 @@ CONFIG_SCSI_QLA22XX=m
CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2300=m
CONFIG_SCSI_QLA2322=m CONFIG_SCSI_QLA2322=m
CONFIG_SCSI_QLA6312=m CONFIG_SCSI_QLA6312=m
CONFIG_SCSI_QLA24XX=m
CONFIG_SCSI_LPFC=m CONFIG_SCSI_LPFC=m
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
...@@ -645,6 +642,10 @@ CONFIG_PPPOE=m ...@@ -645,6 +642,10 @@ CONFIG_PPPOE=m
# CONFIG_NET_FC is not set # CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
CONFIG_NETCONSOLE=y CONFIG_NETCONSOLE=y
CONFIG_NETPOLL=y
CONFIG_NETPOLL_RX=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
# #
# ISDN subsystem # ISDN subsystem
...@@ -746,7 +747,6 @@ CONFIG_HVCS=m ...@@ -746,7 +747,6 @@ CONFIG_HVCS=m
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set # CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set # CONFIG_APPLICOM is not set
......
# #
# Automatically generated make config: don't edit # Automatically generated make config: don't edit
# Linux kernel version: 2.6.13-rc3 # Linux kernel version: 2.6.13-rc6
# Wed Jul 13 14:37:07 2005 # Mon Aug 8 14:16:54 2005
# #
CONFIG_64BIT=y CONFIG_64BIT=y
CONFIG_MMU=y CONFIG_MMU=y
...@@ -289,10 +289,6 @@ CONFIG_NET_CLS_ROUTE=y ...@@ -289,10 +289,6 @@ CONFIG_NET_CLS_ROUTE=y
# Network testing # Network testing
# #
# CONFIG_NET_PKTGEN is not set # CONFIG_NET_PKTGEN is not set
CONFIG_NETPOLL=y
CONFIG_NETPOLL_RX=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
# CONFIG_HAMRADIO is not set # CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set # CONFIG_IRDA is not set
# CONFIG_BT is not set # CONFIG_BT is not set
...@@ -506,6 +502,7 @@ CONFIG_SCSI_QLA22XX=m ...@@ -506,6 +502,7 @@ CONFIG_SCSI_QLA22XX=m
CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2300=m
CONFIG_SCSI_QLA2322=m CONFIG_SCSI_QLA2322=m
CONFIG_SCSI_QLA6312=m CONFIG_SCSI_QLA6312=m
CONFIG_SCSI_QLA24XX=m
CONFIG_SCSI_LPFC=m CONFIG_SCSI_LPFC=m
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
...@@ -579,11 +576,9 @@ CONFIG_IEEE1394_AMDTP=m ...@@ -579,11 +576,9 @@ CONFIG_IEEE1394_AMDTP=m
# #
# Macintosh device drivers # Macintosh device drivers
# #
CONFIG_ADB=y
CONFIG_ADB_PMU=y CONFIG_ADB_PMU=y
CONFIG_PMAC_SMU=y CONFIG_PMAC_SMU=y
# CONFIG_PMAC_BACKLIGHT is not set # CONFIG_PMAC_BACKLIGHT is not set
# CONFIG_INPUT_ADBHID is not set
CONFIG_THERM_PM72=y CONFIG_THERM_PM72=y
# #
...@@ -694,6 +689,10 @@ CONFIG_PPPOE=m ...@@ -694,6 +689,10 @@ CONFIG_PPPOE=m
# CONFIG_NET_FC is not set # CONFIG_NET_FC is not set
# CONFIG_SHAPER is not set # CONFIG_SHAPER is not set
CONFIG_NETCONSOLE=y CONFIG_NETCONSOLE=y
CONFIG_NETPOLL=y
CONFIG_NETPOLL_RX=y
CONFIG_NETPOLL_TRAP=y
CONFIG_NET_POLL_CONTROLLER=y
# #
# ISDN subsystem # ISDN subsystem
...@@ -797,7 +796,6 @@ CONFIG_HVCS=m ...@@ -797,7 +796,6 @@ CONFIG_HVCS=m
# #
# CONFIG_WATCHDOG is not set # CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set # CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set # CONFIG_DTLK is not set
# CONFIG_R3964 is not set # CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set # CONFIG_APPLICOM is not set
......
...@@ -108,8 +108,28 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region ...@@ -108,8 +108,28 @@ void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region
region->end = res->end - offset; region->end = res->end - offset;
} }
void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
struct pci_bus_region *region)
{
unsigned long offset = 0;
struct pci_controller *hose = pci_bus_to_host(dev->bus);
if (!hose)
return;
if (res->flags & IORESOURCE_IO)
offset = (unsigned long)hose->io_base_virt - pci_io_base;
if (res->flags & IORESOURCE_MEM)
offset = hose->pci_mem_offset;
res->start = region->start + offset;
res->end = region->end + offset;
}
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pcibios_resource_to_bus); EXPORT_SYMBOL(pcibios_resource_to_bus);
EXPORT_SYMBOL(pcibios_bus_to_resource);
#endif #endif
/* /*
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/net.h> #include <linux/net.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <net/compat.h> #include <net/compat.h>
#include <net/sock.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/string.h> #include <asm/string.h>
...@@ -297,121 +298,165 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi ...@@ -297,121 +298,165 @@ asmlinkage int solaris_sendmsg(int fd, struct sol_nmsghdr __user *user_msg, unsi
{ {
struct socket *sock; struct socket *sock;
char address[MAX_SOCK_ADDR]; char address[MAX_SOCK_ADDR];
struct iovec iov[UIO_FASTIOV]; struct iovec iovstack[UIO_FASTIOV], *iov = iovstack;
unsigned char ctl[sizeof(struct cmsghdr) + 20]; unsigned char ctl[sizeof(struct cmsghdr) + 20];
unsigned char *ctl_buf = ctl; unsigned char *ctl_buf = ctl;
struct msghdr kern_msg; struct msghdr msg_sys;
int err, total_len; int err, ctl_len, iov_size, total_len;
if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) err = -EFAULT;
return -EFAULT; if (msghdr_from_user32_to_kern(&msg_sys, user_msg))
if(kern_msg.msg_iovlen > UIO_MAXIOV) goto out;
return -EINVAL;
err = verify_compat_iovec(&kern_msg, iov, address, VERIFY_READ); sock = sockfd_lookup(fd, &err);
if (err < 0) if (!sock)
goto out; goto out;
/* do not move before msg_sys is valid */
err = -EMSGSIZE;
if (msg_sys.msg_iovlen > UIO_MAXIOV)
goto out_put;
/* Check whether to allocate the iovec area*/
err = -ENOMEM;
iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
if (msg_sys.msg_iovlen > UIO_FASTIOV) {
iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
if (!iov)
goto out_put;
}
err = verify_compat_iovec(&msg_sys, iov, address, VERIFY_READ);
if (err < 0)
goto out_freeiov;
total_len = err; total_len = err;
if(kern_msg.msg_controllen) { err = -ENOBUFS;
struct sol_cmsghdr __user *ucmsg = kern_msg.msg_control; if (msg_sys.msg_controllen > INT_MAX)
goto out_freeiov;
ctl_len = msg_sys.msg_controllen;
if (ctl_len) {
struct sol_cmsghdr __user *ucmsg = msg_sys.msg_control;
unsigned long *kcmsg; unsigned long *kcmsg;
compat_size_t cmlen; compat_size_t cmlen;
if (kern_msg.msg_controllen <= sizeof(compat_size_t)) err = -EINVAL;
return -EINVAL; if (ctl_len <= sizeof(compat_size_t))
goto out_freeiov;
if(kern_msg.msg_controllen > sizeof(ctl)) { if (ctl_len > sizeof(ctl)) {
err = -ENOBUFS; err = -ENOBUFS;
ctl_buf = kmalloc(kern_msg.msg_controllen, GFP_KERNEL); ctl_buf = kmalloc(ctl_len, GFP_KERNEL);
if(!ctl_buf) if (!ctl_buf)
goto out_freeiov; goto out_freeiov;
} }
__get_user(cmlen, &ucmsg->cmsg_len); __get_user(cmlen, &ucmsg->cmsg_len);
kcmsg = (unsigned long *) ctl_buf; kcmsg = (unsigned long *) ctl_buf;
*kcmsg++ = (unsigned long)cmlen; *kcmsg++ = (unsigned long)cmlen;
err = -EFAULT; err = -EFAULT;
if(copy_from_user(kcmsg, &ucmsg->cmsg_level, if (copy_from_user(kcmsg, &ucmsg->cmsg_level,
kern_msg.msg_controllen - sizeof(compat_size_t))) ctl_len - sizeof(compat_size_t)))
goto out_freectl; goto out_freectl;
kern_msg.msg_control = ctl_buf; msg_sys.msg_control = ctl_buf;
} }
kern_msg.msg_flags = solaris_to_linux_msgflags(user_flags); msg_sys.msg_flags = solaris_to_linux_msgflags(user_flags);
lock_kernel(); if (sock->file->f_flags & O_NONBLOCK)
sock = sockfd_lookup(fd, &err); msg_sys.msg_flags |= MSG_DONTWAIT;
if (sock != NULL) { err = sock_sendmsg(sock, &msg_sys, total_len);
if (sock->file->f_flags & O_NONBLOCK)
kern_msg.msg_flags |= MSG_DONTWAIT;
err = sock_sendmsg(sock, &kern_msg, total_len);
sockfd_put(sock);
}
unlock_kernel();
out_freectl: out_freectl:
/* N.B. Use kfree here, as kern_msg.msg_controllen might change? */ if (ctl_buf != ctl)
if(ctl_buf != ctl) sock_kfree_s(sock->sk, ctl_buf, ctl_len);
kfree(ctl_buf);
out_freeiov: out_freeiov:
if(kern_msg.msg_iov != iov) if (iov != iovstack)
kfree(kern_msg.msg_iov); sock_kfree_s(sock->sk, iov, iov_size);
out: out_put:
sockfd_put(sock);
out:
return err; return err;
} }
asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags) asmlinkage int solaris_recvmsg(int fd, struct sol_nmsghdr __user *user_msg, unsigned int user_flags)
{ {
struct iovec iovstack[UIO_FASTIOV];
struct msghdr kern_msg;
char addr[MAX_SOCK_ADDR];
struct socket *sock; struct socket *sock;
struct iovec iovstack[UIO_FASTIOV];
struct iovec *iov = iovstack; struct iovec *iov = iovstack;
struct msghdr msg_sys;
unsigned long cmsg_ptr;
int err, iov_size, total_len, len;
/* kernel mode address */
char addr[MAX_SOCK_ADDR];
/* user mode address pointers */
struct sockaddr __user *uaddr; struct sockaddr __user *uaddr;
int __user *uaddr_len; int __user *uaddr_len;
unsigned long cmsg_ptr;
int err, total_len, len = 0;
if(msghdr_from_user32_to_kern(&kern_msg, user_msg)) if (msghdr_from_user32_to_kern(&msg_sys, user_msg))
return -EFAULT; return -EFAULT;
if(kern_msg.msg_iovlen > UIO_MAXIOV)
return -EINVAL;
uaddr = kern_msg.msg_name; sock = sockfd_lookup(fd, &err);
if (!sock)
goto out;
err = -EMSGSIZE;
if (msg_sys.msg_iovlen > UIO_MAXIOV)
goto out_put;
/* Check whether to allocate the iovec area*/
err = -ENOMEM;
iov_size = msg_sys.msg_iovlen * sizeof(struct iovec);
if (msg_sys.msg_iovlen > UIO_FASTIOV) {
iov = sock_kmalloc(sock->sk, iov_size, GFP_KERNEL);
if (!iov)
goto out_put;
}
/*
* Save the user-mode address (verify_iovec will change the
* kernel msghdr to use the kernel address space)
*/
uaddr = (void __user *) msg_sys.msg_name;
uaddr_len = &user_msg->msg_namelen; uaddr_len = &user_msg->msg_namelen;
err = verify_compat_iovec(&kern_msg, iov, addr, VERIFY_WRITE); err = verify_compat_iovec(&msg_sys, iov, addr, VERIFY_WRITE);
if (err < 0) if (err < 0)
goto out; goto out_freeiov;
total_len = err; total_len = err;
cmsg_ptr = (unsigned long) kern_msg.msg_control; cmsg_ptr = (unsigned long) msg_sys.msg_control;
kern_msg.msg_flags = 0; msg_sys.msg_flags = MSG_CMSG_COMPAT;
lock_kernel(); if (sock->file->f_flags & O_NONBLOCK)
sock = sockfd_lookup(fd, &err); user_flags |= MSG_DONTWAIT;
if (sock != NULL) {
if (sock->file->f_flags & O_NONBLOCK) err = sock_recvmsg(sock, &msg_sys, total_len, user_flags);
user_flags |= MSG_DONTWAIT; if(err < 0)
err = sock_recvmsg(sock, &kern_msg, total_len, user_flags); goto out_freeiov;
if(err >= 0)
len = err; len = err;
sockfd_put(sock);
} if (uaddr != NULL) {
unlock_kernel(); err = move_addr_to_user(addr, msg_sys.msg_namelen, uaddr, uaddr_len);
if (err < 0)
if(uaddr != NULL && err >= 0) goto out_freeiov;
err = move_addr_to_user(addr, kern_msg.msg_namelen, uaddr, uaddr_len);
if(err >= 0) {
err = __put_user(linux_to_solaris_msgflags(kern_msg.msg_flags), &user_msg->msg_flags);
if(!err) {
/* XXX Convert cmsg back into userspace 32-bit format... */
err = __put_user((unsigned long)kern_msg.msg_control - cmsg_ptr,
&user_msg->msg_controllen);
}
} }
err = __put_user(linux_to_solaris_msgflags(msg_sys.msg_flags), &user_msg->msg_flags);
if (err)
goto out_freeiov;
err = __put_user((unsigned long)msg_sys.msg_control - cmsg_ptr,
&user_msg->msg_controllen);
if (err)
goto out_freeiov;
err = len;
if(kern_msg.msg_iov != iov) out_freeiov:
kfree(kern_msg.msg_iov); if (iov != iovstack)
sock_kfree_s(sock->sk, iov, iov_size);
out_put:
sockfd_put(sock);
out: out:
if(err < 0) return err;
return err;
return len;
} }
...@@ -322,3 +322,4 @@ module_exit(aes_fini); ...@@ -322,3 +322,4 @@ module_exit(aes_fini);
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("aes");
...@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val) ...@@ -43,11 +43,11 @@ static int putreg32(struct task_struct *child, unsigned regno, u32 val)
switch (regno) { switch (regno) {
case offsetof(struct user32, regs.fs): case offsetof(struct user32, regs.fs):
if (val && (val & 3) != 3) return -EIO; if (val && (val & 3) != 3) return -EIO;
child->thread.fs = val & 0xffff; child->thread.fsindex = val & 0xffff;
break; break;
case offsetof(struct user32, regs.gs): case offsetof(struct user32, regs.gs):
if (val && (val & 3) != 3) return -EIO; if (val && (val & 3) != 3) return -EIO;
child->thread.gs = val & 0xffff; child->thread.gsindex = val & 0xffff;
break; break;
case offsetof(struct user32, regs.ds): case offsetof(struct user32, regs.ds):
if (val && (val & 3) != 3) return -EIO; if (val && (val & 3) != 3) return -EIO;
...@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val) ...@@ -138,10 +138,10 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val)
switch (regno) { switch (regno) {
case offsetof(struct user32, regs.fs): case offsetof(struct user32, regs.fs):
*val = child->thread.fs; *val = child->thread.fsindex;
break; break;
case offsetof(struct user32, regs.gs): case offsetof(struct user32, regs.gs):
*val = child->thread.gs; *val = child->thread.gsindex;
break; break;
case offsetof(struct user32, regs.ds): case offsetof(struct user32, regs.ds):
*val = child->thread.ds; *val = child->thread.ds;
......
...@@ -36,6 +36,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL }; ...@@ -36,6 +36,7 @@ static unsigned long bank[NR_BANKS] = { [0 ... NR_BANKS-1] = ~0UL };
static unsigned long console_logged; static unsigned long console_logged;
static int notify_user; static int notify_user;
static int rip_msr; static int rip_msr;
static int mce_bootlog;
/* /*
* Lockless MCE logging infrastructure. * Lockless MCE logging infrastructure.
...@@ -197,10 +198,11 @@ void do_machine_check(struct pt_regs * regs, long error_code) ...@@ -197,10 +198,11 @@ void do_machine_check(struct pt_regs * regs, long error_code)
rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr); rdmsrl(MSR_IA32_MC0_ADDR + i*4, m.addr);
mce_get_rip(&m, regs); mce_get_rip(&m, regs);
if (error_code != -1) if (error_code >= 0)
rdtscll(m.tsc); rdtscll(m.tsc);
wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0); wrmsrl(MSR_IA32_MC0_STATUS + i*4, 0);
mce_log(&m); if (error_code != -2)
mce_log(&m);
/* Did this bank cause the exception? */ /* Did this bank cause the exception? */
/* Assume that the bank with uncorrectable errors did it, /* Assume that the bank with uncorrectable errors did it,
...@@ -315,7 +317,7 @@ static void mce_init(void *dummy) ...@@ -315,7 +317,7 @@ static void mce_init(void *dummy)
/* Log the machine checks left over from the previous reset. /* Log the machine checks left over from the previous reset.
This also clears all registers */ This also clears all registers */
do_machine_check(NULL, -1); do_machine_check(NULL, mce_bootlog ? -1 : -2);
set_in_cr4(X86_CR4_MCE); set_in_cr4(X86_CR4_MCE);
...@@ -476,11 +478,17 @@ static int __init mcheck_disable(char *str) ...@@ -476,11 +478,17 @@ static int __init mcheck_disable(char *str)
} }
/* mce=off disables machine check. Note you can reenable it later /* mce=off disables machine check. Note you can reenable it later
using sysfs */ using sysfs.
mce=bootlog Log MCEs from before booting. Disabled by default to work
around buggy BIOS that leave bogus MCEs. */
static int __init mcheck_enable(char *str) static int __init mcheck_enable(char *str)
{ {
if (*str == '=')
str++;
if (!strcmp(str, "off")) if (!strcmp(str, "off"))
mce_dont_init = 1; mce_dont_init = 1;
else if (!strcmp(str, "bootlog"))
mce_bootlog = 1;
else else
printk("mce= argument %s ignored. Please use /sys", str); printk("mce= argument %s ignored. Please use /sys", str);
return 0; return 0;
......
...@@ -645,15 +645,15 @@ void __init setup_arch(char **cmdline_p) ...@@ -645,15 +645,15 @@ void __init setup_arch(char **cmdline_p)
} }
} }
#endif #endif
sparse_init();
#ifdef CONFIG_KEXEC #ifdef CONFIG_KEXEC
if (crashk_res.start != crashk_res.end) { if (crashk_res.start != crashk_res.end) {
reserve_bootmem(crashk_res.start, reserve_bootmem(crashk_res.start,
crashk_res.end - crashk_res.start + 1); crashk_res.end - crashk_res.start + 1);
} }
#endif #endif
sparse_init();
paging_init(); paging_init();
check_ioapic(); check_ioapic();
......
...@@ -1283,8 +1283,7 @@ static void do_fd_request(request_queue_t* q) ...@@ -1283,8 +1283,7 @@ static void do_fd_request(request_queue_t* q)
if (fdc_busy) return; if (fdc_busy) return;
save_flags(flags); save_flags(flags);
cli(); cli();
while (fdc_busy) wait_event(fdc_wait, !fdc_busy);
sleep_on(&fdc_wait);
fdc_busy = 1; fdc_busy = 1;
ENABLE_IRQ(); ENABLE_IRQ();
restore_flags(flags); restore_flags(flags);
......
...@@ -719,7 +719,7 @@ struct request *blk_queue_find_tag(request_queue_t *q, int tag) ...@@ -719,7 +719,7 @@ struct request *blk_queue_find_tag(request_queue_t *q, int tag)
{ {
struct blk_queue_tag *bqt = q->queue_tags; struct blk_queue_tag *bqt = q->queue_tags;
if (unlikely(bqt == NULL || tag >= bqt->max_depth)) if (unlikely(bqt == NULL || tag >= bqt->real_max_depth))
return NULL; return NULL;
return bqt->tag_index[tag]; return bqt->tag_index[tag];
...@@ -798,6 +798,7 @@ init_tag_map(request_queue_t *q, struct blk_queue_tag *tags, int depth) ...@@ -798,6 +798,7 @@ init_tag_map(request_queue_t *q, struct blk_queue_tag *tags, int depth)
memset(tag_index, 0, depth * sizeof(struct request *)); memset(tag_index, 0, depth * sizeof(struct request *));
memset(tag_map, 0, nr_ulongs * sizeof(unsigned long)); memset(tag_map, 0, nr_ulongs * sizeof(unsigned long));
tags->real_max_depth = depth;
tags->max_depth = depth; tags->max_depth = depth;
tags->tag_index = tag_index; tags->tag_index = tag_index;
tags->tag_map = tag_map; tags->tag_map = tag_map;
...@@ -871,12 +872,23 @@ int blk_queue_resize_tags(request_queue_t *q, int new_depth) ...@@ -871,12 +872,23 @@ int blk_queue_resize_tags(request_queue_t *q, int new_depth)
if (!bqt) if (!bqt)
return -ENXIO; return -ENXIO;
/*
* if we already have large enough real_max_depth. just
* adjust max_depth. *NOTE* as requests with tag value
* between new_depth and real_max_depth can be in-flight, tag
* map can not be shrunk blindly here.
*/
if (new_depth <= bqt->real_max_depth) {
bqt->max_depth = new_depth;
return 0;
}
/* /*
* save the old state info, so we can copy it back * save the old state info, so we can copy it back
*/ */
tag_index = bqt->tag_index; tag_index = bqt->tag_index;
tag_map = bqt->tag_map; tag_map = bqt->tag_map;
max_depth = bqt->max_depth; max_depth = bqt->real_max_depth;
if (init_tag_map(q, bqt, new_depth)) if (init_tag_map(q, bqt, new_depth))
return -ENOMEM; return -ENOMEM;
...@@ -913,7 +925,7 @@ void blk_queue_end_tag(request_queue_t *q, struct request *rq) ...@@ -913,7 +925,7 @@ void blk_queue_end_tag(request_queue_t *q, struct request *rq)
BUG_ON(tag == -1); BUG_ON(tag == -1);
if (unlikely(tag >= bqt->max_depth)) if (unlikely(tag >= bqt->real_max_depth))
/* /*
* This can happen after tag depth has been reduced. * This can happen after tag depth has been reduced.
* FIXME: how about a warning or info message here? * FIXME: how about a warning or info message here?
......
...@@ -367,11 +367,8 @@ static inline void bpa10x_free_urb(struct urb *urb) ...@@ -367,11 +367,8 @@ static inline void bpa10x_free_urb(struct urb *urb)
if (!urb) if (!urb)
return; return;
if (urb->setup_packet) kfree(urb->setup_packet);
kfree(urb->setup_packet); kfree(urb->transfer_buffer);
if (urb->transfer_buffer)
kfree(urb->transfer_buffer);
usb_free_urb(urb); usb_free_urb(urb);
} }
......
...@@ -58,8 +58,6 @@ ...@@ -58,8 +58,6 @@
#ifndef CONFIG_BT_HCIUART_DEBUG #ifndef CONFIG_BT_HCIUART_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP
#define BT_DMP( A... )
#endif #endif
static int hciextn = 1; static int hciextn = 1;
......
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
#ifndef CONFIG_BT_HCIUART_DEBUG #ifndef CONFIG_BT_HCIUART_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP
#define BT_DMP( A... )
#endif #endif
/* Initialize protocol */ /* Initialize protocol */
...@@ -125,7 +123,6 @@ static inline int h4_check_data_len(struct h4_struct *h4, int len) ...@@ -125,7 +123,6 @@ static inline int h4_check_data_len(struct h4_struct *h4, int len)
BT_DBG("len %d room %d", len, room); BT_DBG("len %d room %d", len, room);
if (!len) { if (!len) {
BT_DMP(h4->rx_skb->data, h4->rx_skb->len);
hci_recv_frame(h4->rx_skb); hci_recv_frame(h4->rx_skb);
} else if (len > room) { } else if (len > room) {
BT_ERR("Data length is too large"); BT_ERR("Data length is too large");
...@@ -169,8 +166,6 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) ...@@ -169,8 +166,6 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
case H4_W4_DATA: case H4_W4_DATA:
BT_DBG("Complete data"); BT_DBG("Complete data");
BT_DMP(h4->rx_skb->data, h4->rx_skb->len);
hci_recv_frame(h4->rx_skb); hci_recv_frame(h4->rx_skb);
h4->rx_state = H4_W4_PACKET_TYPE; h4->rx_state = H4_W4_PACKET_TYPE;
......
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
#ifndef CONFIG_BT_HCIUART_DEBUG #ifndef CONFIG_BT_HCIUART_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP
#define BT_DMP( A... )
#endif #endif
static int reset = 0; static int reset = 0;
......
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
#ifndef CONFIG_BT_HCIUSB_DEBUG #ifndef CONFIG_BT_HCIUSB_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG(D...) #define BT_DBG(D...)
#undef BT_DMP
#define BT_DMP(D...)
#endif #endif
#ifndef CONFIG_BT_HCIUSB_ZERO_PACKET #ifndef CONFIG_BT_HCIUSB_ZERO_PACKET
...@@ -110,6 +108,9 @@ static struct usb_device_id blacklist_ids[] = { ...@@ -110,6 +108,9 @@ static struct usb_device_id blacklist_ids[] = {
/* Microsoft Wireless Transceiver for Bluetooth 2.0 */ /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
{ USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
/* Kensington Bluetooth USB adapter */
{ USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET },
/* ISSC Bluetooth Adapter v3.1 */ /* ISSC Bluetooth Adapter v3.1 */
{ USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET }, { USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
...@@ -387,10 +388,8 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb) ...@@ -387,10 +388,8 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
urb = &_urb->urb; urb = &_urb->urb;
BT_DBG("%s freeing _urb %p type %d urb %p", BT_DBG("%s freeing _urb %p type %d urb %p",
husb->hdev->name, _urb, _urb->type, urb); husb->hdev->name, _urb, _urb->type, urb);
if (urb->setup_packet) kfree(urb->setup_packet);
kfree(urb->setup_packet); kfree(urb->transfer_buffer);
if (urb->transfer_buffer)
kfree(urb->transfer_buffer);
_urb_free(_urb); _urb_free(_urb);
} }
......
...@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file) ...@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file)
void rtc_get_rtc_time(struct rtc_time *rtc_tm) void rtc_get_rtc_time(struct rtc_time *rtc_tm)
{ {
unsigned long uip_watchdog = jiffies;
unsigned char ctrl; unsigned char ctrl;
#ifdef CONFIG_MACH_DECSTATION #ifdef CONFIG_MACH_DECSTATION
unsigned int real_year; unsigned int real_year;
...@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) ...@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
* Once the read clears, read the RTC time (again via ioctl). Easy. * Once the read clears, read the RTC time (again via ioctl). Easy.
*/ */
if (rtc_is_updating() != 0) while (rtc_is_updating() != 0 && jiffies - uip_watchdog < 2*HZ/100) {
msleep(20); barrier();
cpu_relax();
}
/* /*
* Only the values that we read from the RTC are set. We leave * Only the values that we read from the RTC are set. We leave
......
...@@ -17,6 +17,8 @@ config TCG_TPM ...@@ -17,6 +17,8 @@ config TCG_TPM
obtained at: <http://sourceforge.net/projects/trousers>. To obtained at: <http://sourceforge.net/projects/trousers>. To
compile this driver as a module, choose M here; the module compile this driver as a module, choose M here; the module
will be called tpm. If unsure, say N. will be called tpm. If unsure, say N.
Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI_BUS
and CONFIG_PNPACPI.
config TCG_NSC config TCG_NSC
tristate "National Semiconductor TPM Interface" tristate "National Semiconductor TPM Interface"
...@@ -36,12 +38,13 @@ config TCG_ATMEL ...@@ -36,12 +38,13 @@ config TCG_ATMEL
as a module, choose M here; the module will be called tpm_atmel. as a module, choose M here; the module will be called tpm_atmel.
config TCG_INFINEON config TCG_INFINEON
tristate "Infineon Technologies SLD 9630 TPM Interface" tristate "Infineon Technologies TPM Interface"
depends on TCG_TPM depends on TCG_TPM && PNPACPI
---help--- ---help---
If you have a TPM security chip from Infineon Technologies If you have a TPM security chip from Infineon Technologies
say Yes and it will be accessible from within Linux. To (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it
compile this driver as a module, choose M here; the module will be accessible from within Linux.
To compile this driver as a module, choose M here; the module
will be called tpm_infineon. will be called tpm_infineon.
Further information on this driver and the supported hardware Further information on this driver and the supported hardware
can be found at http://www.prosec.rub.de/tpm can be found at http://www.prosec.rub.de/tpm
......
/* /*
* Description: * Description:
* Device Driver for the Infineon Technologies * Device Driver for the Infineon Technologies
* SLD 9630 TT Trusted Platform Module * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module
* Specifications at www.trustedcomputinggroup.org * Specifications at www.trustedcomputinggroup.org
* *
* Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de>
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2 of the * published by the Free Software Foundation, version 2 of the
* License. * License.
*
*/ */
#include <acpi/acpi_bus.h>
#include <linux/pnp.h>
#include "tpm.h" #include "tpm.h"
/* Infineon specific definitions */ /* Infineon specific definitions */
...@@ -26,8 +27,11 @@ ...@@ -26,8 +27,11 @@
#define TPM_MSLEEP_TIME 3 #define TPM_MSLEEP_TIME 3
/* gives number of max. msleep()-calls before throwing timeout */ /* gives number of max. msleep()-calls before throwing timeout */
#define TPM_MAX_TRIES 5000 #define TPM_MAX_TRIES 5000
#define TCPA_INFINEON_DEV_VEN_VALUE 0x15D1 #define TPM_INFINEON_DEV_VEN_VALUE 0x15D1
#define TPM_DATA (TPM_ADDR + 1) & 0xff
/* These values will be filled after ACPI-call */
static int TPM_INF_DATA = 0;
static int TPM_INF_ADDR = 0;
/* TPM header definitions */ /* TPM header definitions */
enum infineon_tpm_header { enum infineon_tpm_header {
...@@ -305,9 +309,10 @@ static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count) ...@@ -305,9 +309,10 @@ static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count)
static void tpm_inf_cancel(struct tpm_chip *chip) static void tpm_inf_cancel(struct tpm_chip *chip)
{ {
/* Nothing yet! /*
This has something to do with the internal functions Since we are using the legacy mode to communicate
of the TPM. Abort isn't really necessary... with the TPM, we have no cancel functions, but have
a workaround for interrupting the TPM through WTX.
*/ */
} }
...@@ -345,6 +350,32 @@ static struct tpm_vendor_specific tpm_inf = { ...@@ -345,6 +350,32 @@ static struct tpm_vendor_specific tpm_inf = {
.miscdev = {.fops = &inf_ops,}, .miscdev = {.fops = &inf_ops,},
}; };
static const struct pnp_device_id tpm_pnp_tbl[] = {
/* Infineon TPMs */
{"IFX0101", 0},
{"IFX0102", 0},
{"", 0}
};
static int __devinit tpm_inf_acpi_probe(struct pnp_dev *dev,
const struct pnp_device_id *dev_id)
{
TPM_INF_ADDR = (pnp_port_start(dev, 0) & 0xff);
TPM_INF_DATA = ((TPM_INF_ADDR + 1) & 0xff);
tpm_inf.base = pnp_port_start(dev, 1);
dev_info(&dev->dev, "Found %s with ID %s\n",
dev->name, dev_id->id);
if (!((tpm_inf.base >> 8) & 0xff))
tpm_inf.base = 0;
return 0;
}
static struct pnp_driver tpm_inf_pnp = {
.name = "tpm_inf_pnp",
.id_table = tpm_pnp_tbl,
.probe = tpm_inf_acpi_probe,
};
static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, static int __devinit tpm_inf_probe(struct pci_dev *pci_dev,
const struct pci_device_id *pci_id) const struct pci_device_id *pci_id)
{ {
...@@ -353,64 +384,99 @@ static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, ...@@ -353,64 +384,99 @@ static int __devinit tpm_inf_probe(struct pci_dev *pci_dev,
int vendorid[2]; int vendorid[2];
int version[2]; int version[2];
int productid[2]; int productid[2];
char chipname[20];
if (pci_enable_device(pci_dev)) if (pci_enable_device(pci_dev))
return -EIO; return -EIO;
dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device);
/* read IO-ports from ACPI */
pnp_register_driver(&tpm_inf_pnp);
pnp_unregister_driver(&tpm_inf_pnp);
/* Make sure, we have received valid config ports */
if (!TPM_INF_ADDR) {
pci_disable_device(pci_dev);
return -EIO;
}
/* query chip for its vendor, its version number a.s.o. */ /* query chip for its vendor, its version number a.s.o. */
outb(ENABLE_REGISTER_PAIR, TPM_ADDR); outb(ENABLE_REGISTER_PAIR, TPM_INF_ADDR);
outb(IDVENL, TPM_ADDR); outb(IDVENL, TPM_INF_ADDR);
vendorid[1] = inb(TPM_DATA); vendorid[1] = inb(TPM_INF_DATA);
outb(IDVENH, TPM_ADDR); outb(IDVENH, TPM_INF_ADDR);
vendorid[0] = inb(TPM_DATA); vendorid[0] = inb(TPM_INF_DATA);
outb(IDPDL, TPM_ADDR); outb(IDPDL, TPM_INF_ADDR);
productid[1] = inb(TPM_DATA); productid[1] = inb(TPM_INF_DATA);
outb(IDPDH, TPM_ADDR); outb(IDPDH, TPM_INF_ADDR);
productid[0] = inb(TPM_DATA); productid[0] = inb(TPM_INF_DATA);
outb(CHIP_ID1, TPM_ADDR); outb(CHIP_ID1, TPM_INF_ADDR);
version[1] = inb(TPM_DATA); version[1] = inb(TPM_INF_DATA);
outb(CHIP_ID2, TPM_ADDR); outb(CHIP_ID2, TPM_INF_ADDR);
version[0] = inb(TPM_DATA); version[0] = inb(TPM_INF_DATA);
if ((vendorid[0] << 8 | vendorid[1]) == (TCPA_INFINEON_DEV_VEN_VALUE)) { switch ((productid[0] << 8) | productid[1]) {
case 6:
/* read IO-ports from TPM */ sprintf(chipname, " (SLD 9630 TT 1.1)");
outb(IOLIMH, TPM_ADDR); break;
ioh = inb(TPM_DATA); case 11:
outb(IOLIML, TPM_ADDR); sprintf(chipname, " (SLB 9635 TT 1.2)");
iol = inb(TPM_DATA); break;
tpm_inf.base = (ioh << 8) | iol; default:
sprintf(chipname, " (unknown chip)");
break;
}
chipname[19] = 0;
if ((vendorid[0] << 8 | vendorid[1]) == (TPM_INFINEON_DEV_VEN_VALUE)) {
if (tpm_inf.base == 0) { if (tpm_inf.base == 0) {
dev_err(&pci_dev->dev, "No IO-ports set!\n"); dev_err(&pci_dev->dev, "No IO-ports found!\n");
pci_disable_device(pci_dev); pci_disable_device(pci_dev);
return -ENODEV; return -EIO;
}
/* configure TPM with IO-ports */
outb(IOLIMH, TPM_INF_ADDR);
outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA);
outb(IOLIML, TPM_INF_ADDR);
outb((tpm_inf.base & 0xff), TPM_INF_DATA);
/* control if IO-ports are set correctly */
outb(IOLIMH, TPM_INF_ADDR);
ioh = inb(TPM_INF_DATA);
outb(IOLIML, TPM_INF_ADDR);
iol = inb(TPM_INF_DATA);
if ((ioh << 8 | iol) != tpm_inf.base) {
dev_err(&pci_dev->dev,
"Could not set IO-ports to %04x\n",
tpm_inf.base);
pci_disable_device(pci_dev);
return -EIO;
} }
/* activate register */ /* activate register */
outb(TPM_DAR, TPM_ADDR); outb(TPM_DAR, TPM_INF_ADDR);
outb(0x01, TPM_DATA); outb(0x01, TPM_INF_DATA);
outb(DISABLE_REGISTER_PAIR, TPM_ADDR); outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR);
/* disable RESET, LP and IRQC */ /* disable RESET, LP and IRQC */
outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD);
/* Finally, we're done, print some infos */ /* Finally, we're done, print some infos */
dev_info(&pci_dev->dev, "TPM found: " dev_info(&pci_dev->dev, "TPM found: "
"config base 0x%x, "
"io base 0x%x, " "io base 0x%x, "
"chip version %02x%02x, " "chip version %02x%02x, "
"vendor id %x%x (Infineon), " "vendor id %x%x (Infineon), "
"product id %02x%02x" "product id %02x%02x"
"%s\n", "%s\n",
TPM_INF_ADDR,
tpm_inf.base, tpm_inf.base,
version[0], version[1], version[0], version[1],
vendorid[0], vendorid[1], vendorid[0], vendorid[1],
productid[0], productid[1], ((productid[0] == 0) productid[0], productid[1], chipname);
&& (productid[1] ==
6)) ?
" (SLD 9630 TT 1.1)" : "");
rc = tpm_register_hardware(pci_dev, &tpm_inf); rc = tpm_register_hardware(pci_dev, &tpm_inf);
if (rc < 0) { if (rc < 0) {
...@@ -462,6 +528,6 @@ module_init(init_inf); ...@@ -462,6 +528,6 @@ module_init(init_inf);
module_exit(cleanup_inf); module_exit(cleanup_inf);
MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>");
MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT"); MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");
MODULE_VERSION("1.4"); MODULE_VERSION("1.5");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* /*
* i8xx_tco 0.07: TCO timer driver for i8xx chipsets * i8xx_tco: TCO timer driver for i8xx chipsets
* *
* (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved. * (c) Copyright 2000 kernel concepts <nils@kernelconcepts.de>, All Rights Reserved.
* http://www.kernelconcepts.de * http://www.kernelconcepts.de
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
* 20050128 Wim Van Sebroeck <wim@iguana.be> * 20050128 Wim Van Sebroeck <wim@iguana.be>
* 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW * 0.07 Added support for the ICH4-M, ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW
* chipsets. Also added support for the "undocumented" ICH7 chipset. * chipsets. Also added support for the "undocumented" ICH7 chipset.
* 20050807 Wim Van Sebroeck <wim@iguana.be>
* 0.08 Make sure that the watchdog is only "armed" when started.
* (Kernel Bug 4251)
*/ */
/* /*
...@@ -87,7 +90,7 @@ ...@@ -87,7 +90,7 @@
#include "i8xx_tco.h" #include "i8xx_tco.h"
/* Module and version information */ /* Module and version information */
#define TCO_VERSION "0.07" #define TCO_VERSION "0.08"
#define TCO_MODULE_NAME "i8xx TCO timer" #define TCO_MODULE_NAME "i8xx TCO timer"
#define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION
#define PFX TCO_MODULE_NAME ": " #define PFX TCO_MODULE_NAME ": "
...@@ -125,10 +128,18 @@ static int tco_timer_start (void) ...@@ -125,10 +128,18 @@ static int tco_timer_start (void)
unsigned char val; unsigned char val;
spin_lock(&tco_lock); spin_lock(&tco_lock);
/* disable chipset's NO_REBOOT bit */
pci_read_config_byte (i8xx_tco_pci, 0xd4, &val);
val &= 0xfd;
pci_write_config_byte (i8xx_tco_pci, 0xd4, val);
/* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled to count */
val = inb (TCO1_CNT + 1); val = inb (TCO1_CNT + 1);
val &= 0xf7; val &= 0xf7;
outb (val, TCO1_CNT + 1); outb (val, TCO1_CNT + 1);
val = inb (TCO1_CNT + 1); val = inb (TCO1_CNT + 1);
spin_unlock(&tco_lock); spin_unlock(&tco_lock);
if (val & 0x08) if (val & 0x08)
...@@ -138,13 +149,20 @@ static int tco_timer_start (void) ...@@ -138,13 +149,20 @@ static int tco_timer_start (void)
static int tco_timer_stop (void) static int tco_timer_stop (void)
{ {
unsigned char val; unsigned char val, val1;
spin_lock(&tco_lock); spin_lock(&tco_lock);
/* Bit 11: TCO Timer Halt -> 1 = The TCO timer is disabled */
val = inb (TCO1_CNT + 1); val = inb (TCO1_CNT + 1);
val |= 0x08; val |= 0x08;
outb (val, TCO1_CNT + 1); outb (val, TCO1_CNT + 1);
val = inb (TCO1_CNT + 1); val = inb (TCO1_CNT + 1);
/* Set the NO_REBOOT bit to prevent later reboots, just for sure */
pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);
val1 |= 0x02;
pci_write_config_byte (i8xx_tco_pci, 0xd4, val1);
spin_unlock(&tco_lock); spin_unlock(&tco_lock);
if ((val & 0x08) == 0) if ((val & 0x08) == 0)
...@@ -155,6 +173,7 @@ static int tco_timer_stop (void) ...@@ -155,6 +173,7 @@ static int tco_timer_stop (void)
static int tco_timer_keepalive (void) static int tco_timer_keepalive (void)
{ {
spin_lock(&tco_lock); spin_lock(&tco_lock);
/* Reload the timer by writing to the TCO Timer Reload register */
outb (0x01, TCO1_RLD); outb (0x01, TCO1_RLD);
spin_unlock(&tco_lock); spin_unlock(&tco_lock);
return 0; return 0;
...@@ -417,9 +436,8 @@ static unsigned char __init i8xx_tco_getdevice (void) ...@@ -417,9 +436,8 @@ static unsigned char __init i8xx_tco_getdevice (void)
printk (KERN_ERR PFX "failed to get TCOBASE address\n"); printk (KERN_ERR PFX "failed to get TCOBASE address\n");
return 0; return 0;
} }
/*
* Check chipset's NO_REBOOT bit /* Check chipset's NO_REBOOT bit */
*/
pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1); pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);
if (val1 & 0x02) { if (val1 & 0x02) {
val1 &= 0xfd; val1 &= 0xfd;
...@@ -430,6 +448,10 @@ static unsigned char __init i8xx_tco_getdevice (void) ...@@ -430,6 +448,10 @@ static unsigned char __init i8xx_tco_getdevice (void)
return 0; /* Cannot reset NO_REBOOT bit */ return 0; /* Cannot reset NO_REBOOT bit */
} }
} }
/* Disable reboots untill the watchdog starts */
val1 |= 0x02;
pci_write_config_byte (i8xx_tco_pci, 0xd4, val1);
/* Set the TCO_EN bit in SMI_EN register */ /* Set the TCO_EN bit in SMI_EN register */
if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) { if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) {
printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
...@@ -505,17 +527,10 @@ static int __init watchdog_init (void) ...@@ -505,17 +527,10 @@ static int __init watchdog_init (void)
static void __exit watchdog_cleanup (void) static void __exit watchdog_cleanup (void)
{ {
u8 val;
/* Stop the timer before we leave */ /* Stop the timer before we leave */
if (!nowayout) if (!nowayout)
tco_timer_stop (); tco_timer_stop ();
/* Set the NO_REBOOT bit to prevent later reboots, just for sure */
pci_read_config_byte (i8xx_tco_pci, 0xd4, &val);
val |= 0x02;
pci_write_config_byte (i8xx_tco_pci, 0xd4, val);
/* Deregister */ /* Deregister */
misc_deregister (&i8xx_tco_miscdev); misc_deregister (&i8xx_tco_miscdev);
unregister_reboot_notifier(&i8xx_tco_notifier); unregister_reboot_notifier(&i8xx_tco_notifier);
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <asm/sibyte/sb1250_smbus.h> #include <asm/sibyte/sb1250_smbus.h>
static struct i2c_algo_sibyte_data sibyte_board_data[2] = { static struct i2c_algo_sibyte_data sibyte_board_data[2] = {
{ NULL, 0, (void *) (KSEG1+A_SMB_BASE(0)) }, { NULL, 0, (void *) (CKSEG1+A_SMB_BASE(0)) },
{ NULL, 1, (void *) (KSEG1+A_SMB_BASE(1)) } { NULL, 1, (void *) (CKSEG1+A_SMB_BASE(1)) }
}; };
static struct i2c_adapter sibyte_board_adapter[2] = { static struct i2c_adapter sibyte_board_adapter[2] = {
......
...@@ -1220,7 +1220,7 @@ static int ide_disk_probe(struct device *dev) ...@@ -1220,7 +1220,7 @@ static int ide_disk_probe(struct device *dev)
goto failed; goto failed;
g = alloc_disk_node(1 << PARTN_BITS, g = alloc_disk_node(1 << PARTN_BITS,
pcibus_to_node(drive->hwif->pci_dev->bus)); hwif_to_node(drive->hwif));
if (!g) if (!g)
goto out_free_idkp; goto out_free_idkp;
......
...@@ -960,15 +960,6 @@ static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) ...@@ -960,15 +960,6 @@ static void save_match(ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match)
} }
#endif /* MAX_HWIFS > 1 */ #endif /* MAX_HWIFS > 1 */
static inline int hwif_to_node(ide_hwif_t *hwif)
{
if (hwif->pci_dev)
return pcibus_to_node(hwif->pci_dev->bus);
else
/* Add ways to determine the node of other busses here */
return -1;
}
/* /*
* init request queue * init request queue
*/ */
......
...@@ -1650,7 +1650,7 @@ static void __exit icn_exit(void) ...@@ -1650,7 +1650,7 @@ static void __exit icn_exit(void)
{ {
isdn_ctrl cmd; isdn_ctrl cmd;
icn_card *card = cards; icn_card *card = cards;
icn_card *last; icn_card *last, *tmpcard;
int i; int i;
unsigned long flags; unsigned long flags;
...@@ -1670,8 +1670,9 @@ static void __exit icn_exit(void) ...@@ -1670,8 +1670,9 @@ static void __exit icn_exit(void)
for (i = 0; i < ICN_BCH; i++) for (i = 0; i < ICN_BCH; i++)
icn_free_queue(card, i); icn_free_queue(card, i);
} }
card = card->next; tmpcard = card->next;
spin_unlock_irqrestore(&card->lock, flags); spin_unlock_irqrestore(&card->lock, flags);
card = tmpcard;
} }
card = cards; card = cards;
cards = NULL; cards = NULL;
......
...@@ -188,7 +188,7 @@ config DVB_BCM3510 ...@@ -188,7 +188,7 @@ config DVB_BCM3510
support this frontend. support this frontend.
config DVB_LGDT330X config DVB_LGDT330X
tristate "LGDT3302 or LGDT3303 based (DViCO FusionHDTV Gold)" tristate "LG Electronics LGDT3302/LGDT3303 based"
depends on DVB_CORE depends on DVB_CORE
help help
An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
......
...@@ -225,6 +225,22 @@ struct dvb_pll_desc dvb_pll_tua6034 = { ...@@ -225,6 +225,22 @@ struct dvb_pll_desc dvb_pll_tua6034 = {
}; };
EXPORT_SYMBOL(dvb_pll_tua6034); EXPORT_SYMBOL(dvb_pll_tua6034);
/* Infineon TUA6034
* used in LG Innotek TDVS-H062F
*/
struct dvb_pll_desc dvb_pll_tdvs_tua6034 = {
.name = "LG/Infineon TUA6034",
.min = 54000000,
.max = 863000000,
.count = 3,
.entries = {
{ 160000000, 44000000, 62500, 0xce, 0x01 },
{ 455000000, 44000000, 62500, 0xce, 0x02 },
{ 999999999, 44000000, 62500, 0xce, 0x04 },
},
};
EXPORT_SYMBOL(dvb_pll_tdvs_tua6034);
/* Philips FMD1216ME /* Philips FMD1216ME
* used in Medion Hybrid PCMCIA card and USB Box * used in Medion Hybrid PCMCIA card and USB Box
*/ */
......
...@@ -31,6 +31,7 @@ extern struct dvb_pll_desc dvb_pll_unknown_1; ...@@ -31,6 +31,7 @@ extern struct dvb_pll_desc dvb_pll_unknown_1;
extern struct dvb_pll_desc dvb_pll_tua6010xs; extern struct dvb_pll_desc dvb_pll_tua6010xs;
extern struct dvb_pll_desc dvb_pll_env57h1xd5; extern struct dvb_pll_desc dvb_pll_env57h1xd5;
extern struct dvb_pll_desc dvb_pll_tua6034; extern struct dvb_pll_desc dvb_pll_tua6034;
extern struct dvb_pll_desc dvb_pll_tdvs_tua6034;
extern struct dvb_pll_desc dvb_pll_tda665x; extern struct dvb_pll_desc dvb_pll_tda665x;
extern struct dvb_pll_desc dvb_pll_fmd1216me; extern struct dvb_pll_desc dvb_pll_fmd1216me;
extern struct dvb_pll_desc dvb_pll_tded4; extern struct dvb_pll_desc dvb_pll_tded4;
......
/* /*
* Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM * Support for LGDT3302 and LGDT3303 - VSB/QAM
* *
* Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
* *
...@@ -24,14 +24,26 @@ ...@@ -24,14 +24,26 @@
#include <linux/dvb/frontend.h> #include <linux/dvb/frontend.h>
typedef enum lg_chip_t {
UNDEFINED,
LGDT3302,
LGDT3303
}lg_chip_type;
struct lgdt330x_config struct lgdt330x_config
{ {
/* The demodulator's i2c address */ /* The demodulator's i2c address */
u8 demod_address; u8 demod_address;
/* LG demodulator chip LGDT3302 or LGDT3303 */
lg_chip_type demod_chip;
/* MPEG hardware interface - 0:parallel 1:serial */
int serial_mpeg;
/* PLL interface */ /* PLL interface */
int (*pll_rf_set) (struct dvb_frontend* fe, int index); int (*pll_rf_set) (struct dvb_frontend* fe, int index);
int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pll_address); int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
/* Need to set device param for start_dma */ /* Need to set device param for start_dma */
int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured); int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
......
/* /*
* Support for LGDT3302 & LGDT3303 (DViCO FustionHDTV Gold) - VSB/QAM * Support for LGDT3302 and LGDT3303 - VSB/QAM
* *
* Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net> * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
* *
...@@ -57,8 +57,10 @@ enum I2C_REG { ...@@ -57,8 +57,10 @@ enum I2C_REG {
PH_ERR1= 0x4a, PH_ERR1= 0x4a,
PH_ERR2= 0x4b, PH_ERR2= 0x4b,
DEMUX_CONTROL= 0x66, DEMUX_CONTROL= 0x66,
PACKET_ERR_COUNTER1= 0x6a, LGDT3302_PACKET_ERR_COUNTER1= 0x6a,
PACKET_ERR_COUNTER2= 0x6b, LGDT3302_PACKET_ERR_COUNTER2= 0x6b,
LGDT3303_PACKET_ERR_COUNTER1= 0x8b,
LGDT3303_PACKET_ERR_COUNTER2= 0x8c,
}; };
#endif /* _LGDT330X_PRIV_ */ #endif /* _LGDT330X_PRIV_ */
......
/* /*
* $Id: cx88-dvb.c,v 1.54 2005/07/25 05:13:50 mkrufky Exp $ * $Id: cx88-dvb.c,v 1.58 2005/08/07 09:24:08 mkrufky Exp $
* *
* device driver for Conexant 2388x based TV cards * device driver for Conexant 2388x based TV cards
* MPEG Transport Stream (DVB) routines * MPEG Transport Stream (DVB) routines
...@@ -208,14 +208,26 @@ static struct or51132_config pchdtv_hd3000 = { ...@@ -208,14 +208,26 @@ static struct or51132_config pchdtv_hd3000 = {
#ifdef HAVE_LGDT330X #ifdef HAVE_LGDT330X
static int lgdt330x_pll_set(struct dvb_frontend* fe, static int lgdt330x_pll_set(struct dvb_frontend* fe,
struct dvb_frontend_parameters* params, struct dvb_frontend_parameters* params)
u8* pllbuf)
{ {
struct cx8802_dev *dev= fe->dvb->priv; struct cx8802_dev *dev= fe->dvb->priv;
u8 buf[4];
struct i2c_msg msg =
{ .addr = dev->core->pll_addr, .flags = 0, .buf = buf, .len = 4 };
int err;
pllbuf[0] = dev->core->pll_addr; dvb_pll_configure(dev->core->pll_desc, buf, params->frequency, 0);
dvb_pll_configure(dev->core->pll_desc, &pllbuf[1], dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
params->frequency, 0); __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
printk(KERN_WARNING "cx88-dvb: %s error "
"(addr %02x <- %02x, err = %i)\n",
__FUNCTION__, buf[0], buf[1], err);
if (err < 0)
return err;
else
return -EREMOTEIO;
}
return 0; return 0;
} }
...@@ -244,6 +256,8 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured) ...@@ -244,6 +256,8 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
static struct lgdt330x_config fusionhdtv_3_gold = { static struct lgdt330x_config fusionhdtv_3_gold = {
.demod_address = 0x0e, .demod_address = 0x0e,
.demod_chip = LGDT3302,
.serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */
.pll_set = lgdt330x_pll_set, .pll_set = lgdt330x_pll_set,
.set_ts_params = lgdt330x_set_ts_param, .set_ts_params = lgdt330x_set_ts_param,
}; };
......
...@@ -53,6 +53,9 @@ config I2O_CONFIG ...@@ -53,6 +53,9 @@ config I2O_CONFIG
To compile this support as a module, choose M here: the To compile this support as a module, choose M here: the
module will be called i2o_config. module will be called i2o_config.
Note: If you want to use the new API you have to download the
i2o_config patch from http://i2o.shadowconnect.com/
config I2O_CONFIG_OLD_IOCTL config I2O_CONFIG_OLD_IOCTL
bool "Enable ioctls (OBSOLETE)" bool "Enable ioctls (OBSOLETE)"
depends on I2O_CONFIG depends on I2O_CONFIG
......
...@@ -30,503 +30,9 @@ ...@@ -30,503 +30,9 @@
static struct i2o_driver i2o_config_driver; static struct i2o_driver i2o_config_driver;
/* Special file operations for sysfs */
struct fops_attribute {
struct bin_attribute bin;
struct file_operations fops;
};
/**
* sysfs_read_dummy
*/
static ssize_t sysfs_read_dummy(struct kobject *kobj, char *buf, loff_t offset,
size_t count)
{
return 0;
};
/**
* sysfs_write_dummy
*/
static ssize_t sysfs_write_dummy(struct kobject *kobj, char *buf, loff_t offset,
size_t count)
{
return 0;
};
/**
* sysfs_create_fops_file - Creates attribute with special file operations
* @kobj: kobject which should contains the attribute
* @attr: attributes which should be used to create file
*
* First creates attribute @attr in kobject @kobj. If it is the first time
* this function is called, merge old fops from sysfs with new one and
* write it back. Afterwords the new fops will be set for the created
* attribute.
*
* Returns 0 on success or negative error code on failure.
*/
static int sysfs_create_fops_file(struct kobject *kobj,
struct fops_attribute *attr)
{
struct file_operations tmp, *fops;
struct dentry *d;
struct qstr qstr;
int rc;
fops = &attr->fops;
if (fops->read)
attr->bin.read = sysfs_read_dummy;
if (fops->write)
attr->bin.write = sysfs_write_dummy;
if ((rc = sysfs_create_bin_file(kobj, &attr->bin)))
return rc;
qstr.name = attr->bin.attr.name;
qstr.len = strlen(qstr.name);
qstr.hash = full_name_hash(qstr.name, qstr.len);
if ((d = lookup_hash(&qstr, kobj->dentry))) {
if (!fops->owner) {
memcpy(&tmp, d->d_inode->i_fop, sizeof(tmp));
if (fops->read)
tmp.read = fops->read;
if (fops->write)
tmp.write = fops->write;
memcpy(fops, &tmp, sizeof(tmp));
}
d->d_inode->i_fop = fops;
} else
sysfs_remove_bin_file(kobj, &attr->bin);
return -ENOENT;
};
/**
* sysfs_remove_fops_file - Remove attribute with special file operations
* @kobj: kobject which contains the attribute
* @attr: attributes which are used to create file
*
* Only wrapper arround sysfs_remove_bin_file()
*
* Returns 0 on success or negative error code on failure.
*/
static inline int sysfs_remove_fops_file(struct kobject *kobj,
struct fops_attribute *attr)
{
return sysfs_remove_bin_file(kobj, &attr->bin);
};
/**
* i2o_config_read_hrt - Returns the HRT of the controller
* @kob: kernel object handle
* @buf: buffer into which the HRT should be copied
* @off: file offset
* @count: number of bytes to read
*
* Put @count bytes starting at @off into @buf from the HRT of the I2O
* controller corresponding to @kobj.
*
* Returns number of bytes copied into buffer.
*/
static ssize_t i2o_config_read_hrt(struct kobject *kobj, char *buf,
loff_t offset, size_t count)
{
struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop;
i2o_hrt *hrt = c->hrt.virt;
u32 size = (hrt->num_entries * hrt->entry_len + 2) * 4;
if (offset > size)
return 0;
if (offset + count > size)
count = size - offset;
memcpy(buf, (u8 *) hrt + offset, count);
return count;
};
/**
* i2o_config_read_lct - Returns the LCT of the controller
* @kob: kernel object handle
* @buf: buffer into which the LCT should be copied
* @off: file offset
* @count: number of bytes to read
*
* Put @count bytes starting at @off into @buf from the LCT of the I2O
* controller corresponding to @kobj.
*
* Returns number of bytes copied into buffer.
*/
static ssize_t i2o_config_read_lct(struct kobject *kobj, char *buf,
loff_t offset, size_t count)
{
struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop;
u32 size = c->lct->table_size * 4;
if (offset > size)
return 0;
if (offset + count > size)
count = size - offset;
memcpy(buf, (u8 *) c->lct + offset, count);
return count;
};
#define I2O_CONFIG_SW_ATTR(_name,_mode,_type,_swid) \
static ssize_t i2o_config_##_name##_read(struct file *file, char __user *buf, size_t count, loff_t * offset) { \
return i2o_config_sw_read(file, buf, count, offset, _type, _swid); \
};\
\
static ssize_t i2o_config_##_name##_write(struct file *file, const char __user *buf, size_t count, loff_t * offset) { \
return i2o_config_sw_write(file, buf, count, offset, _type, _swid); \
}; \
\
static struct fops_attribute i2o_config_attr_##_name = { \
.bin = { .attr = { .name = __stringify(_name), .mode = _mode, \
.owner = THIS_MODULE }, \
.size = 0, }, \
.fops = { .write = i2o_config_##_name##_write, \
.read = i2o_config_##_name##_read} \
};
#ifdef CONFIG_I2O_EXT_ADAPTEC
/**
* i2o_config_dpt_reagion - Converts type and id to flash region
* @swtype: type of software module reading
* @swid: id of software which should be read
*
* Converts type and id from I2O spec to the matching region for DPT /
* Adaptec controllers.
*
* Returns region which match type and id or -1 on error.
*/
static u32 i2o_config_dpt_region(u8 swtype, u8 swid)
{
switch (swtype) {
case I2O_SOFTWARE_MODULE_IRTOS:
/*
* content: operation firmware
* region size:
* 0xbc000 for 2554, 3754, 2564, 3757
* 0x170000 for 2865
* 0x17c000 for 3966
*/
if (!swid)
return 0;
break;
case I2O_SOFTWARE_MODULE_IOP_PRIVATE:
/*
* content: BIOS and SMOR
* BIOS size: first 0x8000 bytes
* region size:
* 0x40000 for 2554, 3754, 2564, 3757
* 0x80000 for 2865, 3966
*/
if (!swid)
return 1;
break;
case I2O_SOFTWARE_MODULE_IOP_CONFIG:
switch (swid) {
case 0:
/*
* content: NVRAM defaults
* region size: 0x2000 bytes
*/
return 2;
case 1:
/*
* content: serial number
* region size: 0x2000 bytes
*/
return 3;
}
break;
}
return -1;
};
#endif
/**
* i2o_config_sw_read - Read a software module from controller
* @file: file pointer
* @buf: buffer into which the data should be copied
* @count: number of bytes to read
* @off: file offset
* @swtype: type of software module reading
* @swid: id of software which should be read
*
* Transfers @count bytes at offset @offset from IOP into buffer using
* type @swtype and id @swid as described in I2O spec.
*
* Returns number of bytes copied into buffer or error code on failure.
*/
static ssize_t i2o_config_sw_read(struct file *file, char __user * buf,
size_t count, loff_t * offset, u8 swtype,
u32 swid)
{
struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata;
struct kobject *kobj = sd->s_element;
struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop;
u32 m, function = I2O_CMD_SW_UPLOAD;
struct i2o_dma buffer;
struct i2o_message __iomem *msg;
u32 __iomem *mptr;
int rc, status;
m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET);
if (m == I2O_QUEUE_EMPTY)
return -EBUSY;
mptr = &msg->body[3];
if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL))) {
i2o_msg_nop(c, m);
return rc;
}
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (c->adaptec) {
mptr = &msg->body[4];
function = I2O_CMD_PRIVATE;
writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]);
writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_READ,
&msg->body[0]);
writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]);
writel(*offset, &msg->body[2]);
writel(count, &msg->body[3]);
} else
#endif
writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]);
writel(0xD0000000 | count, mptr++);
writel(buffer.phys, mptr);
writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]);
writel(i2o_config_driver.context, &msg->u.head[2]);
writel(0, &msg->u.head[3]);
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (!c->adaptec)
#endif
{
writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]);
writel(0, &msg->body[1]);
writel(swid, &msg->body[2]);
}
status = i2o_msg_post_wait_mem(c, m, 60, &buffer);
if (status == I2O_POST_WAIT_OK) {
if (!(rc = copy_to_user(buf, buffer.virt, count))) {
rc = count;
*offset += count;
}
} else
rc = -EIO;
if (status != -ETIMEDOUT)
i2o_dma_free(&c->pdev->dev, &buffer);
return rc;
};
/**
* i2o_config_sw_write - Write a software module to controller
* @file: file pointer
* @buf: buffer into which the data should be copied
* @count: number of bytes to read
* @off: file offset
* @swtype: type of software module writing
* @swid: id of software which should be written
*
* Transfers @count bytes at offset @offset from buffer to IOP using
* type @swtype and id @swid as described in I2O spec.
*
* Returns number of bytes copied from buffer or error code on failure.
*/
static ssize_t i2o_config_sw_write(struct file *file, const char __user * buf,
size_t count, loff_t * offset, u8 swtype,
u32 swid)
{
struct sysfs_dirent *sd = file->f_dentry->d_parent->d_fsdata;
struct kobject *kobj = sd->s_element;
struct i2o_controller *c = kobj_to_i2o_device(kobj)->iop;
u32 m, function = I2O_CMD_SW_DOWNLOAD;
struct i2o_dma buffer;
struct i2o_message __iomem *msg;
u32 __iomem *mptr;
int rc, status;
m = i2o_msg_get_wait(c, &msg, I2O_TIMEOUT_MESSAGE_GET);
if (m == I2O_QUEUE_EMPTY)
return -EBUSY;
mptr = &msg->body[3];
if ((rc = i2o_dma_alloc(&c->pdev->dev, &buffer, count, GFP_KERNEL)))
goto nop_msg;
if ((rc = copy_from_user(buffer.virt, buf, count)))
goto free_buffer;
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (c->adaptec) {
mptr = &msg->body[4];
function = I2O_CMD_PRIVATE;
writel(TEN_WORD_MSG_SIZE | SGL_OFFSET_8, &msg->u.head[0]);
writel(I2O_VENDOR_DPT << 16 | I2O_DPT_FLASH_WRITE,
&msg->body[0]);
writel(i2o_config_dpt_region(swtype, swid), &msg->body[1]);
writel(*offset, &msg->body[2]);
writel(count, &msg->body[3]);
} else
#endif
writel(NINE_WORD_MSG_SIZE | SGL_OFFSET_7, &msg->u.head[0]);
writel(0xD4000000 | count, mptr++);
writel(buffer.phys, mptr);
writel(function << 24 | HOST_TID << 12 | ADAPTER_TID, &msg->u.head[1]);
writel(i2o_config_driver.context, &msg->u.head[2]);
writel(0, &msg->u.head[3]);
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (!c->adaptec)
#endif
{
writel((u32) swtype << 16 | (u32) 1 << 8, &msg->body[0]);
writel(0, &msg->body[1]);
writel(swid, &msg->body[2]);
}
status = i2o_msg_post_wait_mem(c, m, 60, &buffer);
if (status != -ETIMEDOUT)
i2o_dma_free(&c->pdev->dev, &buffer);
if (status != I2O_POST_WAIT_OK)
return -EIO;
*offset += count;
return count;
free_buffer:
i2o_dma_free(&c->pdev->dev, &buffer);
nop_msg:
i2o_msg_nop(c, m);
return rc;
};
/* attribute for HRT in sysfs */
static struct bin_attribute i2o_config_hrt_attr = {
.attr = {
.name = "hrt",
.mode = S_IRUGO,
.owner = THIS_MODULE},
.size = 0,
.read = i2o_config_read_hrt
};
/* attribute for LCT in sysfs */
static struct bin_attribute i2o_config_lct_attr = {
.attr = {
.name = "lct",
.mode = S_IRUGO,
.owner = THIS_MODULE},
.size = 0,
.read = i2o_config_read_lct
};
/* IRTOS firmware access */
I2O_CONFIG_SW_ATTR(irtos, S_IWRSR, I2O_SOFTWARE_MODULE_IRTOS, 0);
#ifdef CONFIG_I2O_EXT_ADAPTEC
/*
* attribute for BIOS / SMOR, nvram and serial number access on DPT / Adaptec
* controllers
*/
I2O_CONFIG_SW_ATTR(bios, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_PRIVATE, 0);
I2O_CONFIG_SW_ATTR(nvram, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 0);
I2O_CONFIG_SW_ATTR(serial, S_IWRSR, I2O_SOFTWARE_MODULE_IOP_CONFIG, 1);
#endif
/**
* i2o_config_notify_controller_add - Notify of added controller
* @c: the controller which was added
*
* If a I2O controller is added, we catch the notification to add sysfs
* entries.
*/
static void i2o_config_notify_controller_add(struct i2o_controller *c)
{
struct kobject *kobj = &c->exec->device.kobj;
sysfs_create_bin_file(kobj, &i2o_config_hrt_attr);
sysfs_create_bin_file(kobj, &i2o_config_lct_attr);
sysfs_create_fops_file(kobj, &i2o_config_attr_irtos);
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (c->adaptec) {
sysfs_create_fops_file(kobj, &i2o_config_attr_bios);
sysfs_create_fops_file(kobj, &i2o_config_attr_nvram);
sysfs_create_fops_file(kobj, &i2o_config_attr_serial);
}
#endif
};
/**
* i2o_config_notify_controller_remove - Notify of removed controller
* @c: the controller which was removed
*
* If a I2O controller is removed, we catch the notification to remove the
* sysfs entries.
*/
static void i2o_config_notify_controller_remove(struct i2o_controller *c)
{
struct kobject *kobj = &c->exec->device.kobj;
#ifdef CONFIG_I2O_EXT_ADAPTEC
if (c->adaptec) {
sysfs_remove_fops_file(kobj, &i2o_config_attr_serial);
sysfs_remove_fops_file(kobj, &i2o_config_attr_nvram);
sysfs_remove_fops_file(kobj, &i2o_config_attr_bios);
}
#endif
sysfs_remove_fops_file(kobj, &i2o_config_attr_irtos);
sysfs_remove_bin_file(kobj, &i2o_config_lct_attr);
sysfs_remove_bin_file(kobj, &i2o_config_hrt_attr);
};
/* Config OSM driver struct */ /* Config OSM driver struct */
static struct i2o_driver i2o_config_driver = { static struct i2o_driver i2o_config_driver = {
.name = OSM_NAME, .name = OSM_NAME,
.notify_controller_add = i2o_config_notify_controller_add,
.notify_controller_remove = i2o_config_notify_controller_remove
}; };
#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL #ifdef CONFIG_I2O_CONFIG_OLD_IOCTL
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <linux/i2o.h> #include <linux/i2o.h>
#include "core.h" #include "core.h"
#define OSM_DESCRIPTION "I2O-subsystem"
/* PCI device id table for all I2O controllers */ /* PCI device id table for all I2O controllers */
static struct pci_device_id __devinitdata i2o_pci_ids[] = { static struct pci_device_id __devinitdata i2o_pci_ids[] = {
{PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)}, {PCI_DEVICE_CLASS(PCI_CLASS_INTELLIGENT_I2O << 8, 0xffff00)},
...@@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c) ...@@ -66,6 +68,8 @@ static void i2o_pci_free(struct i2o_controller *c)
if (c->base.virt) if (c->base.virt)
iounmap(c->base.virt); iounmap(c->base.virt);
pci_release_regions(c->pdev);
} }
/** /**
...@@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) ...@@ -84,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int i; int i;
if (pci_request_regions(pdev, OSM_DESCRIPTION)) {
printk(KERN_ERR "%s: device already claimed\n", c->name);
return -ENODEV;
}
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
/* Skip I/O spaces */ /* Skip I/O spaces */
if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
...@@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) ...@@ -138,6 +147,7 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
c->base.virt = ioremap_nocache(c->base.phys, c->base.len); c->base.virt = ioremap_nocache(c->base.phys, c->base.len);
if (!c->base.virt) { if (!c->base.virt) {
printk(KERN_ERR "%s: Unable to map controller.\n", c->name); printk(KERN_ERR "%s: Unable to map controller.\n", c->name);
i2o_pci_free(c);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -66,8 +66,8 @@ ...@@ -66,8 +66,8 @@
#define DRV_MODULE_NAME "tg3" #define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.34" #define DRV_MODULE_VERSION "3.35"
#define DRV_MODULE_RELDATE "July 25, 2005" #define DRV_MODULE_RELDATE "August 6, 2005"
#define TG3_DEF_MAC_MODE 0 #define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0 #define TG3_DEF_RX_MODE 0
...@@ -10421,6 +10421,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, ...@@ -10421,6 +10421,12 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
tg3_init_coal(tp); tg3_init_coal(tp);
/* Now that we have fully setup the chip, save away a snapshot
* of the PCI config space. We need to restore this after
* GRC_MISC_CFG core clock resets and some resume events.
*/
pci_save_state(tp->pdev);
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
printk(KERN_ERR PFX "Cannot register net device, " printk(KERN_ERR PFX "Cannot register net device, "
...@@ -10430,12 +10436,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, ...@@ -10430,12 +10436,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
/* Now that we have fully setup the chip, save away a snapshot
* of the PCI config space. We need to restore this after
* GRC_MISC_CFG core clock resets and some resume events.
*/
pci_save_state(tp->pdev);
printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ", printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] (PCI%s:%s:%s) %sBaseT Ethernet ",
dev->name, dev->name,
tp->board_part_number, tp->board_part_number,
......
...@@ -373,6 +373,25 @@ static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev) ...@@ -373,6 +373,25 @@ static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev)
} }
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi ); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi );
/*
* VIA VT8235 ISA Bridge: Two IO regions pointed to by words at
* 0x88 (128 bytes of power management registers)
* 0xd0 (16 bytes of SMB registers)
*/
static void __devinit quirk_vt8235_acpi(struct pci_dev *dev)
{
u16 pm, smb;
pci_read_config_word(dev, 0x88, &pm);
pm &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, pm, 128, PCI_BRIDGE_RESOURCES);
pci_read_config_word(dev, 0xd0, &smb);
smb &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 1);
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, quirk_vt8235_acpi);
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
......
...@@ -33,6 +33,11 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) ...@@ -33,6 +33,11 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
u32 new, check, mask; u32 new, check, mask;
int reg; int reg;
/* Ignore resources for unimplemented BARs and unused resource slots
for 64 bit BARs. */
if (!res->flags)
return;
pcibios_resource_to_bus(dev, &region, res); pcibios_resource_to_bus(dev, &region, res);
pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for "
...@@ -67,7 +72,7 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) ...@@ -67,7 +72,7 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
(PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) {
new = 0; /* currently everyone zeros the high address */ new = region.start >> 16 >> 16;
pci_write_config_dword(dev, reg + 4, new); pci_write_config_dword(dev, reg + 4, new);
pci_read_config_dword(dev, reg + 4, &check); pci_read_config_dword(dev, reg + 4, &check);
if (check != new) { if (check != new) {
......
...@@ -605,9 +605,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res, ...@@ -605,9 +605,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end) static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned type, int addr_start, int addr_end)
{ {
struct pci_bus *bus;
struct resource *root, *res; struct resource *root, *res;
u32 start, end; struct pci_bus_region region;
unsigned mask; unsigned mask;
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr; res = socket->dev->resource + PCI_BRIDGE_RESOURCES + nr;
...@@ -620,15 +619,13 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ ...@@ -620,15 +619,13 @@ static void yenta_allocate_res(struct yenta_socket *socket, int nr, unsigned typ
if (type & IORESOURCE_IO) if (type & IORESOURCE_IO)
mask = ~3; mask = ~3;
bus = socket->dev->subordinate; res->name = socket->dev->subordinate->name;
res->name = bus->name;
res->flags = type; res->flags = type;
start = config_readl(socket, addr_start) & mask; region.start = config_readl(socket, addr_start) & mask;
end = config_readl(socket, addr_end) | ~mask; region.end = config_readl(socket, addr_end) | ~mask;
if (start && end > start && !override_bios) { if (region.start && region.end > region.start && !override_bios) {
res->start = start; pcibios_bus_to_resource(socket->dev, res, &region);
res->end = end;
root = pci_find_parent_resource(socket->dev, res); root = pci_find_parent_resource(socket->dev, res);
if (root && (request_resource(root, res) == 0)) if (root && (request_resource(root, res) == 0))
return; return;
......
...@@ -8120,20 +8120,22 @@ static struct notifier_block qeth_ip6_notifier = { ...@@ -8120,20 +8120,22 @@ static struct notifier_block qeth_ip6_notifier = {
#endif #endif
static int static int
qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr) __qeth_reboot_event_card(struct device *dev, void *data)
{ {
struct device *entry;
struct qeth_card *card; struct qeth_card *card;
down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); card = (struct qeth_card *) dev->driver_data;
list_for_each_entry(entry, &qeth_ccwgroup_driver.driver.devices, qeth_clear_ip_list(card, 0, 0);
driver_list) { qeth_qdio_clear_card(card, 0);
card = (struct qeth_card *) entry->driver_data; return 0;
qeth_clear_ip_list(card, 0, 0); }
qeth_qdio_clear_card(card, 0);
} static int
up_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); qeth_reboot_event(struct notifier_block *this, unsigned long event, void *ptr)
{
driver_for_each_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
__qeth_reboot_event_card);
return NOTIFY_DONE; return NOTIFY_DONE;
} }
......
...@@ -27,23 +27,33 @@ const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $"; ...@@ -27,23 +27,33 @@ const char *VERSION_QETH_PROC_C = "$Revision: 1.13 $";
#define QETH_PROCFILE_NAME "qeth" #define QETH_PROCFILE_NAME "qeth"
static struct proc_dir_entry *qeth_procfile; static struct proc_dir_entry *qeth_procfile;
static int
qeth_procfile_seq_match(struct device *dev, void *data)
{
return 1;
}
static void * static void *
qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) qeth_procfile_seq_start(struct seq_file *s, loff_t *offset)
{ {
struct list_head *next_card = NULL; struct device *dev;
int i = 0; loff_t nr;
down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
if (*offset == 0) nr = *offset;
if (nr == 0)
return SEQ_START_TOKEN; return SEQ_START_TOKEN;
/* get card at pos *offset */ dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL,
list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices) NULL, qeth_procfile_seq_match);
if (++i == *offset)
return next_card;
return NULL; /* get card at pos *offset */
nr = *offset;
while (nr-- > 1 && dev)
dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
NULL, qeth_procfile_seq_match);
return (void *) dev;
} }
static void static void
...@@ -55,23 +65,21 @@ qeth_procfile_seq_stop(struct seq_file *s, void* it) ...@@ -55,23 +65,21 @@ qeth_procfile_seq_stop(struct seq_file *s, void* it)
static void * static void *
qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
{ {
struct list_head *next_card = NULL; struct device *prev, *next;
struct list_head *current_card;
if (it == SEQ_START_TOKEN) { if (it == SEQ_START_TOKEN) {
next_card = qeth_ccwgroup_driver.driver.devices.next; next = driver_find_device(&qeth_ccwgroup_driver.driver,
if (next_card->next == next_card) /* list empty */ NULL, NULL, qeth_procfile_seq_match);
return NULL; if (next)
(*offset)++; (*offset)++;
} else { return (void *) next;
current_card = (struct list_head *)it;
if (current_card->next == &qeth_ccwgroup_driver.driver.devices)
return NULL; /* end of list reached */
next_card = current_card->next;
(*offset)++;
} }
prev = (struct device *) it;
return next_card; next = driver_find_device(&qeth_ccwgroup_driver.driver,
prev, NULL, qeth_procfile_seq_match);
if (next)
(*offset)++;
return (void *) next;
} }
static inline const char * static inline const char *
...@@ -126,7 +134,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it) ...@@ -126,7 +134,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it)
"-------------- ---- ------ ---------- ---- " "-------------- ---- ------ ---------- ---- "
"---- ----- -----\n"); "---- ----- -----\n");
} else { } else {
device = list_entry(it, struct device, driver_list); device = (struct device *) it;
card = device->driver_data; card = device->driver_data;
seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ", seq_printf(s, "%s/%s/%s x%02X %-10s %-14s %-4i ",
CARD_RDEV_ID(card), CARD_RDEV_ID(card),
...@@ -180,17 +188,20 @@ static struct proc_dir_entry *qeth_perf_procfile; ...@@ -180,17 +188,20 @@ static struct proc_dir_entry *qeth_perf_procfile;
static void * static void *
qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset) qeth_perf_procfile_seq_start(struct seq_file *s, loff_t *offset)
{ {
struct list_head *next_card = NULL; struct device *dev = NULL;
int i = 0; int nr;
down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
/* get card at pos *offset */ /* get card at pos *offset */
list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
if (i == *offset) qeth_procfile_seq_match);
return next_card;
i++; /* get card at pos *offset */
} nr = *offset;
return NULL; while (nr-- > 1 && dev)
dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
NULL, qeth_procfile_seq_match);
return (void *) dev;
} }
static void static void
...@@ -202,12 +213,14 @@ qeth_perf_procfile_seq_stop(struct seq_file *s, void* it) ...@@ -202,12 +213,14 @@ qeth_perf_procfile_seq_stop(struct seq_file *s, void* it)
static void * static void *
qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) qeth_perf_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
{ {
struct list_head *current_card = (struct list_head *)it; struct device *prev, *next;
if (current_card->next == &qeth_ccwgroup_driver.driver.devices) prev = (struct device *) it;
return NULL; /* end of list reached */ next = driver_find_device(&qeth_ccwgroup_driver.driver, prev,
(*offset)++; NULL, qeth_procfile_seq_match);
return current_card->next; if (next)
(*offset)++;
return (void *) next;
} }
static int static int
...@@ -216,7 +229,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) ...@@ -216,7 +229,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it)
struct device *device; struct device *device;
struct qeth_card *card; struct qeth_card *card;
device = list_entry(it, struct device, driver_list); device = (struct device *) it;
card = device->driver_data; card = device->driver_data;
seq_printf(s, "For card with devnos %s/%s/%s (%s):\n", seq_printf(s, "For card with devnos %s/%s/%s (%s):\n",
CARD_RDEV_ID(card), CARD_RDEV_ID(card),
...@@ -318,8 +331,8 @@ static struct proc_dir_entry *qeth_ipato_procfile; ...@@ -318,8 +331,8 @@ static struct proc_dir_entry *qeth_ipato_procfile;
static void * static void *
qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset)
{ {
struct list_head *next_card = NULL; struct device *dev;
int i = 0; loff_t nr;
down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem);
/* TODO: finish this */ /* TODO: finish this */
...@@ -328,13 +341,16 @@ qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset) ...@@ -328,13 +341,16 @@ qeth_ipato_procfile_seq_start(struct seq_file *s, loff_t *offset)
* output driver settings then; * output driver settings then;
* else output setting for respective card * else output setting for respective card
*/ */
dev = driver_find_device(&qeth_ccwgroup_driver.driver, NULL, NULL,
qeth_procfile_seq_match);
/* get card at pos *offset */ /* get card at pos *offset */
list_for_each(next_card, &qeth_ccwgroup_driver.driver.devices){ nr = *offset;
if (i == *offset) while (nr-- > 1 && dev)
return next_card; dev = driver_find_device(&qeth_ccwgroup_driver.driver, dev,
i++; NULL, qeth_procfile_seq_match);
} return (void *) dev;
return NULL;
} }
static void static void
...@@ -346,18 +362,14 @@ qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it) ...@@ -346,18 +362,14 @@ qeth_ipato_procfile_seq_stop(struct seq_file *s, void* it)
static void * static void *
qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) qeth_ipato_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset)
{ {
struct list_head *current_card = (struct list_head *)it; struct device *prev, *next;
/* TODO: finish this */ prev = (struct device *) it;
/* next = driver_find_device(&qeth_ccwgroup_driver.driver, prev,
* maybe SEQ_SATRT_TOKEN can be returned for offset 0 NULL, qeth_procfile_seq_match);
* output driver settings then; if (next)
* else output setting for respective card (*offset)++;
*/ return (void *) next;
if (current_card->next == &qeth_ccwgroup_driver.driver.devices)
return NULL; /* end of list reached */
(*offset)++;
return current_card->next;
} }
static int static int
...@@ -372,7 +384,7 @@ qeth_ipato_procfile_seq_show(struct seq_file *s, void *it) ...@@ -372,7 +384,7 @@ qeth_ipato_procfile_seq_show(struct seq_file *s, void *it)
* output driver settings then; * output driver settings then;
* else output setting for respective card * else output setting for respective card
*/ */
device = list_entry(it, struct device, driver_list); device = (struct device *) it;
card = device->driver_data; card = device->driver_data;
return 0; return 0;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#define __KERNEL_SYSCALLS__ #define __KERNEL_SYSCALLS__
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task; ...@@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task;
static int kenvctrld(void *__unused) static int kenvctrld(void *__unused)
{ {
daemonize("kenvctrld");
allow_signal(SIGKILL);
kenvctrld_task = current;
printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n"); printk(KERN_INFO "bbc_envctrl: kenvctrld starting...\n");
last_warning_jiffies = jiffies - WARN_INTERVAL; last_warning_jiffies = jiffies - WARN_INTERVAL;
for (;;) { for (;;) {
...@@ -470,7 +467,7 @@ static int kenvctrld(void *__unused) ...@@ -470,7 +467,7 @@ static int kenvctrld(void *__unused)
struct bbc_fan_control *fp; struct bbc_fan_control *fp;
msleep_interruptible(POLL_INTERVAL); msleep_interruptible(POLL_INTERVAL);
if (signal_pending(current)) if (kthread_should_stop())
break; break;
for (tp = all_bbc_temps; tp; tp = tp->next) { for (tp = all_bbc_temps; tp; tp = tp->next) {
...@@ -577,7 +574,6 @@ int bbc_envctrl_init(void) ...@@ -577,7 +574,6 @@ int bbc_envctrl_init(void)
int temp_index = 0; int temp_index = 0;
int fan_index = 0; int fan_index = 0;
int devidx = 0; int devidx = 0;
int err = 0;
while ((echild = bbc_i2c_getdev(devidx++)) != NULL) { while ((echild = bbc_i2c_getdev(devidx++)) != NULL) {
if (!strcmp(echild->prom_name, "temperature")) if (!strcmp(echild->prom_name, "temperature"))
...@@ -585,9 +581,13 @@ int bbc_envctrl_init(void) ...@@ -585,9 +581,13 @@ int bbc_envctrl_init(void)
if (!strcmp(echild->prom_name, "fan-control")) if (!strcmp(echild->prom_name, "fan-control"))
attach_one_fan(echild, fan_index++); attach_one_fan(echild, fan_index++);
} }
if (temp_index != 0 && fan_index != 0) if (temp_index != 0 && fan_index != 0) {
err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld");
return err; if (IS_ERR(kenvctrld_task))
return PTR_ERR(kenvctrld_task);
}
return 0;
} }
static void destroy_one_temp(struct bbc_cpu_temperature *tp) static void destroy_one_temp(struct bbc_cpu_temperature *tp)
...@@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void) ...@@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void)
struct bbc_cpu_temperature *tp; struct bbc_cpu_temperature *tp;
struct bbc_fan_control *fp; struct bbc_fan_control *fp;
if (kenvctrld_task != NULL) { kthread_stop(kenvctrld_task);
force_sig(SIGKILL, kenvctrld_task);
for (;;) {
struct task_struct *p;
int found = 0;
read_lock(&tasklist_lock);
for_each_process(p) {
if (p == kenvctrld_task) {
found = 1;
break;
}
}
read_unlock(&tasklist_lock);
if (!found)
break;
msleep(1000);
}
kenvctrld_task = NULL;
}
tp = all_bbc_temps; tp = all_bbc_temps;
while (tp != NULL) { while (tp != NULL) {
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/ioport.h> #include <linux/ioport.h>
...@@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused) ...@@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused)
poll_interval = 5000; /* TODO env_mon_interval */ poll_interval = 5000; /* TODO env_mon_interval */
daemonize("kenvctrld");
allow_signal(SIGKILL);
kenvctrld_task = current;
printk(KERN_INFO "envctrl: %s starting...\n", current->comm); printk(KERN_INFO "envctrl: %s starting...\n", current->comm);
for (;;) { for (;;) {
if(msleep_interruptible(poll_interval)) msleep_interruptible(poll_interval);
break;
if (kthread_should_stop())
break;
for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) { for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {
if (0 < envctrl_read_cpu_info(whichcpu, cputemp, if (0 < envctrl_read_cpu_info(whichcpu, cputemp,
ENVCTRL_CPUTEMP_MON, ENVCTRL_CPUTEMP_MON,
...@@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused) ...@@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused)
static int __init envctrl_init(void) static int __init envctrl_init(void)
{ {
#ifdef CONFIG_PCI
struct linux_ebus *ebus = NULL; struct linux_ebus *ebus = NULL;
struct linux_ebus_device *edev = NULL; struct linux_ebus_device *edev = NULL;
struct linux_ebus_child *edev_child = NULL; struct linux_ebus_child *edev_child = NULL;
...@@ -1118,9 +1115,11 @@ static int __init envctrl_init(void) ...@@ -1118,9 +1115,11 @@ static int __init envctrl_init(void)
i2c_childlist[i].addr, (0 == i) ? ("\n") : (" ")); i2c_childlist[i].addr, (0 == i) ? ("\n") : (" "));
} }
err = kernel_thread(kenvctrld, NULL, CLONE_FS | CLONE_FILES); kenvctrld_task = kthread_run(kenvctrld, NULL, "kenvctrld");
if (err < 0) if (IS_ERR(kenvctrld_task)) {
err = PTR_ERR(kenvctrld_task);
goto out_deregister; goto out_deregister;
}
return 0; return 0;
...@@ -1133,37 +1132,13 @@ static int __init envctrl_init(void) ...@@ -1133,37 +1132,13 @@ static int __init envctrl_init(void)
kfree(i2c_childlist[i].tables); kfree(i2c_childlist[i].tables);
} }
return err; return err;
#else
return -ENODEV;
#endif
} }
static void __exit envctrl_cleanup(void) static void __exit envctrl_cleanup(void)
{ {
int i; int i;
if (NULL != kenvctrld_task) { kthread_stop(kenvctrld_task);
force_sig(SIGKILL, kenvctrld_task);
for (;;) {
struct task_struct *p;
int found = 0;
read_lock(&tasklist_lock);
for_each_process(p) {
if (p == kenvctrld_task) {
found = 1;
break;
}
}
read_unlock(&tasklist_lock);
if (!found)
break;
msleep(1000);
}
kenvctrld_task = NULL;
}
iounmap(i2c); iounmap(i2c);
misc_deregister(&envctrl_dev); misc_deregister(&envctrl_dev);
......
...@@ -129,8 +129,6 @@ struct vfc_dev { ...@@ -129,8 +129,6 @@ struct vfc_dev {
struct vfc_regs *phys_regs; struct vfc_regs *phys_regs;
unsigned int control_reg; unsigned int control_reg;
struct semaphore device_lock_sem; struct semaphore device_lock_sem;
struct timer_list poll_timer;
wait_queue_head_t poll_wait;
int instance; int instance;
int busy; int busy;
unsigned long which_io; unsigned long which_io;
......
...@@ -137,7 +137,6 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) ...@@ -137,7 +137,6 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance)
dev->instance=instance; dev->instance=instance;
init_MUTEX(&dev->device_lock_sem); init_MUTEX(&dev->device_lock_sem);
dev->control_reg=0; dev->control_reg=0;
init_waitqueue_head(&dev->poll_wait);
dev->busy=0; dev->busy=0;
return 0; return 0;
} }
......
...@@ -79,25 +79,10 @@ int vfc_pcf8584_init(struct vfc_dev *dev) ...@@ -79,25 +79,10 @@ int vfc_pcf8584_init(struct vfc_dev *dev)
return 0; return 0;
} }
void vfc_i2c_delay_wakeup(struct vfc_dev *dev)
{
/* Used to profile code and eliminate too many delays */
VFC_I2C_DEBUG_PRINTK(("vfc%d: Delaying\n", dev->instance));
wake_up(&dev->poll_wait);
}
void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs)
{ {
DEFINE_WAIT(wait); set_current_state(TASK_UNINTERRUPTIBLE);
init_timer(&dev->poll_timer); schedule_timeout(usecs_to_jiffies(usecs));
dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs);
dev->poll_timer.data=(unsigned long)dev;
dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup;
add_timer(&dev->poll_timer);
prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE);
schedule();
del_timer(&dev->poll_timer);
finish_wait(&dev->poll_wait, &wait);
} }
void inline vfc_i2c_delay(struct vfc_dev *dev) void inline vfc_i2c_delay(struct vfc_dev *dev)
......
...@@ -40,13 +40,15 @@ ...@@ -40,13 +40,15 @@
#define TX_NUM_FIFO 4 #define TX_NUM_FIFO 4
#define TX_BUF_SIZE 32 #define TX_BUF_SIZE 32
#define SCC_WAIT_CLOSING 100
struct uart_cpm_port { struct uart_cpm_port {
struct uart_port port; struct uart_port port;
u16 rx_nrfifos; u16 rx_nrfifos;
u16 rx_fifosize; u16 rx_fifosize;
u16 tx_nrfifos; u16 tx_nrfifos;
u16 tx_fifosize; u16 tx_fifosize;
smc_t *smcp; smc_t *smcp;
smc_uart_t *smcup; smc_uart_t *smcup;
scc_t *sccp; scc_t *sccp;
scc_uart_t *sccup; scc_uart_t *sccup;
...@@ -67,6 +69,8 @@ struct uart_cpm_port { ...@@ -67,6 +69,8 @@ struct uart_cpm_port {
int bits; int bits;
/* Keep track of 'odd' SMC2 wirings */ /* Keep track of 'odd' SMC2 wirings */
int is_portb; int is_portb;
/* wait on close if needed */
int wait_closing;
}; };
extern int cpm_uart_port_map[UART_NR]; extern int cpm_uart_port_map[UART_NR];
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2) * Maintainer: Kumar Gala (kumar.gala@freescale.com) (CPM2)
* Pantelis Antoniou (panto@intracom.gr) (CPM1) * Pantelis Antoniou (panto@intracom.gr) (CPM1)
* *
* Copyright (C) 2004 Freescale Semiconductor, Inc. * Copyright (C) 2004 Freescale Semiconductor, Inc.
* (C) 2004 Intracom, S.A. * (C) 2004 Intracom, S.A.
* *
...@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd) ...@@ -82,6 +82,17 @@ void cpm_line_cr_cmd(int line, int cmd)
void smc1_lineif(struct uart_cpm_port *pinfo) void smc1_lineif(struct uart_cpm_port *pinfo)
{ {
volatile cpm8xx_t *cp = cpmp; volatile cpm8xx_t *cp = cpmp;
(void)cp; /* fix warning */
#if defined (CONFIG_MPC885ADS)
/* Enable SMC1 transceivers */
{
cp->cp_pepar |= 0x000000c0;
cp->cp_pedir &= ~0x000000c0;
cp->cp_peso &= ~0x00000040;
cp->cp_peso |= 0x00000080;
}
#elif defined (CONFIG_MPC86XADS)
unsigned int iobits = 0x000000c0; unsigned int iobits = 0x000000c0;
if (!pinfo->is_portb) { if (!pinfo->is_portb) {
...@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo) ...@@ -93,41 +104,33 @@ void smc1_lineif(struct uart_cpm_port *pinfo)
((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits; ((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits; ((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
} }
#ifdef CONFIG_MPC885ADS
/* Enable SMC1 transceivers */
{
volatile uint __iomem *bcsr1 = ioremap(BCSR1, 4);
uint tmp;
tmp = in_be32(bcsr1);
tmp &= ~BCSR1_RS232EN_1;
out_be32(bcsr1, tmp);
iounmap(bcsr1);
}
#endif #endif
pinfo->brg = 1; pinfo->brg = 1;
} }
void smc2_lineif(struct uart_cpm_port *pinfo) void smc2_lineif(struct uart_cpm_port *pinfo)
{ {
#ifdef CONFIG_MPC885ADS
volatile cpm8xx_t *cp = cpmp; volatile cpm8xx_t *cp = cpmp;
volatile uint __iomem *bcsr1;
uint tmp;
(void)cp; /* fix warning */
#if defined (CONFIG_MPC885ADS)
cp->cp_pepar |= 0x00000c00; cp->cp_pepar |= 0x00000c00;
cp->cp_pedir &= ~0x00000c00; cp->cp_pedir &= ~0x00000c00;
cp->cp_peso &= ~0x00000400; cp->cp_peso &= ~0x00000400;
cp->cp_peso |= 0x00000800; cp->cp_peso |= 0x00000800;
#elif defined (CONFIG_MPC86XADS)
unsigned int iobits = 0x00000c00;
if (!pinfo->is_portb) {
cp->cp_pbpar |= iobits;
cp->cp_pbdir &= ~iobits;
cp->cp_pbodr &= ~iobits;
} else {
((immap_t *)IMAP_ADDR)->im_ioport.iop_papar |= iobits;
((immap_t *)IMAP_ADDR)->im_ioport.iop_padir &= ~iobits;
((immap_t *)IMAP_ADDR)->im_ioport.iop_paodr &= ~iobits;
}
/* Enable SMC2 transceivers */
bcsr1 = ioremap(BCSR1, 4);
tmp = in_be32(bcsr1);
tmp &= ~BCSR1_RS232EN_2;
out_be32(bcsr1, tmp);
iounmap(bcsr1);
#endif #endif
pinfo->brg = 2; pinfo->brg = 2;
...@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo) ...@@ -158,7 +161,7 @@ void scc4_lineif(struct uart_cpm_port *pinfo)
} }
/* /*
* Allocate DP-Ram and memory buffers. We need to allocate a transmit and * Allocate DP-Ram and memory buffers. We need to allocate a transmit and
* receive buffer descriptors from dual port ram, and a character * receive buffer descriptors from dual port ram, and a character
* buffer area from host mem. If we are allocating for the console we need * buffer area from host mem. If we are allocating for the console we need
* to do it from bootmem * to do it from bootmem
...@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) ...@@ -185,6 +188,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) + memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
if (is_con) { if (is_con) {
/* was hostalloc but changed cause it blows away the */
/* large tlb mapping when pinning the kernel area */
mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
dma_addr = 0; dma_addr = 0;
} else } else
......
...@@ -527,7 +527,7 @@ show_periodic (struct class_device *class_dev, char *buf) ...@@ -527,7 +527,7 @@ show_periodic (struct class_device *class_dev, char *buf)
p.qh->period, p.qh->period,
le32_to_cpup (&p.qh->hw_info2) le32_to_cpup (&p.qh->hw_info2)
/* uframe masks */ /* uframe masks */
& 0xffff, & (QH_CMASK | QH_SMASK),
p.qh); p.qh);
size -= temp; size -= temp;
next += temp; next += temp;
......
...@@ -222,7 +222,7 @@ __acquires(ehci->lock) ...@@ -222,7 +222,7 @@ __acquires(ehci->lock)
struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv; struct ehci_qh *qh = (struct ehci_qh *) urb->hcpriv;
/* S-mask in a QH means it's an interrupt urb */ /* S-mask in a QH means it's an interrupt urb */
if ((qh->hw_info2 & __constant_cpu_to_le32 (0x00ff)) != 0) { if ((qh->hw_info2 & __constant_cpu_to_le32 (QH_SMASK)) != 0) {
/* ... update hc-wide periodic stats (for usbfs) */ /* ... update hc-wide periodic stats (for usbfs) */
ehci_to_hcd(ehci)->self.bandwidth_int_reqs--; ehci_to_hcd(ehci)->self.bandwidth_int_reqs--;
...@@ -428,7 +428,8 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs) ...@@ -428,7 +428,8 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh, struct pt_regs *regs)
/* should be rare for periodic transfers, /* should be rare for periodic transfers,
* except maybe high bandwidth ... * except maybe high bandwidth ...
*/ */
if (qh->period) { if ((__constant_cpu_to_le32 (QH_SMASK)
& qh->hw_info2) != 0) {
intr_deschedule (ehci, qh); intr_deschedule (ehci, qh);
(void) qh_schedule (ehci, qh); (void) qh_schedule (ehci, qh);
} else } else
......
...@@ -301,7 +301,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -301,7 +301,7 @@ static int qh_link_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
dev_dbg (&qh->dev->dev, dev_dbg (&qh->dev->dev,
"link qh%d-%04x/%p start %d [%d/%d us]\n", "link qh%d-%04x/%p start %d [%d/%d us]\n",
period, le32_to_cpup (&qh->hw_info2) & 0xffff, period, le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK),
qh, qh->start, qh->usecs, qh->c_usecs); qh, qh->start, qh->usecs, qh->c_usecs);
/* high bandwidth, or otherwise every microframe */ /* high bandwidth, or otherwise every microframe */
...@@ -385,7 +385,8 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -385,7 +385,8 @@ static void qh_unlink_periodic (struct ehci_hcd *ehci, struct ehci_qh *qh)
dev_dbg (&qh->dev->dev, dev_dbg (&qh->dev->dev,
"unlink qh%d-%04x/%p start %d [%d/%d us]\n", "unlink qh%d-%04x/%p start %d [%d/%d us]\n",
qh->period, le32_to_cpup (&qh->hw_info2) & 0xffff, qh->period,
le32_to_cpup (&qh->hw_info2) & (QH_CMASK | QH_SMASK),
qh, qh->start, qh->usecs, qh->c_usecs); qh, qh->start, qh->usecs, qh->c_usecs);
/* qh->qh_next still "live" to HC */ /* qh->qh_next still "live" to HC */
...@@ -411,7 +412,7 @@ static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -411,7 +412,7 @@ static void intr_deschedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
* active high speed queues may need bigger delays... * active high speed queues may need bigger delays...
*/ */
if (list_empty (&qh->qtd_list) if (list_empty (&qh->qtd_list)
|| (__constant_cpu_to_le32 (0x0ff << 8) || (__constant_cpu_to_le32 (QH_CMASK)
& qh->hw_info2) != 0) & qh->hw_info2) != 0)
wait = 2; wait = 2;
else else
...@@ -533,7 +534,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -533,7 +534,7 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
/* reuse the previous schedule slots, if we can */ /* reuse the previous schedule slots, if we can */
if (frame < qh->period) { if (frame < qh->period) {
uframe = ffs (le32_to_cpup (&qh->hw_info2) & 0x00ff); uframe = ffs (le32_to_cpup (&qh->hw_info2) & QH_SMASK);
status = check_intr_schedule (ehci, frame, --uframe, status = check_intr_schedule (ehci, frame, --uframe,
qh, &c_mask); qh, &c_mask);
} else { } else {
...@@ -569,10 +570,10 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -569,10 +570,10 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
qh->start = frame; qh->start = frame;
/* reset S-frame and (maybe) C-frame masks */ /* reset S-frame and (maybe) C-frame masks */
qh->hw_info2 &= __constant_cpu_to_le32 (~0xffff); qh->hw_info2 &= __constant_cpu_to_le32(~(QH_CMASK | QH_SMASK));
qh->hw_info2 |= qh->period qh->hw_info2 |= qh->period
? cpu_to_le32 (1 << uframe) ? cpu_to_le32 (1 << uframe)
: __constant_cpu_to_le32 (0xff); : __constant_cpu_to_le32 (QH_SMASK);
qh->hw_info2 |= c_mask; qh->hw_info2 |= c_mask;
} else } else
ehci_dbg (ehci, "reused qh %p schedule\n", qh); ehci_dbg (ehci, "reused qh %p schedule\n", qh);
......
...@@ -385,6 +385,11 @@ struct ehci_qh { ...@@ -385,6 +385,11 @@ struct ehci_qh {
__le32 hw_info1; /* see EHCI 3.6.2 */ __le32 hw_info1; /* see EHCI 3.6.2 */
#define QH_HEAD 0x00008000 #define QH_HEAD 0x00008000
__le32 hw_info2; /* see EHCI 3.6.2 */ __le32 hw_info2; /* see EHCI 3.6.2 */
#define QH_SMASK 0x000000ff
#define QH_CMASK 0x0000ff00
#define QH_HUBADDR 0x007f0000
#define QH_HUBPORT 0x3f800000
#define QH_MULT 0xc0000000
__le32 hw_current; /* qtd list - see EHCI 3.6.4 */ __le32 hw_current; /* qtd list - see EHCI 3.6.4 */
/* qtd overlay (hardware parts of a struct ehci_qtd) */ /* qtd overlay (hardware parts of a struct ehci_qtd) */
......
...@@ -229,9 +229,11 @@ static void preproc_atl_queue(struct isp116x *isp116x) ...@@ -229,9 +229,11 @@ static void preproc_atl_queue(struct isp116x *isp116x)
struct isp116x_ep *ep; struct isp116x_ep *ep;
struct urb *urb; struct urb *urb;
struct ptd *ptd; struct ptd *ptd;
u16 toggle = 0, dir = PTD_DIR_SETUP, len; u16 len;
for (ep = isp116x->atl_active; ep; ep = ep->active) { for (ep = isp116x->atl_active; ep; ep = ep->active) {
u16 toggle = 0, dir = PTD_DIR_SETUP;
BUG_ON(list_empty(&ep->hep->urb_list)); BUG_ON(list_empty(&ep->hep->urb_list));
urb = container_of(ep->hep->urb_list.next, urb = container_of(ep->hep->urb_list.next,
struct urb, urb_list); struct urb, urb_list);
......
...@@ -9,9 +9,8 @@ config USB_MON ...@@ -9,9 +9,8 @@ config USB_MON
help help
If you say Y here, a component which captures the USB traffic If you say Y here, a component which captures the USB traffic
between peripheral-specific drivers and HC drivers will be built. between peripheral-specific drivers and HC drivers will be built.
The USB_MON is similar in spirit and may be compatible with Dave For more information, see <file:Documentation/usb/usbmon.txt>.
Harding's USBMon.
This is somewhat experimental at this time, but it should be safe, This is somewhat experimental at this time, but it should be safe.
as long as you aren't using modular USB and try to remove this
module. If unsure, say Y.
...@@ -4,4 +4,5 @@ ...@@ -4,4 +4,5 @@
usbmon-objs := mon_main.o mon_stat.o mon_text.o usbmon-objs := mon_main.o mon_stat.o mon_text.o
# This does not use CONFIG_USB_MON because we want this to use a tristate.
obj-$(CONFIG_USB) += usbmon.o obj-$(CONFIG_USB) += usbmon.o
...@@ -246,6 +246,11 @@ static const struct fb_videomode modedb[] = { ...@@ -246,6 +246,11 @@ static const struct fb_videomode modedb[] = {
/* 480x300 @ 72 Hz, 48.0 kHz hsync */ /* 480x300 @ 72 Hz, 48.0 kHz hsync */
NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3, NULL, 72, 480, 300, 33386, 40, 24, 11, 19, 80, 3,
0, FB_VMODE_DOUBLE 0, FB_VMODE_DOUBLE
}, {
/* 1920x1200 @ 60 Hz, 74.5 Khz hsync */
NULL, 60, 1920, 1200, 5177, 128, 336, 1, 38, 208, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED
}, },
}; };
......
...@@ -1324,6 +1324,13 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info) ...@@ -1324,6 +1324,13 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
fb_videomode_to_var(&nvidiafb_default_var, &modedb); fb_videomode_to_var(&nvidiafb_default_var, &modedb);
nvidiafb_default_var.bits_per_pixel = 8; nvidiafb_default_var.bits_per_pixel = 8;
} else if (par->fpWidth && par->fpHeight) {
char buf[16];
memset(buf, 0, 16);
snprintf(buf, 15, "%dx%d", par->fpWidth, par->fpHeight);
fb_find_mode(&nvidiafb_default_var, info, buf, specs->modedb,
specs->modedb_len, &modedb, 8);
} }
if (mode_option) if (mode_option)
......
...@@ -598,7 +598,7 @@ sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, ...@@ -598,7 +598,7 @@ sa1100fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
* requests for the LCD controller. If we hit this, it means we're * requests for the LCD controller. If we hit this, it means we're
* doing nothing but LCD DMA. * doing nothing but LCD DMA.
*/ */
static unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var) static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var)
{ {
/* /*
* Period = pixclock * bits_per_byte * bytes_per_transfer * Period = pixclock * bits_per_byte * bytes_per_transfer
......
...@@ -248,17 +248,13 @@ inline void __bio_clone(struct bio *bio, struct bio *bio_src) ...@@ -248,17 +248,13 @@ inline void __bio_clone(struct bio *bio, struct bio *bio_src)
{ {
request_queue_t *q = bdev_get_queue(bio_src->bi_bdev); request_queue_t *q = bdev_get_queue(bio_src->bi_bdev);
memcpy(bio->bi_io_vec, bio_src->bi_io_vec, bio_src->bi_max_vecs * sizeof(struct bio_vec)); memcpy(bio->bi_io_vec, bio_src->bi_io_vec,
bio_src->bi_max_vecs * sizeof(struct bio_vec));
bio->bi_sector = bio_src->bi_sector; bio->bi_sector = bio_src->bi_sector;
bio->bi_bdev = bio_src->bi_bdev; bio->bi_bdev = bio_src->bi_bdev;
bio->bi_flags |= 1 << BIO_CLONED; bio->bi_flags |= 1 << BIO_CLONED;
bio->bi_rw = bio_src->bi_rw; bio->bi_rw = bio_src->bi_rw;
/*
* notes -- maybe just leave bi_idx alone. assume identical mapping
* for the clone
*/
bio->bi_vcnt = bio_src->bi_vcnt; bio->bi_vcnt = bio_src->bi_vcnt;
bio->bi_size = bio_src->bi_size; bio->bi_size = bio_src->bi_size;
bio->bi_idx = bio_src->bi_idx; bio->bi_idx = bio_src->bi_idx;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/fsnotify.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
...@@ -101,6 +102,7 @@ static inline void dentry_iput(struct dentry * dentry) ...@@ -101,6 +102,7 @@ static inline void dentry_iput(struct dentry * dentry)
list_del_init(&dentry->d_alias); list_del_init(&dentry->d_alias);
spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
fsnotify_inoderemove(inode);
if (dentry->d_op && dentry->d_op->d_iput) if (dentry->d_op && dentry->d_op->d_iput)
dentry->d_op->d_iput(dentry, inode); dentry->d_op->d_iput(dentry, inode);
else else
...@@ -1165,13 +1167,16 @@ int d_validate(struct dentry *dentry, struct dentry *dparent) ...@@ -1165,13 +1167,16 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
void d_delete(struct dentry * dentry) void d_delete(struct dentry * dentry)
{ {
int isdir = 0;
/* /*
* Are we the only user? * Are we the only user?
*/ */
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
spin_lock(&dentry->d_lock); spin_lock(&dentry->d_lock);
isdir = S_ISDIR(dentry->d_inode->i_mode);
if (atomic_read(&dentry->d_count) == 1) { if (atomic_read(&dentry->d_count) == 1) {
dentry_iput(dentry); dentry_iput(dentry);
fsnotify_nameremove(dentry, isdir);
return; return;
} }
...@@ -1180,6 +1185,8 @@ void d_delete(struct dentry * dentry) ...@@ -1180,6 +1185,8 @@ void d_delete(struct dentry * dentry)
spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
fsnotify_nameremove(dentry, isdir);
} }
static void __d_rehash(struct dentry * entry, struct hlist_head *list) static void __d_rehash(struct dentry * entry, struct hlist_head *list)
......
...@@ -129,8 +129,14 @@ static int zisofs_readpage(struct file *file, struct page *page) ...@@ -129,8 +129,14 @@ static int zisofs_readpage(struct file *file, struct page *page)
cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask))); cend = le32_to_cpu(*(__le32 *)(bh->b_data + (blockendptr & bufmask)));
brelse(bh); brelse(bh);
if (cstart > cend)
goto eio;
csize = cend-cstart; csize = cend-cstart;
if (csize > deflateBound(1UL << zisofs_block_shift))
goto eio;
/* Now page[] contains an array of pages, any of which can be NULL, /* Now page[] contains an array of pages, any of which can be NULL,
and the locks on which we hold. We should now read the data and and the locks on which we hold. We should now read the data and
release the pages. If the pages are NULL the decompressed data release the pages. If the pages are NULL the decompressed data
......
...@@ -1802,7 +1802,6 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -1802,7 +1802,6 @@ int vfs_rmdir(struct inode *dir, struct dentry *dentry)
up(&dentry->d_inode->i_sem); up(&dentry->d_inode->i_sem);
if (!error) { if (!error) {
d_delete(dentry); d_delete(dentry);
fsnotify_rmdir(dentry, dentry->d_inode, dir);
} }
dput(dentry); dput(dentry);
...@@ -1874,14 +1873,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1874,14 +1873,7 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
/* We don't d_delete() NFS sillyrenamed files--they still exist. */ /* We don't d_delete() NFS sillyrenamed files--they still exist. */
if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) { if (!error && !(dentry->d_flags & DCACHE_NFSFS_RENAMED)) {
#if defined(CONFIG_INOTIFY) || defined(CONFIG_DNOTIFY)
dget(dentry);
d_delete(dentry); d_delete(dentry);
fsnotify_unlink(dentry, dir);
dput(dentry);
#else
d_delete(dentry);
#endif
} }
return error; return error;
......
...@@ -160,7 +160,7 @@ clone_mnt(struct vfsmount *old, struct dentry *root) ...@@ -160,7 +160,7 @@ clone_mnt(struct vfsmount *old, struct dentry *root)
mnt->mnt_root = dget(root); mnt->mnt_root = dget(root);
mnt->mnt_mountpoint = mnt->mnt_root; mnt->mnt_mountpoint = mnt->mnt_root;
mnt->mnt_parent = mnt; mnt->mnt_parent = mnt;
mnt->mnt_namespace = old->mnt_namespace; mnt->mnt_namespace = current->namespace;
/* stick the duplicate mount on the same expiry list /* stick the duplicate mount on the same expiry list
* as the original if that was on one */ * as the original if that was on one */
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册