···5858M: Mail patches to5959L: Mailing list that is relevant to this area6060W: Web-page with status/info6161-T: SCM tree type and URL. Type is one of: git, hg, quilt.6161+T: SCM tree type and location. Type is one of: git, hg, quilt.6262S: Status, one of the following:63636464 Supported: Someone is actually paid to look after this.···227227P: Dave Jones228228M: davej@codemonkey.org.uk229229W: http://www.codemonkey.org.uk/projects/agp/230230+T: git kernel.org:/pub/scm/linux/kernel/git/davej/agpgart.git230231S: Maintained231232232233AHA152X SCSI DRIVER···385384M: dwmw2@infradead.org386385L: linux-audit@redhat.com387386W: http://people.redhat.com/sgrubb/audit/387387+T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git388388S: Maintained389389390390AX.25 NETWORK LAYER···434432W: http://bluez.sf.net435433W: http://www.bluez.org436434W: http://www.holtmann.org/linux/bluetooth/435435+T: git kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git437436S: Maintained438437439438BLUETOOTH RFCOMM LAYER···550547M: sfrench@samba.org551548L: samba-technical@lists.samba.org552549W: http://us1.samba.org/samba/Linux_CIFS_client.html550550+T: git kernel.org:/pub/scm/linux/kernel/git/sfrench/cifs-2.6.git553551S: Supported 554552555553CIRRUS LOGIC GENERIC FBDEV DRIVER···612608M: davej@codemonkey.org.uk613609L: cpufreq@lists.linux.org.uk614610W: http://www.codemonkey.org.uk/projects/cpufreq/611611+T: git kernel.org/pub/scm/linux/kernel/davej/cpufreq.git615612S: Maintained616613617614CPUID/MSR DRIVER···646641P: David S. Miller647642M: davem@davemloft.net648643L: linux-crypto@vger.kernel.org644644+T: git kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6.git649645S: Maintained650646651647CYBERPRO FB DRIVER···11911185M: B.Zolnierkiewicz@elka.pw.edu.pl11921186L: linux-kernel@vger.kernel.org11931187L: linux-ide@vger.kernel.org11881188+T: git kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git11941189S: Maintained1195119011961191IDE/ATAPI CDROM DRIVER···12861279M: vojtech@suse.cz12871280L: linux-input@atrey.karlin.mff.cuni.cz12881281L: linux-joystick@atrey.karlin.mff.cuni.cz12821282+T: git kernel.org:/pub/scm/linux/kernel/git/dtor/input.git12891283S: Maintained1290128412911285INOTIFY···14001392M: kai.germaschewski@gmx.de14011393L: isdn4linux@listserv.isdn4linux.de14021394W: http://www.isdn4linux.de13951395+T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git14031396S: Maintained1404139714051398ISDN SUBSYSTEM (Eicon active card driver)···14291420M: shaggy@austin.ibm.com14301421L: jfs-discussion@lists.sourceforge.net14311422W: http://jfs.sourceforge.net/14231423+T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git14321424S: Supported1433142514341426KCONFIG···15441534M: paulus@samba.org15451535W: http://www.penguinppc.org/15461536L: linuxppc-dev@ozlabs.org15371537+T: git kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc.git15471538S: Supported1548153915491540LINUX FOR POWER MACINTOSH···16121601M: chrisw@osdl.org16131602L: linux-security-module@wirex.com16141603W: http://lsm.immunix.org16041604+T: git kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git16151605S: Supported1616160616171607LM83 HARDWARE MONITOR DRIVER···17071695M: dwmw2@infradead.org17081696W: http://www.linux-mtd.infradead.org/17091697L: linux-mtd@lists.infradead.org16981698+T: git kernel.org:/pub/scm/linux/kernel/git/tglx/mtd-2.6.git17101699S: Maintained1711170017121701MICROTEK X6 SCANNER···18281815P: Patrick McHardy18291816M: kaber@coreworks.de18301817L: netdev@vger.kernel.org18181818+T: git kernel.org:/pub/scm/linux/kernel/davem/net-2.6.git18311819S: Maintained1832182018331821IPVS···18801866L: linux-ntfs-dev@lists.sourceforge.net18811867L: linux-kernel@vger.kernel.org18821868W: http://linux-ntfs.sf.net/18691869+T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git18831870S: Maintained1884187118851872NVIDIA (RIVA) FRAMEBUFFER DRIVER···24042389M: anton@samba.org24052390L: sparclinux@vger.kernel.org24062391L: ultralinux@vger.kernel.org23922392+T: git kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6.git24072393S: Maintained2408239424092395SHARP LH SUPPORT (LH7952X & LH7A40X)···25432527M: trivial@kernel.org25442528L: linux-kernel@vger.kernel.org25452529W: http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/25302530+T: git kernel.org:/pub/scm/linux/kernel/git/bunk/trivial.git25462531S: Maintained2547253225482533TMS380 TOKEN-RING NETWORK DRIVER···28772860M: lucho@ionkov.net28782861L: v9fs-developer@lists.sourceforge.net28792862W: http://v9fs.sf.net28632863+T: git kernel.org:/pub/scm/linux/kernel/ericvh/v9fs-devel.git28802864S: Maintained2881286528822866VIDEO FOR LINUX
-7
arch/i386/kernel/process.c
···393393{394394 struct task_struct *tsk = current;395395396396- /*397397- * Remove function-return probe instances associated with this task398398- * and put them back on the free list. Do not insert an exit probe for399399- * this function, it will be disabled by kprobe_flush_task if you do.400400- */401401- kprobe_flush_task(tsk);402402-403396 memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);404397 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); 405398 /*
+2-2
arch/i386/pci/common.c
···132132 }133133 }134134135135- printk("PCI: Probing PCI hardware (bus %02x)\n", busnum);135135+ printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum);136136137137 return pci_scan_bus_parented(NULL, busnum, &pci_root_ops, NULL);138138}···144144 struct cpuinfo_x86 *c = &boot_cpu_data;145145146146 if (!raw_pci_ops) {147147- printk("PCI: System does not support PCI\n");147147+ printk(KERN_WARNING "PCI: System does not support PCI\n");148148 return 0;149149 }150150
···221221 continue;222222223223 r = &dev->resource[idx];224224+ if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))225225+ continue;226226+ if ((idx == PCI_ROM_RESOURCE) &&227227+ (!(r->flags & IORESOURCE_ROM_ENABLE)))228228+ continue;224229 if (!r->start && r->end) {225230 printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));226231 return -EINVAL;···235230 if (r->flags & IORESOURCE_MEM)236231 cmd |= PCI_COMMAND_MEMORY;237232 }238238- if (dev->resource[PCI_ROM_RESOURCE].start)239239- cmd |= PCI_COMMAND_MEMORY;240233 if (cmd != old_cmd) {241234 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);242235 pci_write_config_word(dev, PCI_COMMAND, cmd);
-7
arch/ia64/kernel/process.c
···718718void719719flush_thread (void)720720{721721- /*722722- * Remove function-return probe instances associated with this task723723- * and put them back on the free list. Do not insert an exit probe for724724- * this function, it will be disabled by kprobe_flush_task if you do.725725- */726726- kprobe_flush_task(current);727727-728721 /* drop floating-point and debug-register state if it exists: */729722 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);730723 ia64_drop_fpu(current);
-1
arch/powerpc/kernel/process.c
···457457 if (t->flags & _TIF_ABI_PENDING)458458 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT);459459#endif460460- kprobe_flush_task(current);461460462461#ifndef CONFIG_SMP463462 if (last_task_used_math == current)
-4
arch/powerpc/mm/4xx_mmu.c
···110110 pmd_t *pmdp;111111 unsigned long val = p | _PMD_SIZE_16M | _PAGE_HWEXEC | _PAGE_HWWRITE;112112113113- spin_lock(&init_mm.page_table_lock);114113 pmdp = pmd_offset(pgd_offset_k(v), v);115114 pmd_val(*pmdp++) = val;116115 pmd_val(*pmdp++) = val;117116 pmd_val(*pmdp++) = val;118117 pmd_val(*pmdp++) = val;119119- spin_unlock(&init_mm.page_table_lock);120118121119 v += LARGE_PAGE_SIZE_16M;122120 p += LARGE_PAGE_SIZE_16M;···125127 pmd_t *pmdp;126128 unsigned long val = p | _PMD_SIZE_4M | _PAGE_HWEXEC | _PAGE_HWWRITE;127129128128- spin_lock(&init_mm.page_table_lock);129130 pmdp = pmd_offset(pgd_offset_k(v), v);130131 pmd_val(*pmdp) = val;131131- spin_unlock(&init_mm.page_table_lock);132132133133 v += LARGE_PAGE_SIZE_4M;134134 p += LARGE_PAGE_SIZE_4M;
+4-6
arch/powerpc/mm/hugetlbpage.c
···287287288288int prepare_hugepage_range(unsigned long addr, unsigned long len)289289{290290- int err;290290+ int err = 0;291291292292 if ( (addr+len) < addr )293293 return -EINVAL;294294295295- if ((addr + len) < 0x100000000UL)295295+ if (addr < 0x100000000UL)296296 err = open_low_hpage_areas(current->mm,297297 LOW_ESID_MASK(addr, len));298298- else298298+ if ((addr + len) >= 0x100000000UL)299299 err = open_high_hpage_areas(current->mm,300300 HTLB_AREA_MASK(addr, len));301301 if (err) {···754754 }755755756756 /*757757- * No need to use ldarx/stdcx here because all who758758- * might be updating the pte will hold the759759- * page_table_lock757757+ * No need to use ldarx/stdcx here760758 */761759 *ptep = __pte(new_pte & ~_PAGE_BUSY);762760
+1-1
arch/powerpc/mm/mem.c
···495495 * We use it to preload an HPTE into the hash table corresponding to496496 * the updated linux PTE.497497 * 498498- * This must always be called with the mm->page_table_lock held498498+ * This must always be called with the pte lock held.499499 */500500void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,501501 pte_t pte)
+6
arch/powerpc/mm/tlb_32.c
···149149 return;150150 }151151152152+ /*153153+ * It is safe to go down the mm's list of vmas when called154154+ * from dup_mmap, holding mmap_sem. It would also be safe from155155+ * unmap_region or exit_mmap, but not from vmtruncate on SMP -156156+ * but it seems dup_mmap is the only SMP case which gets here.157157+ */152158 for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)153159 flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);154160 FINISH_FLUSH;
+2-2
arch/powerpc/mm/tlb_64.c
···95959696void pgtable_free_tlb(struct mmu_gather *tlb, pgtable_free_t pgf)9797{9898- /* This is safe as we are holding page_table_lock */9898+ /* This is safe since tlb_gather_mmu has disabled preemption */9999 cpumask_t local_cpumask = cpumask_of_cpu(smp_processor_id());100100 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);101101···206206207207void pte_free_finish(void)208208{209209- /* This is safe as we are holding page_table_lock */209209+ /* This is safe since tlb_gather_mmu has disabled preemption */210210 struct pte_freelist_batch **batchp = &__get_cpu_var(pte_freelist_cur);211211212212 if (*batchp == NULL)
-7
arch/x86_64/kernel/process.c
···351351 struct task_struct *tsk = current;352352 struct thread_info *t = current_thread_info();353353354354- /*355355- * Remove function-return probe instances associated with this task356356- * and put them back on the free list. Do not insert an exit probe for357357- * this function, it will be disabled by kprobe_flush_task if you do.358358- */359359- kprobe_flush_task(tsk);360360-361354 if (t->flags & _TIF_ABI_PENDING)362355 t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32);363356
+9-12
drivers/base/bus.c
···133133decl_subsys(bus, &ktype_bus, NULL);134134135135136136-/* Manually detach a device from it's associated driver. */136136+/* Manually detach a device from its associated driver. */137137static int driver_helper(struct device *dev, void *data)138138{139139 const char *name = data;···151151 int err = -ENODEV;152152153153 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);154154- if ((dev) &&155155- (dev->driver == drv)) {154154+ if (dev && dev->driver == drv) {156155 device_release_driver(dev);157156 err = count;158157 }159159- if (err)160160- return err;161161- return count;158158+ put_device(dev);159159+ put_bus(bus);160160+ return err;162161}163162static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);164163···174175 int err = -ENODEV;175176176177 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);177177- if ((dev) &&178178- (dev->driver == NULL)) {178178+ if (dev && dev->driver == NULL) {179179 down(&dev->sem);180180 err = driver_probe_device(drv, dev);181181 up(&dev->sem);182182- put_device(dev);183182 }184184- if (err)185185- return err;186186- return count;183183+ put_device(dev);184184+ put_bus(bus);185185+ return err;187186}188187static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);189188
+3-5
drivers/base/dd.c
···6262 * because we don't know the format of the ID structures, nor what6363 * is to be considered a match and what is not.6464 *6565- *6665 * This function returns 1 if a match is found, an error if one6766 * occurs (that is not -ENODEV or -ENXIO), and 0 otherwise.6867 *···157158 driver_probe_device(drv, dev);158159 up(&dev->sem);159160160160-161161 return 0;162162}163163···223225 struct device * dev;224226225227 for (;;) {226226- spin_lock_irq(&drv->klist_devices.k_lock);228228+ spin_lock(&drv->klist_devices.k_lock);227229 if (list_empty(&drv->klist_devices.k_list)) {228228- spin_unlock_irq(&drv->klist_devices.k_lock);230230+ spin_unlock(&drv->klist_devices.k_lock);229231 break;230232 }231233 dev = list_entry(drv->klist_devices.k_list.prev,232234 struct device, knode_driver.n_node);233235 get_device(dev);234234- spin_unlock_irq(&drv->klist_devices.k_lock);236236+ spin_unlock(&drv->klist_devices.k_lock);235237236238 down(&dev->sem);237239 if (dev->driver == drv)
-6
drivers/block/floppy.c
···37143714 USETF(FD_VERIFY);37153715 }3716371637173717- /* set underlying gendisk policy to reflect real ro/rw status */37183718- if (UTESTF(FD_DISK_WRITABLE))37193719- inode->i_bdev->bd_disk->policy = 0;37203720- else37213721- inode->i_bdev->bd_disk->policy = 1;37223722-37233717 if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL)))37243718 goto out2;37253719
+1-1
drivers/char/drm/drm_memory.c
···9595 unsigned long addr;9696 unsigned int sz;97979898- address = __get_free_pages(GFP_KERNEL, order);9898+ address = __get_free_pages(GFP_KERNEL|__GFP_COMP, order);9999 if (!address)100100 return 0;101101
···214214215215 int microcode_version;216216217217- int is_pci;218218-219217 struct {220218 u32 boxes;221219 int freelist_timeouts;···273275274276 /* starting from here on, data is preserved accross an open */275277 uint32_t flags; /* see radeon_chip_flags */278278+ int is_pci;276279} drm_radeon_private_t;277280278281typedef struct drm_radeon_buf_priv {
···178178179179/**180180 * pci_osc_control_set - commit requested control to Firmware181181+ * @handle: acpi_handle for the target ACPI object181182 * @flags: driver's requested control bits182183 *183184 * Attempt to take control from Firmware on requested control bits.
+36-2
drivers/usb/core/hcd-pci.c
···2020#include <linux/kernel.h>2121#include <linux/module.h>2222#include <linux/pci.h>2323+#include <linux/usb.h>2424+2325#include <asm/io.h>2426#include <asm/irq.h>2525-#include <linux/usb.h>2727+2828+#ifdef CONFIG_PPC_PMAC2929+#include <asm/machdep.h>3030+#include <asm/pmac_feature.h>3131+#include <asm/pci-bridge.h>3232+#include <asm/prom.h>3333+#endif26342735#include "usb.h"2836#include "hcd.h"···285277 }286278287279done:288288- if (retval == 0)280280+ if (retval == 0) {289281 dev->dev.power.power_state = PMSG_SUSPEND;282282+283283+#ifdef CONFIG_PPC_PMAC284284+ /* Disable ASIC clocks for USB */285285+ if (_machine == _MACH_Pmac) {286286+ struct device_node *of_node;287287+288288+ of_node = pci_device_to_OF_node (dev);289289+ if (of_node)290290+ pmac_call_feature(PMAC_FTR_USB_ENABLE,291291+ of_node, 0, 0);292292+ }293293+#endif294294+ }295295+290296 return retval;291297}292298EXPORT_SYMBOL (usb_hcd_pci_suspend);···322300 "can't resume, not suspended!\n");323301 return 0;324302 }303303+304304+#ifdef CONFIG_PPC_PMAC305305+ /* Reenable ASIC clocks for USB */306306+ if (_machine == _MACH_Pmac) {307307+ struct device_node *of_node;308308+309309+ of_node = pci_device_to_OF_node (dev);310310+ if (of_node)311311+ pmac_call_feature (PMAC_FTR_USB_ENABLE,312312+ of_node, 0, 1);313313+ }314314+#endif325315326316 /* NOTE: chip docs cover clean "real suspend" cases (what Linux327317 * calls "standby", "suspend to RAM", and so on). There are also
···411411 dbg_status (ehci, "ehci_stop completed", readl (&ehci->regs->status));412412}413413414414-static int ehci_run (struct usb_hcd *hcd)414414+/* one-time init, only for memory state */415415+static int ehci_init(struct usb_hcd *hcd)415416{416416- struct ehci_hcd *ehci = hcd_to_ehci (hcd);417417+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);417418 u32 temp;418419 int retval;419420 u32 hcc_params;420420- int first;421421422422- /* skip some things on restart paths */423423- first = (ehci->watchdog.data == 0);424424- if (first) {425425- init_timer (&ehci->watchdog);426426- ehci->watchdog.function = ehci_watchdog;427427- ehci->watchdog.data = (unsigned long) ehci;428428- }422422+ spin_lock_init(&ehci->lock);423423+424424+ init_timer(&ehci->watchdog);425425+ ehci->watchdog.function = ehci_watchdog;426426+ ehci->watchdog.data = (unsigned long) ehci;429427430428 /*431429 * hw default: 1K periodic list heads, one per frame.432430 * periodic_size can shrink by USBCMD update if hcc_params allows.433431 */434432 ehci->periodic_size = DEFAULT_I_TDPS;435435- if (first && (retval = ehci_mem_init (ehci, GFP_KERNEL)) < 0)433433+ if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)436434 return retval;437435438436 /* controllers may cache some of the periodic schedule ... */439439- hcc_params = readl (&ehci->caps->hcc_params);440440- if (HCC_ISOC_CACHE (hcc_params)) // full frame cache437437+ hcc_params = readl(&ehci->caps->hcc_params);438438+ if (HCC_ISOC_CACHE(hcc_params)) // full frame cache441439 ehci->i_thresh = 8;442440 else // N microframes cached443443- ehci->i_thresh = 2 + HCC_ISOC_THRES (hcc_params);441441+ ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);444442445443 ehci->reclaim = NULL;446444 ehci->reclaim_ready = 0;447445 ehci->next_uframe = -1;448448-449449- /* controller state: unknown --> reset */450450-451451- /* EHCI spec section 4.1 */452452- if ((retval = ehci_reset (ehci)) != 0) {453453- ehci_mem_cleanup (ehci);454454- return retval;455455- }456456- writel (ehci->periodic_dma, &ehci->regs->frame_list);457446458447 /*459448 * dedicate a qh for the async ring head, since we couldn't unlink···451462 * its dummy is used in hw_alt_next of many tds, to prevent the qh452463 * from automatically advancing to the next td after short reads.453464 */454454- if (first) {455455- ehci->async->qh_next.qh = NULL;456456- ehci->async->hw_next = QH_NEXT (ehci->async->qh_dma);457457- ehci->async->hw_info1 = cpu_to_le32 (QH_HEAD);458458- ehci->async->hw_token = cpu_to_le32 (QTD_STS_HALT);459459- ehci->async->hw_qtd_next = EHCI_LIST_END;460460- ehci->async->qh_state = QH_STATE_LINKED;461461- ehci->async->hw_alt_next = QTD_NEXT (ehci->async->dummy->qtd_dma);462462- }463463- writel ((u32)ehci->async->qh_dma, &ehci->regs->async_next);464464-465465- /*466466- * hcc_params controls whether ehci->regs->segment must (!!!)467467- * be used; it constrains QH/ITD/SITD and QTD locations.468468- * pci_pool consistent memory always uses segment zero.469469- * streaming mappings for I/O buffers, like pci_map_single(),470470- * can return segments above 4GB, if the device allows.471471- *472472- * NOTE: the dma mask is visible through dma_supported(), so473473- * drivers can pass this info along ... like NETIF_F_HIGHDMA,474474- * Scsi_Host.highmem_io, and so forth. It's readonly to all475475- * host side drivers though.476476- */477477- if (HCC_64BIT_ADDR (hcc_params)) {478478- writel (0, &ehci->regs->segment);479479-#if 0480480-// this is deeply broken on almost all architectures481481- if (!dma_set_mask (hcd->self.controller, DMA_64BIT_MASK))482482- ehci_info (ehci, "enabled 64bit DMA\n");483483-#endif484484- }465465+ ehci->async->qh_next.qh = NULL;466466+ ehci->async->hw_next = QH_NEXT(ehci->async->qh_dma);467467+ ehci->async->hw_info1 = cpu_to_le32(QH_HEAD);468468+ ehci->async->hw_token = cpu_to_le32(QTD_STS_HALT);469469+ ehci->async->hw_qtd_next = EHCI_LIST_END;470470+ ehci->async->qh_state = QH_STATE_LINKED;471471+ ehci->async->hw_alt_next = QTD_NEXT(ehci->async->dummy->qtd_dma);485472486473 /* clear interrupt enables, set irq latency */487474 if (log2_irq_thresh < 0 || log2_irq_thresh > 6)···472507 * make problems: throughput reduction (!), data errors...473508 */474509 if (park) {475475- park = min (park, (unsigned) 3);510510+ park = min(park, (unsigned) 3);476511 temp |= CMD_PARK;477512 temp |= park << 8;478513 }479479- ehci_info (ehci, "park %d\n", park);514514+ ehci_dbg(ehci, "park %d\n", park);480515 }481481- if (HCC_PGM_FRAMELISTLEN (hcc_params)) {516516+ if (HCC_PGM_FRAMELISTLEN(hcc_params)) {482517 /* periodic schedule size can be smaller than default */483518 temp &= ~(3 << 2);484519 temp |= (EHCI_TUNE_FLS << 2);···486521 case 0: ehci->periodic_size = 1024; break;487522 case 1: ehci->periodic_size = 512; break;488523 case 2: ehci->periodic_size = 256; break;489489- default: BUG ();524524+ default: BUG();490525 }491526 }527527+ ehci->command = temp;528528+529529+ ehci->reboot_notifier.notifier_call = ehci_reboot;530530+ register_reboot_notifier(&ehci->reboot_notifier);531531+532532+ return 0;533533+}534534+535535+/* start HC running; it's halted, ehci_init() has been run (once) */536536+static int ehci_run (struct usb_hcd *hcd)537537+{538538+ struct ehci_hcd *ehci = hcd_to_ehci (hcd);539539+ int retval;540540+ u32 temp;541541+ u32 hcc_params;542542+543543+ /* EHCI spec section 4.1 */544544+ if ((retval = ehci_reset(ehci)) != 0) {545545+ unregister_reboot_notifier(&ehci->reboot_notifier);546546+ ehci_mem_cleanup(ehci);547547+ return retval;548548+ }549549+ writel(ehci->periodic_dma, &ehci->regs->frame_list);550550+ writel((u32)ehci->async->qh_dma, &ehci->regs->async_next);551551+552552+ /*553553+ * hcc_params controls whether ehci->regs->segment must (!!!)554554+ * be used; it constrains QH/ITD/SITD and QTD locations.555555+ * pci_pool consistent memory always uses segment zero.556556+ * streaming mappings for I/O buffers, like pci_map_single(),557557+ * can return segments above 4GB, if the device allows.558558+ *559559+ * NOTE: the dma mask is visible through dma_supported(), so560560+ * drivers can pass this info along ... like NETIF_F_HIGHDMA,561561+ * Scsi_Host.highmem_io, and so forth. It's readonly to all562562+ * host side drivers though.563563+ */564564+ hcc_params = readl(&ehci->caps->hcc_params);565565+ if (HCC_64BIT_ADDR(hcc_params)) {566566+ writel(0, &ehci->regs->segment);567567+#if 0568568+// this is deeply broken on almost all architectures569569+ if (!dma_set_mask(hcd->self.controller, DMA_64BIT_MASK))570570+ ehci_info(ehci, "enabled 64bit DMA\n");571571+#endif572572+ }573573+574574+492575 // Philips, Intel, and maybe others need CMD_RUN before the493576 // root hub will detect new devices (why?); NEC doesn't494494- temp |= CMD_RUN;495495- writel (temp, &ehci->regs->command);496496- dbg_cmd (ehci, "init", temp);497497-498498- /* set async sleep time = 10 us ... ? */577577+ ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);578578+ ehci->command |= CMD_RUN;579579+ writel (ehci->command, &ehci->regs->command);580580+ dbg_cmd (ehci, "init", ehci->command);499581500582 /*501583 * Start, enabling full USB 2.0 functionality ... usb 1.1 devices···550538 * involved with the root hub. (Except where one is integrated,551539 * and there's no companion controller unless maybe for USB OTG.)552540 */553553- if (first) {554554- ehci->reboot_notifier.notifier_call = ehci_reboot;555555- register_reboot_notifier (&ehci->reboot_notifier);556556- }557557-558541 hcd->state = HC_STATE_RUNNING;559542 writel (FLAG_CF, &ehci->regs->configured_flag);560560- readl (&ehci->regs->command); /* unblock posted write */543543+ readl (&ehci->regs->command); /* unblock posted writes */561544562545 temp = HC_VERSION(readl (&ehci->caps->hc_capbase));563546 ehci_info (ehci,564564- "USB %x.%x %s, EHCI %x.%02x, driver %s\n",547547+ "USB %x.%x started, EHCI %x.%02x, driver %s\n",565548 ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f),566566- first ? "initialized" : "restarted",567549 temp >> 8, temp & 0xff, DRIVER_VERSION);568550569551 writel (INTR_MASK, &ehci->regs->intr_enable); /* Turn On Interrupts */570552571571- if (first)572572- create_debug_files (ehci);553553+ /* GRR this is run-once init(), being done every time the HC starts.554554+ * So long as they're part of class devices, we can't do it init()555555+ * since the class device isn't created that early.556556+ */557557+ create_debug_files(ehci);573558574559 return 0;575560}···645636 * stop that signaling.646637 */647638 ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);648648- mod_timer (&hcd->rh_timer,649649- ehci->reset_done [i] + 1);650639 ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);640640+ usb_hcd_resume_root_hub(hcd);651641 }652642 }653643
+7
drivers/usb/host/ehci-hub.c
···9494 msleep(5);9595 spin_lock_irq (&ehci->lock);96969797+ /* Ideally and we've got a real resume here, and no port's power9898+ * was lost. (For PCI, that means Vaux was maintained.) But we9999+ * could instead be restoring a swsusp snapshot -- so that BIOS was100100+ * the last user of the controller, not reset/pm hardware keeping101101+ * state we gave to it.102102+ */103103+97104 /* re-init operational registers in case we lost power */98105 if (readl (&ehci->regs->intr_enable) == 0) {99106 /* at least some APM implementations will try to deliver
+167-186
drivers/usb/host/ehci-pci.c
···2727/* EHCI 0.96 (and later) section 5.1 says how to kick BIOS/SMM/...2828 * off the controller (maybe it can boot from highspeed USB disks).2929 */3030-static int bios_handoff (struct ehci_hcd *ehci, int where, u32 cap)3030+static int bios_handoff(struct ehci_hcd *ehci, int where, u32 cap)3131{3232 struct pci_dev *pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);3333···4848 where, cap);4949 // some BIOS versions seem buggy...5050 // return 1;5151- ehci_warn (ehci, "continuing after BIOS bug...\n");5151+ ehci_warn(ehci, "continuing after BIOS bug...\n");5252 /* disable all SMIs, and clear "BIOS owns" flag */5353 pci_write_config_dword(pdev, where + 4, 0);5454 pci_write_config_byte(pdev, where + 2, 0);···5858 return 0;5959}60606161-/* called by khubd or root hub init threads */6262-static int ehci_pci_reset (struct usb_hcd *hcd)6161+/* called after powerup, by probe or system-pm "wakeup" */6262+static int ehci_pci_reinit(struct ehci_hcd *ehci, struct pci_dev *pdev)6363{6464- struct ehci_hcd *ehci = hcd_to_ehci (hcd);6564 u32 temp;6565+ int retval;6666 unsigned count = 256/4;67676868- spin_lock_init (&ehci->lock);6969-7070- ehci->caps = hcd->regs;7171- ehci->regs = hcd->regs + HC_LENGTH (readl (&ehci->caps->hc_capbase));7272- dbg_hcs_params (ehci, "reset");7373- dbg_hcc_params (ehci, "reset");7474-7575- /* cache this readonly data; minimize chip reads */7676- ehci->hcs_params = readl (&ehci->caps->hcs_params);7777-7878- if (hcd->self.controller->bus == &pci_bus_type) {7979- struct pci_dev *pdev = to_pci_dev(hcd->self.controller);8080-8181- switch (pdev->vendor) {8282- case PCI_VENDOR_ID_TDI:8383- if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {8484- ehci->is_tdi_rh_tt = 1;8585- tdi_reset (ehci);8686- }8787- break;8888- case PCI_VENDOR_ID_AMD:8989- /* AMD8111 EHCI doesn't work, according to AMD errata */9090- if (pdev->device == 0x7463) {9191- ehci_info (ehci, "ignoring AMD8111 (errata)\n");9292- return -EIO;9393- }9494- break;9595- case PCI_VENDOR_ID_NVIDIA:9696- /* NVidia reports that certain chips don't handle9797- * QH, ITD, or SITD addresses above 2GB. (But TD,9898- * data buffer, and periodic schedule are normal.)9999- */100100- switch (pdev->device) {101101- case 0x003c: /* MCP04 */102102- case 0x005b: /* CK804 */103103- case 0x00d8: /* CK8 */104104- case 0x00e8: /* CK8S */105105- if (pci_set_consistent_dma_mask(pdev,106106- DMA_31BIT_MASK) < 0)107107- ehci_warn (ehci, "can't enable NVidia "108108- "workaround for >2GB RAM\n");109109- break;110110- }111111- break;6868+ /* optional debug port, normally in the first BAR */6969+ temp = pci_find_capability(pdev, 0x0a);7070+ if (temp) {7171+ pci_read_config_dword(pdev, temp, &temp);7272+ temp >>= 16;7373+ if ((temp & (3 << 13)) == (1 << 13)) {7474+ temp &= 0x1fff;7575+ ehci->debug = ehci_to_hcd(ehci)->regs + temp;7676+ temp = readl(&ehci->debug->control);7777+ ehci_info(ehci, "debug port %d%s\n",7878+ HCS_DEBUG_PORT(ehci->hcs_params),7979+ (temp & DBGP_ENABLED)8080+ ? " IN USE"8181+ : "");8282+ if (!(temp & DBGP_ENABLED))8383+ ehci->debug = NULL;11284 }8585+ }11386114114- /* optional debug port, normally in the first BAR */115115- temp = pci_find_capability (pdev, 0x0a);116116- if (temp) {117117- pci_read_config_dword(pdev, temp, &temp);118118- temp >>= 16;119119- if ((temp & (3 << 13)) == (1 << 13)) {120120- temp &= 0x1fff;121121- ehci->debug = hcd->regs + temp;122122- temp = readl (&ehci->debug->control);123123- ehci_info (ehci, "debug port %d%s\n",124124- HCS_DEBUG_PORT(ehci->hcs_params),125125- (temp & DBGP_ENABLED)126126- ? " IN USE"127127- : "");128128- if (!(temp & DBGP_ENABLED))129129- ehci->debug = NULL;130130- }131131- }132132-133133- temp = HCC_EXT_CAPS (readl (&ehci->caps->hcc_params));134134- } else135135- temp = 0;8787+ temp = HCC_EXT_CAPS(readl(&ehci->caps->hcc_params));1368813789 /* EHCI 0.96 and later may have "extended capabilities" */13890 while (temp && count--) {13991 u32 cap;14092141141- pci_read_config_dword (to_pci_dev(hcd->self.controller),142142- temp, &cap);143143- ehci_dbg (ehci, "capability %04x at %02x\n", cap, temp);9393+ pci_read_config_dword(pdev, temp, &cap);9494+ ehci_dbg(ehci, "capability %04x at %02x\n", cap, temp);14495 switch (cap & 0xff) {14596 case 1: /* BIOS/SMM/... handoff */146146- if (bios_handoff (ehci, temp, cap) != 0)9797+ if (bios_handoff(ehci, temp, cap) != 0)14798 return -EOPNOTSUPP;14899 break;149100 case 0: /* illegal reserved capability */150150- ehci_warn (ehci, "illegal capability!\n");101101+ ehci_dbg(ehci, "illegal capability!\n");151102 cap = 0;152103 /* FALLTHROUGH */153104 default: /* unknown */···107156 temp = (cap >> 8) & 0xff;108157 }109158 if (!count) {110110- ehci_err (ehci, "bogus capabilities ... PCI problems!\n");159159+ ehci_err(ehci, "bogus capabilities ... PCI problems!\n");111160 return -EIO;112161 }113113- if (ehci_is_TDI(ehci))114114- ehci_reset (ehci);115162116116- ehci_port_power (ehci, 0);163163+ /* PCI Memory-Write-Invalidate cycle support is optional (uncommon) */164164+ retval = pci_set_mwi(pdev);165165+ if (!retval)166166+ ehci_dbg(ehci, "MWI active\n");167167+168168+ ehci_port_power(ehci, 0);169169+170170+ return 0;171171+}172172+173173+/* called by khubd or root hub (re)init threads; leaves HC in halt state */174174+static int ehci_pci_reset(struct usb_hcd *hcd)175175+{176176+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);177177+ struct pci_dev *pdev = to_pci_dev(hcd->self.controller);178178+ u32 temp;179179+ int retval;180180+181181+ ehci->caps = hcd->regs;182182+ ehci->regs = hcd->regs + HC_LENGTH(readl(&ehci->caps->hc_capbase));183183+ dbg_hcs_params(ehci, "reset");184184+ dbg_hcc_params(ehci, "reset");185185+186186+ /* cache this readonly data; minimize chip reads */187187+ ehci->hcs_params = readl(&ehci->caps->hcs_params);188188+189189+ retval = ehci_halt(ehci);190190+ if (retval)191191+ return retval;192192+193193+ /* NOTE: only the parts below this line are PCI-specific */194194+195195+ switch (pdev->vendor) {196196+ case PCI_VENDOR_ID_TDI:197197+ if (pdev->device == PCI_DEVICE_ID_TDI_EHCI) {198198+ ehci->is_tdi_rh_tt = 1;199199+ tdi_reset(ehci);200200+ }201201+ break;202202+ case PCI_VENDOR_ID_AMD:203203+ /* AMD8111 EHCI doesn't work, according to AMD errata */204204+ if (pdev->device == 0x7463) {205205+ ehci_info(ehci, "ignoring AMD8111 (errata)\n");206206+ return -EIO;207207+ }208208+ break;209209+ case PCI_VENDOR_ID_NVIDIA:210210+ /* NVidia reports that certain chips don't handle211211+ * QH, ITD, or SITD addresses above 2GB. (But TD,212212+ * data buffer, and periodic schedule are normal.)213213+ */214214+ switch (pdev->device) {215215+ case 0x003c: /* MCP04 */216216+ case 0x005b: /* CK804 */217217+ case 0x00d8: /* CK8 */218218+ case 0x00e8: /* CK8S */219219+ if (pci_set_consistent_dma_mask(pdev,220220+ DMA_31BIT_MASK) < 0)221221+ ehci_warn(ehci, "can't enable NVidia "222222+ "workaround for >2GB RAM\n");223223+ break;224224+ }225225+ break;226226+ }227227+228228+ if (ehci_is_TDI(ehci))229229+ ehci_reset(ehci);117230118231 /* at least the Genesys GL880S needs fixup here */119232 temp = HCS_N_CC(ehci->hcs_params) * HCS_N_PCC(ehci->hcs_params);120233 temp &= 0x0f;121234 if (temp && HCS_N_PORTS(ehci->hcs_params) > temp) {122122- ehci_dbg (ehci, "bogus port configuration: "235235+ ehci_dbg(ehci, "bogus port configuration: "123236 "cc=%d x pcc=%d < ports=%d\n",124237 HCS_N_CC(ehci->hcs_params),125238 HCS_N_PCC(ehci->hcs_params),126239 HCS_N_PORTS(ehci->hcs_params));127240128128- if (hcd->self.controller->bus == &pci_bus_type) {129129- struct pci_dev *pdev;130130-131131- pdev = to_pci_dev(hcd->self.controller);132132- switch (pdev->vendor) {133133- case 0x17a0: /* GENESYS */134134- /* GL880S: should be PORTS=2 */135135- temp |= (ehci->hcs_params & ~0xf);136136- ehci->hcs_params = temp;137137- break;138138- case PCI_VENDOR_ID_NVIDIA:139139- /* NF4: should be PCC=10 */140140- break;141141- }241241+ switch (pdev->vendor) {242242+ case 0x17a0: /* GENESYS */243243+ /* GL880S: should be PORTS=2 */244244+ temp |= (ehci->hcs_params & ~0xf);245245+ ehci->hcs_params = temp;246246+ break;247247+ case PCI_VENDOR_ID_NVIDIA:248248+ /* NF4: should be PCC=10 */249249+ break;142250 }143251 }144252145145- /* force HC to halt state */146146- return ehci_halt (ehci);147147-}253253+ /* Serial Bus Release Number is at PCI 0x60 offset */254254+ pci_read_config_byte(pdev, 0x60, &ehci->sbrn);148255149149-static int ehci_pci_start (struct usb_hcd *hcd)150150-{151151- struct ehci_hcd *ehci = hcd_to_ehci (hcd);152152- int result = 0;256256+ /* REVISIT: per-port wake capability (PCI 0x62) currently unused */153257154154- if (hcd->self.controller->bus == &pci_bus_type) {155155- struct pci_dev *pdev;156156- u16 port_wake;258258+ retval = ehci_pci_reinit(ehci, pdev);157259158158- pdev = to_pci_dev(hcd->self.controller);159159-160160- /* Serial Bus Release Number is at PCI 0x60 offset */161161- pci_read_config_byte(pdev, 0x60, &ehci->sbrn);162162-163163- /* port wake capability, reported by boot firmware */164164- pci_read_config_word(pdev, 0x62, &port_wake);165165- hcd->can_wakeup = (port_wake & 1) != 0;166166-167167- /* help hc dma work well with cachelines */168168- result = pci_set_mwi(pdev);169169- if (result)170170- ehci_dbg(ehci, "unable to enable MWI - not fatal.\n");171171- }172172-173173- return ehci_run (hcd);174174-}175175-176176-/* always called by thread; normally rmmod */177177-178178-static void ehci_pci_stop (struct usb_hcd *hcd)179179-{180180- ehci_stop (hcd);260260+ /* finish init */261261+ return ehci_init(hcd);181262}182263183264/*-------------------------------------------------------------------------*/···218235219236/* suspend/resume, section 4.3 */220237221221-/* These routines rely on the bus (pci, platform, etc)238238+/* These routines rely on the PCI bus glue222239 * to handle powerdown and wakeup, and currently also on223240 * transceivers that don't need any software attention to set up224241 * the right sort of wakeup.242242+ * Also they depend on separate root hub suspend/resume.225243 */226244227227-static int ehci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)245245+static int ehci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)228246{229229- struct ehci_hcd *ehci = hcd_to_ehci (hcd);247247+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);230248231231- if (time_before (jiffies, ehci->next_statechange))232232- msleep (100);249249+ if (time_before(jiffies, ehci->next_statechange))250250+ msleep(10);233251234234-#ifdef CONFIG_USB_SUSPEND235235- (void) usb_suspend_device (hcd->self.root_hub);236236-#else237237- usb_lock_device (hcd->self.root_hub);238238- (void) ehci_bus_suspend (hcd);239239- usb_unlock_device (hcd->self.root_hub);240240-#endif241241-242242- // save (PCI) FLADJ in case of Vaux power loss252252+ // could save FLADJ in case of Vaux power loss243253 // ... we'd only use it to handle clock skew244254245255 return 0;246256}247257248248-static int ehci_pci_resume (struct usb_hcd *hcd)258258+static int ehci_pci_resume(struct usb_hcd *hcd)249259{250250- struct ehci_hcd *ehci = hcd_to_ehci (hcd);260260+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);251261 unsigned port;252262 struct usb_device *root = hcd->self.root_hub;263263+ struct pci_dev *pdev = to_pci_dev(hcd->self.controller);253264 int retval = -EINVAL;254265255255- // maybe restore (PCI) FLADJ266266+ // maybe restore FLADJ256267257257- if (time_before (jiffies, ehci->next_statechange))258258- msleep (100);268268+ if (time_before(jiffies, ehci->next_statechange))269269+ msleep(100);270270+271271+ /* If CF is clear, we lost PCI Vaux power and need to restart. */272272+ if (readl(&ehci->regs->configured_flag) != FLAG_CF)273273+ goto restart;259274260275 /* If any port is suspended (or owned by the companion),261276 * we know we can/must resume the HC (and mustn't reset it).277277+ * We just defer that to the root hub code.262278 */263263- for (port = HCS_N_PORTS (ehci->hcs_params); port > 0; ) {279279+ for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {264280 u32 status;265281 port--;266266- status = readl (&ehci->regs->port_status [port]);282282+ status = readl(&ehci->regs->port_status [port]);267283 if (!(status & PORT_POWER))268284 continue;269269- if (status & (PORT_SUSPEND | PORT_OWNER)) {270270- down (&hcd->self.root_hub->serialize);271271- retval = ehci_bus_resume (hcd);272272- up (&hcd->self.root_hub->serialize);273273- break;285285+ if (status & (PORT_SUSPEND | PORT_RESUME | PORT_OWNER)) {286286+ usb_hcd_resume_root_hub(hcd);287287+ return 0;274288 }289289+ }290290+291291+restart:292292+ ehci_dbg(ehci, "lost power, restarting\n");293293+ for (port = HCS_N_PORTS(ehci->hcs_params); port > 0; ) {294294+ port--;275295 if (!root->children [port])276296 continue;277277- dbg_port (ehci, __FUNCTION__, port + 1, status);278278- usb_set_device_state (root->children[port],297297+ usb_set_device_state(root->children[port],279298 USB_STATE_NOTATTACHED);280299 }281300282301 /* Else reset, to cope with power loss or flush-to-storage283283- * style "resume" having activated BIOS during reboot.302302+ * style "resume" having let BIOS kick in during reboot.284303 */285285- if (port == 0) {286286- (void) ehci_halt (ehci);287287- (void) ehci_reset (ehci);288288- (void) ehci_pci_reset (hcd);304304+ (void) ehci_halt(ehci);305305+ (void) ehci_reset(ehci);306306+ (void) ehci_pci_reinit(ehci, pdev);289307290290- /* emptying the schedule aborts any urbs */291291- spin_lock_irq (&ehci->lock);292292- if (ehci->reclaim)293293- ehci->reclaim_ready = 1;294294- ehci_work (ehci, NULL);295295- spin_unlock_irq (&ehci->lock);308308+ /* emptying the schedule aborts any urbs */309309+ spin_lock_irq(&ehci->lock);310310+ if (ehci->reclaim)311311+ ehci->reclaim_ready = 1;312312+ ehci_work(ehci, NULL);313313+ spin_unlock_irq(&ehci->lock);296314297297- /* restart; khubd will disconnect devices */298298- retval = ehci_run (hcd);315315+ /* restart; khubd will disconnect devices */316316+ retval = ehci_run(hcd);299317300300- /* here we "know" root ports should always stay powered;301301- * but some controllers may lose all power.302302- */303303- ehci_port_power (ehci, 1);304304- }318318+ /* here we "know" root ports should always stay powered */319319+ ehci_port_power(ehci, 1);305320306321 return retval;307322}···320339 * basic lifecycle operations321340 */322341 .reset = ehci_pci_reset,323323- .start = ehci_pci_start,342342+ .start = ehci_run,324343#ifdef CONFIG_PM325344 .suspend = ehci_pci_suspend,326345 .resume = ehci_pci_resume,327346#endif328328- .stop = ehci_pci_stop,347347+ .stop = ehci_stop,329348330349 /*331350 * managing i/o requests and associated device resources···358377 },359378 { /* end: all zeroes */ }360379};361361-MODULE_DEVICE_TABLE (pci, pci_ids);380380+MODULE_DEVICE_TABLE(pci, pci_ids);362381363382/* pci driver glue; this is a "new style" PCI driver module */364383static struct pci_driver ehci_pci_driver = {···374393#endif375394};376395377377-static int __init ehci_hcd_pci_init (void)396396+static int __init ehci_hcd_pci_init(void)378397{379398 if (usb_disabled())380399 return -ENODEV;381400382382- pr_debug ("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",401401+ pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",383402 hcd_name,384384- sizeof (struct ehci_qh), sizeof (struct ehci_qtd),385385- sizeof (struct ehci_itd), sizeof (struct ehci_sitd));403403+ sizeof(struct ehci_qh), sizeof(struct ehci_qtd),404404+ sizeof(struct ehci_itd), sizeof(struct ehci_sitd));386405387387- return pci_register_driver (&ehci_pci_driver);406406+ return pci_register_driver(&ehci_pci_driver);388407}389389-module_init (ehci_hcd_pci_init);408408+module_init(ehci_hcd_pci_init);390409391391-static void __exit ehci_hcd_pci_cleanup (void)410410+static void __exit ehci_hcd_pci_cleanup(void)392411{393393- pci_unregister_driver (&ehci_pci_driver);412412+ pci_unregister_driver(&ehci_pci_driver);394413}395395-module_exit (ehci_hcd_pci_cleanup);414414+module_exit(ehci_hcd_pci_cleanup);
-36
drivers/usb/host/ohci-pci.c
···1414 * This file is licenced under the GPL.1515 */16161717-#include <linux/jiffies.h>1818-1919-#ifdef CONFIG_PPC_PMAC2020-#include <asm/machdep.h>2121-#include <asm/pmac_feature.h>2222-#include <asm/pci-bridge.h>2323-#include <asm/prom.h>2424-#endif2525-2617#ifndef CONFIG_PCI2718#error "This file is PCI bus glue. CONFIG_PCI must be defined."2819#endif···106115static int ohci_pci_suspend (struct usb_hcd *hcd, pm_message_t message)107116{108117 /* root hub was already suspended */109109-110110- /* FIXME these PMAC things get called in the wrong places. ASIC111111- * clocks should be turned off AFTER entering D3, and on BEFORE112112- * trying to enter D0. Evidently the PCI layer doesn't currently113113- * provide the right sort of platform hooks for this ...114114- */115115-#ifdef CONFIG_PPC_PMAC116116- if (_machine == _MACH_Pmac) {117117- struct device_node *of_node;118118-119119- /* Disable USB PAD & cell clock */120120- of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));121121- if (of_node)122122- pmac_call_feature(PMAC_FTR_USB_ENABLE, of_node, 0, 0);123123- }124124-#endif /* CONFIG_PPC_PMAC */125118 return 0;126119}127120128121129122static int ohci_pci_resume (struct usb_hcd *hcd)130123{131131-#ifdef CONFIG_PPC_PMAC132132- if (_machine == _MACH_Pmac) {133133- struct device_node *of_node;134134-135135- /* Re-enable USB PAD & cell clock */136136- of_node = pci_device_to_OF_node (to_pci_dev(hcd->self.controller));137137- if (of_node)138138- pmac_call_feature (PMAC_FTR_USB_ENABLE, of_node, 0, 1);139139- }140140-#endif /* CONFIG_PPC_PMAC */141141-142124 usb_hcd_resume_root_hub(hcd);143125 return 0;144126}
···128128#define SEALEVEL_2803_8_PID 0X2883 /* SeaLINK+8 (2803) Port 8 */129129130130/*131131+ * The following are the values for two KOBIL chipcard terminals.132132+ */133133+#define KOBIL_VID 0x0d46 /* KOBIL Vendor ID */134134+#define KOBIL_CONV_B1_PID 0x2020 /* KOBIL Konverter for B1 */135135+#define KOBIL_CONV_KAAN_PID 0x2021 /* KOBIL_Konverter for KAAN */136136+137137+/*131138 * DSS-20 Sync Station for Sony Ericsson P800132139 */133140
···160160161161/**162162 * atomic_add_negative - add and test if negative163163- * @v: pointer of type atomic_t164163 * @i: integer value to add164164+ * @v: pointer of type atomic_t165165 * 166166 * Atomically adds @i to @v and returns true167167 * if the result is negative, or false when···177177 :"ir" (i), "m" (v->counter) : "memory");178178 return c;179179}180180+181181+/**182182+ * atomic_add_return - add and return183183+ * @i: integer value to add184184+ * @v: pointer of type atomic_t185185+ *186186+ * Atomically adds @i to @v and returns @i + @v187187+ */188188+static __inline__ int atomic_add_return(int i, atomic_t *v)189189+{190190+ int __i = i;191191+ __asm__ __volatile__(192192+ LOCK "xaddl %0, %1;"193193+ :"=r"(i)194194+ :"m"(v->counter), "0"(i));195195+ return i + __i;196196+}197197+198198+static __inline__ int atomic_sub_return(int i, atomic_t *v)199199+{200200+ return atomic_add_return(-i,v);201201+}202202+203203+#define atomic_inc_return(v) (atomic_add_return(1,v))204204+#define atomic_dec_return(v) (atomic_sub_return(1,v))180205181206/* An 64bit atomic type */182207···345320346321/**347322 * atomic64_add_negative - add and test if negative348348- * @v: pointer to atomic64_t349323 * @i: integer value to add324324+ * @v: pointer to type atomic64_t350325 *351326 * Atomically adds @i to @v and returns true352327 * if the result is negative, or false when353328 * result is greater than or equal to zero.354329 */355355-static __inline__ long atomic64_add_negative(long i, atomic64_t *v)330330+static __inline__ int atomic64_add_negative(long i, atomic64_t *v)356331{357332 unsigned char c;358333···364339}365340366341/**367367- * atomic_add_return - add and return368368- * @v: pointer of type atomic_t342342+ * atomic64_add_return - add and return369343 * @i: integer value to add344344+ * @v: pointer to type atomic64_t370345 *371346 * Atomically adds @i to @v and returns @i + @v372347 */373373-static __inline__ int atomic_add_return(int i, atomic_t *v)348348+static __inline__ long atomic64_add_return(long i, atomic64_t *v)374349{375375- int __i = i;350350+ long __i = i;376351 __asm__ __volatile__(377377- LOCK "xaddl %0, %1;"352352+ LOCK "xaddq %0, %1;"378353 :"=r"(i)379354 :"m"(v->counter), "0"(i));380355 return i + __i;381356}382357383383-static __inline__ int atomic_sub_return(int i, atomic_t *v)358358+static __inline__ long atomic64_sub_return(long i, atomic64_t *v)384359{385385- return atomic_add_return(-i,v);360360+ return atomic64_add_return(-i,v);386361}362362+363363+#define atomic64_inc_return(v) (atomic64_add_return(1,v))364364+#define atomic64_dec_return(v) (atomic64_sub_return(1,v))387365388366#define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new))389367···408380 c != (u); \409381})410382#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)411411-412412-#define atomic_inc_return(v) (atomic_add_return(1,v))413413-#define atomic_dec_return(v) (atomic_sub_return(1,v))414383415384/* These are x86-specific, used by some header files */416385#define atomic_clear_mask(mask, addr) \
···4747 * @urb_list: urbs queued to this endpoint; maintained by usbcore4848 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)4949 * with one or more transfer descriptors (TDs) per urb5050+ * @kobj: kobject for sysfs info5051 * @extra: descriptors following this endpoint in the configuration5152 * @extralen: how many bytes of "extra" are valid5253 *
-15
kernel/futex.c
···201201 * from swap. But that's a lot of code to duplicate here202202 * for a rare case, so we simply fetch the page.203203 */204204-205205- /*206206- * Do a quick atomic lookup first - this is the fastpath.207207- */208208- page = follow_page(mm, uaddr, FOLL_TOUCH|FOLL_GET);209209- if (likely(page != NULL)) {210210- key->shared.pgoff =211211- page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);212212- put_page(page);213213- return 0;214214- }215215-216216- /*217217- * Do it the general way.218218- */219204 err = get_user_pages(current, mm, uaddr, 1, 0, 0, &page, NULL);220205 if (err >= 0) {221206 key->shared.pgoff =
+15
kernel/irq/manage.c
···3636{3737 struct irq_desc *desc = irq_desc + irq;38383939+ if (irq >= NR_IRQS)4040+ return;4141+3942 while (desc->status & IRQ_INPROGRESS)4043 cpu_relax();4144}···6259{6360 irq_desc_t *desc = irq_desc + irq;6461 unsigned long flags;6262+6363+ if (irq >= NR_IRQS)6464+ return;65656666 spin_lock_irqsave(&desc->lock, flags);6767 if (!desc->depth++) {···9286{9387 irq_desc_t *desc = irq_desc + irq;94888989+ if (irq >= NR_IRQS)9090+ return;9191+9592 disable_irq_nosync(irq);9693 if (desc->action)9794 synchronize_irq(irq);···116107{117108 irq_desc_t *desc = irq_desc + irq;118109 unsigned long flags;110110+111111+ if (irq >= NR_IRQS)112112+ return;119113120114 spin_lock_irqsave(&desc->lock, flags);121115 switch (desc->depth) {···174162 struct irqaction *old, **p;175163 unsigned long flags;176164 int shared = 0;165165+166166+ if (irq >= NR_IRQS)167167+ return -EINVAL;177168178169 if (desc->handler == &no_irq_type)179170 return -ENOSYS;
+1-1
kernel/printk.c
···956956 if (console_drivers == console) {957957 console_drivers=console->next;958958 res = 0;959959- } else {959959+ } else if (console_drivers) {960960 for (a=console_drivers->next, b=console_drivers ;961961 a; b=a, a=b->next) {962962 if (a == console) {
+2-4
mm/Kconfig
···125125# space can be handled with less contention: split it at this NR_CPUS.126126# Default to 4 for wider testing, though 8 might be more appropriate.127127# ARM's adjust_pte (unused if VIPT) depends on mm-wide page_table_lock.128128-# PA-RISC's debug spinlock_t is too large for the 32-bit struct page.129129-# ARM26 and SPARC32 and PPC64 may use one page for multiple page tables.128128+# PA-RISC 7xxx's spinlock_t would enlarge struct page from 32 to 44 bytes.130129#131130config SPLIT_PTLOCK_CPUS132131 int133132 default "4096" if ARM && !CPU_CACHE_VIPT134134- default "4096" if PARISC && DEBUG_SPINLOCK && !64BIT135135- default "4096" if ARM26 || SPARC32 || PPC64133133+ default "4096" if PARISC && !PA20136134 default "4"
+3-3
mm/truncate.c
···282282 * Zap the rest of the file in one hit.283283 */284284 unmap_mapping_range(mapping,285285- page_index << PAGE_CACHE_SHIFT,286286- (end - page_index + 1)285285+ (loff_t)page_index<<PAGE_CACHE_SHIFT,286286+ (loff_t)(end - page_index + 1)287287 << PAGE_CACHE_SHIFT,288288 0);289289 did_range_unmap = 1;···292292 * Just zap this page293293 */294294 unmap_mapping_range(mapping,295295- page_index << PAGE_CACHE_SHIFT,295295+ (loff_t)page_index<<PAGE_CACHE_SHIFT,296296 PAGE_CACHE_SIZE, 0);297297 }298298 }