···246246devices/247247firmware/248248net/249249+fs/249250250251devices/ contains a filesystem representation of the device tree. It maps251252directly to the internal kernel device tree, which is a hierarchy of···264263drivers/ contains a directory for each device driver that is loaded265264for devices on that particular bus (this assumes that drivers do not266265span multiple bus types).266266+267267+fs/ contains a directory for some filesystems. Currently each268268+filesystem wanting to export attributes must create its own hierarchy269269+below fs/ (see ./fuse.txt for an example).267270268271269272More information can driver-model specific features can be found in
···43434444 .align 44545$multiword:4646- subq $24, 1, $2 # clear the final bits in the prev word4747- or $2, $24, $24646+ subq $27, 1, $2 # clear the final bits in the prev word4747+ or $2, $27, $24848 zapnot $1, $2, $14949 subq $18, 1, $185050···7070 bne $18, 0b717172721: ldq_u $1, 0($16) # clear the leading bits in the final word7373- subq $27, 1, $27474- or $2, $27, $27373+ subq $24, 1, $27474+ or $2, $24, $275757676 zap $1, $2, $17777 stq_u $1, 0($16)
···642642 return;643643}644644645645-static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,645645+static int cacheinfo_cpu_callback(struct notifier_block *nfb,646646 unsigned long action, void *hcpu)647647{648648 unsigned int cpu = (unsigned long)hcpu;
···959959 }960960}961961962962-static int __devinit palinfo_cpu_callback(struct notifier_block *nfb,962962+static int palinfo_cpu_callback(struct notifier_block *nfb,963963 unsigned long action,964964 void *hcpu)965965{
+1-1
arch/ia64/kernel/salinfo.c
···572572};573573574574#ifdef CONFIG_HOTPLUG_CPU575575-static int __devinit575575+static int576576salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)577577{578578 unsigned int i, cpu = (unsigned long)hcpu;
+1-1
arch/ia64/kernel/topology.c
···429429 * When a cpu is hot-plugged, do a check and initiate430430 * cache kobject if necessary431431 */432432-static int __cpuinit cache_cpu_callback(struct notifier_block *nfb,432432+static int cache_cpu_callback(struct notifier_block *nfb,433433 unsigned long action, void *hcpu)434434{435435 unsigned int cpu = (unsigned long)hcpu;
+2-62
arch/mips/kernel/linux32.c
···356356asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf,357357 size_t count, u32 unused, u64 a4, u64 a5)358358{359359- ssize_t ret;360360- struct file * file;361361- ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);362362- loff_t pos;363363-364364- ret = -EBADF;365365- file = fget(fd);366366- if (!file)367367- goto bad_file;368368- if (!(file->f_mode & FMODE_READ))369369- goto out;370370- pos = merge_64(a4, a5);371371- ret = rw_verify_area(READ, file, &pos, count);372372- if (ret < 0)373373- goto out;374374- ret = -EINVAL;375375- if (!file->f_op || !(read = file->f_op->read))376376- goto out;377377- if (pos < 0)378378- goto out;379379- ret = -ESPIPE;380380- if (!(file->f_mode & FMODE_PREAD))381381- goto out;382382- ret = read(file, buf, count, &pos);383383- if (ret > 0)384384- dnotify_parent(file->f_dentry, DN_ACCESS);385385-out:386386- fput(file);387387-bad_file:388388- return ret;359359+ return sys_pread64(fd, buf, count, merge_64(a4, a5));389360}390361391362asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf,392363 size_t count, u32 unused, u64 a4, u64 a5)393364{394394- ssize_t ret;395395- struct file * file;396396- ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *);397397- loff_t pos;398398-399399- ret = -EBADF;400400- file = fget(fd);401401- if (!file)402402- goto bad_file;403403- if (!(file->f_mode & FMODE_WRITE))404404- goto out;405405- pos = merge_64(a4, a5);406406- ret = rw_verify_area(WRITE, file, &pos, count);407407- if (ret < 0)408408- goto out;409409- ret = -EINVAL;410410- if (!file->f_op || !(write = file->f_op->write))411411- goto out;412412- if (pos < 0)413413- goto out;414414-415415- ret = -ESPIPE;416416- if (!(file->f_mode & FMODE_PWRITE))417417- goto out;418418-419419- ret = write(file, buf, count, &pos);420420- if (ret > 0)421421- dnotify_parent(file->f_dentry, DN_MODIFY);422422-out:423423- fput(file);424424-bad_file:425425- return ret;365365+ return sys_pwrite64(fd, buf, count, merge_64(a4, a5));426366}427367428368asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
+31
arch/parisc/Kconfig
···138138 enable this option otherwise. The 64bit kernel is significantly bigger139139 and slower than the 32bit one.140140141141+choice142142+ prompt "Kernel page size"143143+ default PARISC_PAGE_SIZE_4KB if !64BIT144144+ default PARISC_PAGE_SIZE_4KB if 64BIT145145+# default PARISC_PAGE_SIZE_16KB if 64BIT146146+147147+config PARISC_PAGE_SIZE_4KB148148+ bool "4KB"149149+ help150150+ This lets you select the page size of the kernel. For best151151+ performance, a page size of 16KB is recommended. For best152152+ compatibility with 32bit applications, a page size of 4KB should be153153+ selected (the vast majority of 32bit binaries work perfectly fine154154+ with a larger page size).155155+156156+ 4KB For best 32bit compatibility157157+ 16KB For best performance158158+ 64KB For best performance, might give more overhead.159159+160160+ If you don't know what to do, choose 4KB.161161+162162+config PARISC_PAGE_SIZE_16KB163163+ bool "16KB (EXPERIMENTAL)"164164+ depends on PA8X00 && EXPERIMENTAL165165+166166+config PARISC_PAGE_SIZE_64KB167167+ bool "64KB (EXPERIMENTAL)"168168+ depends on PA8X00 && EXPERIMENTAL169169+170170+endchoice171171+141172config SMP142173 bool "Symmetric multi-processing support"143174 ---help---
+315-179
arch/parisc/defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.16-pa644-# Sun Mar 26 19:50:07 200633+# Linux kernel version: 2.6.16-pa1044+# Sun Apr 2 15:26:38 200655#66CONFIG_PARISC=y77CONFIG_MMU=y···2525# CONFIG_LOCALVERSION_AUTO is not set2626CONFIG_SWAP=y2727CONFIG_SYSVIPC=y2828-# CONFIG_POSIX_MQUEUE is not set2828+CONFIG_POSIX_MQUEUE=y2929# CONFIG_BSD_PROCESS_ACCT is not set3030CONFIG_SYSCTL=y3131# CONFIG_AUDIT is not set···3535CONFIG_CC_OPTIMIZE_FOR_SIZE=y3636# CONFIG_EMBEDDED is not set3737CONFIG_KALLSYMS=y3838-# CONFIG_KALLSYMS_ALL is not set3838+CONFIG_KALLSYMS_ALL=y3939# CONFIG_KALLSYMS_EXTRA_PASS is not set4040CONFIG_HOTPLUG=y4141CONFIG_PRINTK=y···5757#5858# Loadable module support5959#6060-# CONFIG_MODULES is not set6060+CONFIG_MODULES=y6161+CONFIG_MODULE_UNLOAD=y6262+CONFIG_MODULE_FORCE_UNLOAD=y6363+CONFIG_OBSOLETE_MODPARM=y6464+# CONFIG_MODVERSIONS is not set6565+# CONFIG_MODULE_SRCVERSION_ALL is not set6666+CONFIG_KMOD=y61676268#6369# Block layer···8579#8680# Processor type and features8781#8888-CONFIG_PA7000=y8989-# CONFIG_PA7100LC is not set8282+# CONFIG_PA7000 is not set8383+CONFIG_PA7100LC=y9084# CONFIG_PA7200 is not set9185# CONFIG_PA7300LC is not set9286# CONFIG_PA8X00 is not set9387CONFIG_PA11=y8888+CONFIG_PARISC_PAGE_SIZE_4KB=y8989+# CONFIG_PARISC_PAGE_SIZE_16KB is not set9090+# CONFIG_PARISC_PAGE_SIZE_64KB is not set9491# CONFIG_SMP is not set9592CONFIG_ARCH_FLATMEM_ENABLE=y9696-CONFIG_PREEMPT_NONE=y9797-# CONFIG_PREEMPT_VOLUNTARY is not set9393+# CONFIG_PREEMPT_NONE is not set9494+CONFIG_PREEMPT_VOLUNTARY=y9895# CONFIG_PREEMPT is not set9996# CONFIG_HZ_100 is not set10097CONFIG_HZ_250=y···117108# Bus options (PCI, PCMCIA, EISA, GSC, ISA)118109#119110CONFIG_GSC=y120120-CONFIG_HPPB=y111111+# CONFIG_HPPB is not set121112CONFIG_IOMMU_CCIO=y122113CONFIG_GSC_LASI=y123114CONFIG_GSC_WAX=y···135126#136127# PCCARD (PCMCIA/CardBus) support137128#138138-# CONFIG_PCCARD is not set129129+CONFIG_PCCARD=y130130+# CONFIG_PCMCIA_DEBUG is not set131131+CONFIG_PCMCIA=y132132+CONFIG_PCMCIA_LOAD_CIS=y133133+CONFIG_PCMCIA_IOCTL=y134134+CONFIG_CARDBUS=y135135+136136+#137137+# PC-card bridges138138+#139139+CONFIG_YENTA=y140140+CONFIG_YENTA_O2=y141141+CONFIG_YENTA_RICOH=y142142+CONFIG_YENTA_TI=y143143+CONFIG_YENTA_ENE_TUNE=y144144+CONFIG_YENTA_TOSHIBA=y145145+CONFIG_PD6729=y146146+CONFIG_I82092=y147147+CONFIG_PCCARD_NONSTATIC=y139148140149#141150# PCI Hotplug Support···172145# Executable file formats173146#174147CONFIG_BINFMT_ELF=y175175-# CONFIG_BINFMT_MISC is not set148148+CONFIG_BINFMT_MISC=m176149177150#178151# Networking···186159CONFIG_PACKET=y187160CONFIG_PACKET_MMAP=y188161CONFIG_UNIX=y189189-# CONFIG_NET_KEY is not set162162+CONFIG_XFRM=y163163+CONFIG_XFRM_USER=m164164+CONFIG_NET_KEY=m190165CONFIG_INET=y191166CONFIG_IP_MULTICAST=y192167# CONFIG_IP_ADVANCED_ROUTER is not set193168CONFIG_IP_FIB_HASH=y194169CONFIG_IP_PNP=y195195-# CONFIG_IP_PNP_DHCP is not set170170+CONFIG_IP_PNP_DHCP=y196171CONFIG_IP_PNP_BOOTP=y197172# CONFIG_IP_PNP_RARP is not set198173# CONFIG_NET_IPIP is not set···202173# CONFIG_IP_MROUTE is not set203174# CONFIG_ARPD is not set204175# CONFIG_SYN_COOKIES is not set205205-# CONFIG_INET_AH is not set206206-# CONFIG_INET_ESP is not set176176+CONFIG_INET_AH=m177177+CONFIG_INET_ESP=m207178# CONFIG_INET_IPCOMP is not set208208-# CONFIG_INET_TUNNEL is not set209209-# CONFIG_INET_DIAG is not set179179+CONFIG_INET_TUNNEL=m180180+CONFIG_INET_DIAG=m181181+CONFIG_INET_TCP_DIAG=m210182# CONFIG_TCP_CONG_ADVANCED is not set211183CONFIG_TCP_CONG_BIC=y212184CONFIG_IPV6=y213185# CONFIG_IPV6_PRIVACY is not set214214-# CONFIG_INET6_AH is not set215215-# CONFIG_INET6_ESP is not set216216-# CONFIG_INET6_IPCOMP is not set217217-# CONFIG_INET6_TUNNEL is not set186186+CONFIG_INET6_AH=y187187+CONFIG_INET6_ESP=y188188+CONFIG_INET6_IPCOMP=y189189+CONFIG_INET6_TUNNEL=y218190# CONFIG_IPV6_TUNNEL is not set219191# CONFIG_NETFILTER is not set220192···237207# CONFIG_BRIDGE is not set238208# CONFIG_VLAN_8021Q is not set239209# CONFIG_DECNET is not set240240-# CONFIG_LLC2 is not set210210+CONFIG_LLC=m211211+CONFIG_LLC2=m241212# CONFIG_IPX is not set242213# CONFIG_ATALK is not set243214# CONFIG_X25 is not set···268237#269238# Generic Driver Options270239#271271-CONFIG_STANDALONE=y272272-CONFIG_PREVENT_FIRMWARE_BUILD=y273273-# CONFIG_FW_LOADER is not set240240+# CONFIG_STANDALONE is not set241241+# CONFIG_PREVENT_FIRMWARE_BUILD is not set242242+CONFIG_FW_LOADER=y274243# CONFIG_DEBUG_DRIVER is not set275244276245#···287256# Parallel port support288257#289258CONFIG_PARPORT=y290290-CONFIG_PARPORT_PC=y259259+CONFIG_PARPORT_PC=m291260# CONFIG_PARPORT_SERIAL is not set292261# CONFIG_PARPORT_PC_FIFO is not set293262# CONFIG_PARPORT_PC_SUPERIO is not set263263+CONFIG_PARPORT_PC_PCMCIA=m294264CONFIG_PARPORT_NOT_PC=y295265CONFIG_PARPORT_GSC=y296296-# CONFIG_PARPORT_1284 is not set266266+CONFIG_PARPORT_1284=y297267298268#299269# Plug and Play support···316284# CONFIG_BLK_DEV_UB is not set317285CONFIG_BLK_DEV_RAM=y318286CONFIG_BLK_DEV_RAM_COUNT=16319319-CONFIG_BLK_DEV_RAM_SIZE=4096287287+CONFIG_BLK_DEV_RAM_SIZE=6144320288CONFIG_BLK_DEV_INITRD=y321289# CONFIG_CDROM_PKTCDVD is not set322290# CONFIG_ATA_OVER_ETH is not set···324292#325293# ATA/ATAPI/MFM/RLL support326294#327327-# CONFIG_IDE is not set295295+CONFIG_IDE=y296296+CONFIG_BLK_DEV_IDE=y297297+298298+#299299+# Please see Documentation/ide.txt for help/info on IDE drives300300+#301301+# CONFIG_BLK_DEV_IDE_SATA is not set302302+CONFIG_BLK_DEV_IDEDISK=y303303+CONFIG_IDEDISK_MULTI_MODE=y304304+CONFIG_BLK_DEV_IDECS=y305305+CONFIG_BLK_DEV_IDECD=y306306+# CONFIG_BLK_DEV_IDETAPE is not set307307+# CONFIG_BLK_DEV_IDEFLOPPY is not set308308+CONFIG_BLK_DEV_IDESCSI=y309309+# CONFIG_IDE_TASK_IOCTL is not set310310+311311+#312312+# IDE chipset support/bugfixes313313+#314314+CONFIG_IDE_GENERIC=y315315+CONFIG_BLK_DEV_IDEPCI=y316316+CONFIG_IDEPCI_SHARE_IRQ=y317317+# CONFIG_BLK_DEV_OFFBOARD is not set318318+CONFIG_BLK_DEV_GENERIC=y319319+# CONFIG_BLK_DEV_OPTI621 is not set320320+CONFIG_BLK_DEV_IDEDMA_PCI=y321321+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set322322+# CONFIG_IDEDMA_PCI_AUTO is not set323323+# CONFIG_BLK_DEV_AEC62XX is not set324324+# CONFIG_BLK_DEV_ALI15X3 is not set325325+# CONFIG_BLK_DEV_AMD74XX is not set326326+# CONFIG_BLK_DEV_CMD64X is not set327327+# CONFIG_BLK_DEV_TRIFLEX is not set328328+# CONFIG_BLK_DEV_CY82C693 is not set329329+# CONFIG_BLK_DEV_CS5520 is not set330330+# CONFIG_BLK_DEV_CS5530 is not set331331+# CONFIG_BLK_DEV_HPT34X is not set332332+# CONFIG_BLK_DEV_HPT366 is not set333333+# CONFIG_BLK_DEV_SC1200 is not set334334+# CONFIG_BLK_DEV_PIIX is not set335335+# CONFIG_BLK_DEV_IT821X is not set336336+CONFIG_BLK_DEV_NS87415=y337337+# CONFIG_BLK_DEV_PDC202XX_OLD is not set338338+# CONFIG_BLK_DEV_PDC202XX_NEW is not set339339+# CONFIG_BLK_DEV_SVWKS is not set340340+# CONFIG_BLK_DEV_SIIMAGE is not set341341+# CONFIG_BLK_DEV_SLC90E66 is not set342342+# CONFIG_BLK_DEV_TRM290 is not set343343+# CONFIG_BLK_DEV_VIA82CXXX is not set344344+# CONFIG_IDE_ARM is not set345345+CONFIG_BLK_DEV_IDEDMA=y346346+# CONFIG_IDEDMA_IVB is not set347347+# CONFIG_IDEDMA_AUTO is not set348348+# CONFIG_BLK_DEV_HD is not set328349329350#330351# SCSI device support···460375# CONFIG_SCSI_DEBUG is not set461376462377#378378+# PCMCIA SCSI adapter support379379+#380380+# CONFIG_PCMCIA_AHA152X is not set381381+# CONFIG_PCMCIA_FDOMAIN is not set382382+# CONFIG_PCMCIA_NINJA_SCSI is not set383383+# CONFIG_PCMCIA_QLOGIC is not set384384+# CONFIG_PCMCIA_SYM53C500 is not set385385+386386+#463387# Multi-device support (RAID and LVM)464388#465389CONFIG_MD=y···476382CONFIG_MD_LINEAR=y477383CONFIG_MD_RAID0=y478384CONFIG_MD_RAID1=y479479-# CONFIG_MD_RAID10 is not set385385+CONFIG_MD_RAID10=y480386CONFIG_MD_RAID5=y481481-# CONFIG_MD_RAID6 is not set387387+CONFIG_MD_RAID6=y482388# CONFIG_MD_MULTIPATH is not set483389# CONFIG_MD_FAULTY is not set484484-# CONFIG_BLK_DEV_DM is not set390390+CONFIG_BLK_DEV_DM=y391391+# CONFIG_DM_CRYPT is not set392392+# CONFIG_DM_SNAPSHOT is not set393393+# CONFIG_DM_MIRROR is not set394394+# CONFIG_DM_ZERO is not set395395+# CONFIG_DM_MULTIPATH is not set485396486397#487398# Fusion MPT device support···510411# Network device support511412#512413CONFIG_NETDEVICES=y513513-# CONFIG_DUMMY is not set514514-# CONFIG_BONDING is not set414414+CONFIG_DUMMY=m415415+CONFIG_BONDING=m515416# CONFIG_EQUALIZER is not set516516-# CONFIG_TUN is not set417417+CONFIG_TUN=m517418518419#519420# ARCnet devices···529430# Ethernet (10 or 100Mbit)530431#531432CONFIG_NET_ETHERNET=y532532-# CONFIG_MII is not set433433+CONFIG_MII=m533434CONFIG_LASI_82596=y534435# CONFIG_HAPPYMEAL is not set535436# CONFIG_SUNGEM is not set···550451# CONFIG_WINBOND_840 is not set551452# CONFIG_DM9102 is not set552453# CONFIG_ULI526X is not set454454+# CONFIG_PCMCIA_XIRCOM is not set455455+# CONFIG_PCMCIA_XIRTULIP is not set553456# CONFIG_DEPCA is not set554457# CONFIG_HP100 is not set555458CONFIG_NET_PCI=y···619518# Obsolete Wireless cards support (pre-802.11)620519#621520# CONFIG_STRIP is not set521521+# CONFIG_PCMCIA_WAVELAN is not set522522+# CONFIG_PCMCIA_NETWAVE is not set523523+524524+#525525+# Wireless 802.11 Frequency Hopping cards support526526+#527527+# CONFIG_PCMCIA_RAYCS is not set622528623529#624530# Wireless 802.11b ISA/PCI cards support625531#626626-# CONFIG_HERMES is not set532532+CONFIG_HERMES=y533533+# CONFIG_PLX_HERMES is not set534534+# CONFIG_TMD_HERMES is not set535535+# CONFIG_NORTEL_HERMES is not set536536+# CONFIG_PCI_HERMES is not set627537# CONFIG_ATMEL is not set538538+539539+#540540+# Wireless 802.11b Pcmcia/Cardbus cards support541541+#542542+CONFIG_PCMCIA_HERMES=y543543+CONFIG_PCMCIA_SPECTRUM=y544544+# CONFIG_AIRO_CS is not set545545+# CONFIG_PCMCIA_WL3501 is not set628546629547#630548# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support···653533CONFIG_NET_WIRELESS=y654534655535#536536+# PCMCIA network device support537537+#538538+CONFIG_NET_PCMCIA=y539539+# CONFIG_PCMCIA_3C589 is not set540540+# CONFIG_PCMCIA_3C574 is not set541541+# CONFIG_PCMCIA_FMVJ18X is not set542542+# CONFIG_PCMCIA_PCNET is not set543543+# CONFIG_PCMCIA_NMCLAN is not set544544+# CONFIG_PCMCIA_SMC91C92 is not set545545+# CONFIG_PCMCIA_XIRC2PS is not set546546+# CONFIG_PCMCIA_AXNET is not set547547+548548+#656549# Wan interfaces657550#658551# CONFIG_WAN is not set659552# CONFIG_FDDI is not set660553# CONFIG_HIPPI is not set661554# CONFIG_PLIP is not set662662-# CONFIG_PPP is not set555555+CONFIG_PPP=m556556+# CONFIG_PPP_MULTILINK is not set557557+# CONFIG_PPP_FILTER is not set558558+CONFIG_PPP_ASYNC=m559559+CONFIG_PPP_SYNC_TTY=m560560+CONFIG_PPP_DEFLATE=m561561+CONFIG_PPP_BSDCOMP=m562562+# CONFIG_PPP_MPPE is not set563563+CONFIG_PPPOE=m663564# CONFIG_SLIP is not set664565# CONFIG_NET_FC is not set665566# CONFIG_SHAPER is not set···712571CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768713572# CONFIG_INPUT_JOYDEV is not set714573# CONFIG_INPUT_TSDEV is not set715715-CONFIG_INPUT_EVDEV=y574574+# CONFIG_INPUT_EVDEV is not set716575# CONFIG_INPUT_EVBUG is not set717576718577#719578# Input Device Drivers720579#721580CONFIG_INPUT_KEYBOARD=y722722-# CONFIG_KEYBOARD_ATKBD is not set581581+CONFIG_KEYBOARD_ATKBD=y582582+CONFIG_KEYBOARD_ATKBD_HP_KEYCODES=y583583+# CONFIG_KEYBOARD_ATKBD_RDI_KEYCODES is not set723584# CONFIG_KEYBOARD_SUNKBD is not set724585# CONFIG_KEYBOARD_LKKBD is not set725586# CONFIG_KEYBOARD_XTKBD is not set···729586# CONFIG_KEYBOARD_HIL_OLD is not set730587CONFIG_KEYBOARD_HIL=y731588CONFIG_INPUT_MOUSE=y732732-# CONFIG_MOUSE_PS2 is not set733733-# CONFIG_MOUSE_SERIAL is not set589589+CONFIG_MOUSE_PS2=y590590+CONFIG_MOUSE_SERIAL=y734591# CONFIG_MOUSE_VSXXXAA is not set735592CONFIG_MOUSE_HIL=y736736-CONFIG_INPUT_JOYSTICK=y737737-# CONFIG_JOYSTICK_ANALOG is not set738738-# CONFIG_JOYSTICK_A3D is not set739739-# CONFIG_JOYSTICK_ADI is not set740740-# CONFIG_JOYSTICK_COBRA is not set741741-# CONFIG_JOYSTICK_GF2K is not set742742-# CONFIG_JOYSTICK_GRIP is not set743743-# CONFIG_JOYSTICK_GRIP_MP is not set744744-# CONFIG_JOYSTICK_GUILLEMOT is not set745745-# CONFIG_JOYSTICK_INTERACT is not set746746-# CONFIG_JOYSTICK_SIDEWINDER is not set747747-# CONFIG_JOYSTICK_TMDC is not set748748-# CONFIG_JOYSTICK_IFORCE is not set749749-# CONFIG_JOYSTICK_WARRIOR is not set750750-# CONFIG_JOYSTICK_MAGELLAN is not set751751-# CONFIG_JOYSTICK_SPACEORB is not set752752-# CONFIG_JOYSTICK_SPACEBALL is not set753753-# CONFIG_JOYSTICK_STINGER is not set754754-# CONFIG_JOYSTICK_TWIDJOY is not set755755-# CONFIG_JOYSTICK_DB9 is not set756756-# CONFIG_JOYSTICK_GAMECON is not set757757-# CONFIG_JOYSTICK_TURBOGRAFX is not set758758-# CONFIG_JOYSTICK_JOYDUMP is not set759759-CONFIG_INPUT_TOUCHSCREEN=y760760-# CONFIG_TOUCHSCREEN_GUNZE is not set761761-# CONFIG_TOUCHSCREEN_ELO is not set762762-# CONFIG_TOUCHSCREEN_MTOUCH is not set763763-# CONFIG_TOUCHSCREEN_MK712 is not set764764-CONFIG_INPUT_MISC=y765765-# CONFIG_INPUT_UINPUT is not set766766-CONFIG_HP_SDC_RTC=y593593+# CONFIG_INPUT_JOYSTICK is not set594594+# CONFIG_INPUT_TOUCHSCREEN is not set595595+# CONFIG_INPUT_MISC is not set767596768597#769598# Hardware I/O ports770599#771600CONFIG_SERIO=y772772-# CONFIG_SERIO_SERPORT is not set601601+CONFIG_SERIO_SERPORT=y773602# CONFIG_SERIO_PARKBD is not set774603CONFIG_SERIO_GSCPS2=y775604CONFIG_HP_SDC=y776605CONFIG_HIL_MLC=y777606# CONFIG_SERIO_PCIPS2 is not set607607+CONFIG_SERIO_LIBPS2=y778608# CONFIG_SERIO_RAW is not set779609# CONFIG_GAMEPORT is not set780610···764648#765649CONFIG_SERIAL_8250=y766650CONFIG_SERIAL_8250_CONSOLE=y767767-CONFIG_SERIAL_8250_NR_UARTS=13651651+CONFIG_SERIAL_8250_CS=y652652+CONFIG_SERIAL_8250_NR_UARTS=17768653CONFIG_SERIAL_8250_RUNTIME_UARTS=4769654CONFIG_SERIAL_8250_EXTENDED=y770655CONFIG_SERIAL_8250_MANY_PORTS=y···783666# CONFIG_SERIAL_JSM is not set784667CONFIG_UNIX98_PTYS=y785668CONFIG_LEGACY_PTYS=y786786-CONFIG_LEGACY_PTY_COUNT=256787787-CONFIG_PRINTER=y669669+CONFIG_LEGACY_PTY_COUNT=64670670+CONFIG_PRINTER=m788671# CONFIG_LP_CONSOLE is not set789789-# CONFIG_PPDEV is not set672672+CONFIG_PPDEV=m790673# CONFIG_TIPAR is not set791674792675#···799682#800683# CONFIG_WATCHDOG is not set801684CONFIG_GEN_RTC=y802802-# CONFIG_GEN_RTC_X is not set685685+CONFIG_GEN_RTC_X=y803686# CONFIG_DTLK is not set804687# CONFIG_R3964 is not set805688# CONFIG_APPLICOM is not set···808691# Ftape, the floppy tape device driver809692#810693# CONFIG_DRM is not set694694+695695+#696696+# PCMCIA character devices697697+#698698+# CONFIG_SYNCLINK_CS is not set699699+# CONFIG_CARDMAN_4000 is not set700700+# CONFIG_CARDMAN_4040 is not set811701# CONFIG_RAW_DRIVER is not set812702813703#···842718#843719# Hardware Monitoring support844720#845845-CONFIG_HWMON=y721721+# CONFIG_HWMON is not set846722# CONFIG_HWMON_VID is not set847847-# CONFIG_SENSORS_F71805F is not set848848-# CONFIG_HWMON_DEBUG_CHIP is not set849723850724#851725# Misc devices···871749CONFIG_FB_CFB_COPYAREA=y872750CONFIG_FB_CFB_IMAGEBLIT=y873751# CONFIG_FB_MACMODES is not set874874-# CONFIG_FB_MODE_HELPERS is not set875875-# CONFIG_FB_TILEBLITTING is not set752752+CONFIG_FB_MODE_HELPERS=y753753+CONFIG_FB_TILEBLITTING=y876754# CONFIG_FB_CIRRUS is not set877755# CONFIG_FB_PM2 is not set878756# CONFIG_FB_CYBER2000 is not set···900778# Console display driver support901779#902780CONFIG_DUMMY_CONSOLE=y903903-CONFIG_DUMMY_CONSOLE_COLUMNS=160904904-CONFIG_DUMMY_CONSOLE_ROWS=64781781+CONFIG_DUMMY_CONSOLE_COLUMNS=128782782+CONFIG_DUMMY_CONSOLE_ROWS=48905783CONFIG_FRAMEBUFFER_CONSOLE=y906784# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set907785CONFIG_STI_CONSOLE=y···938816CONFIG_SND=y939817CONFIG_SND_TIMER=y940818CONFIG_SND_PCM=y819819+CONFIG_SND_HWDEP=y941820CONFIG_SND_SEQUENCER=y942821# CONFIG_SND_SEQ_DUMMY is not set943822CONFIG_SND_OSSEMUL=y944823CONFIG_SND_MIXER_OSS=y945824CONFIG_SND_PCM_OSS=y946825CONFIG_SND_SEQUENCER_OSS=y947947-# CONFIG_SND_DYNAMIC_MINORS is not set826826+CONFIG_SND_DYNAMIC_MINORS=y948827CONFIG_SND_SUPPORT_OLD_API=y949828# CONFIG_SND_VERBOSE_PRINTK is not set950829# CONFIG_SND_DEBUG is not set···953830#954831# Generic devices955832#833833+CONFIG_SND_OPL3_LIB=y956834CONFIG_SND_AC97_CODEC=y957835CONFIG_SND_AC97_BUS=y958836# CONFIG_SND_DUMMY is not set···966842# PCI devices967843#968844CONFIG_SND_AD1889=y969969-# CONFIG_SND_AD1889_OPL3 is not set845845+CONFIG_SND_AD1889_OPL3=y970846# CONFIG_SND_ALI5451 is not set971847# CONFIG_SND_ATIIXP is not set972848# CONFIG_SND_ATIIXP_MODEM is not set···1014890# CONFIG_SND_USB_AUDIO is not set10158911016892#893893+# PCMCIA devices894894+#895895+896896+#1017897# GSC devices1018898#1019899CONFIG_SND_HARMONY=y···1033905CONFIG_USB_ARCH_HAS_HCD=y1034906CONFIG_USB_ARCH_HAS_OHCI=y1035907CONFIG_USB=y10361036-CONFIG_USB_DEBUG=y908908+# CONFIG_USB_DEBUG is not set10379091038910#1039911# Miscellaneous USB options1040912#10411041-# CONFIG_USB_DEVICEFS is not set913913+CONFIG_USB_DEVICEFS=y1042914# CONFIG_USB_BANDWIDTH is not set1043915# CONFIG_USB_DYNAMIC_MINORS is not set1044916# CONFIG_USB_OTG is not set···1046918#1047919# USB Host Controller Drivers1048920#10491049-CONFIG_USB_EHCI_HCD=y10501050-# CONFIG_USB_EHCI_SPLIT_ISO is not set10511051-# CONFIG_USB_EHCI_ROOT_HUB_TT is not set921921+# CONFIG_USB_EHCI_HCD is not set1052922# CONFIG_USB_ISP116X_HCD is not set1053923CONFIG_USB_OHCI_HCD=y1054924# CONFIG_USB_OHCI_BIG_ENDIAN is not set1055925CONFIG_USB_OHCI_LITTLE_ENDIAN=y10561056-# CONFIG_USB_UHCI_HCD is not set926926+CONFIG_USB_UHCI_HCD=y1057927# CONFIG_USB_SL811_HCD is not set10589281059929#···1074948#1075949# USB Input Devices1076950#10771077-# CONFIG_USB_HID is not set10781078-10791079-#10801080-# USB HID Boot Protocol drivers10811081-#10821082-# CONFIG_USB_KBD is not set10831083-# CONFIG_USB_MOUSE is not set951951+CONFIG_USB_HID=y952952+CONFIG_USB_HIDINPUT=y953953+# CONFIG_USB_HIDINPUT_POWERBOOK is not set954954+# CONFIG_HID_FF is not set955955+# CONFIG_USB_HIDDEV is not set1084956# CONFIG_USB_AIPTEK is not set1085957# CONFIG_USB_WACOM is not set1086958# CONFIG_USB_ACECAD is not set···11441020# CONFIG_USB_PHIDGETKIT is not set11451021# CONFIG_USB_PHIDGETSERVO is not set11461022# CONFIG_USB_IDMOUSE is not set11471147-# CONFIG_USB_SISUSBVGA is not set11481023# CONFIG_USB_LD is not set10241024+# CONFIG_USB_TEST is not set1149102511501026#11511027# USB DSL modem support···11821058# CONFIG_JBD_DEBUG is not set11831059# CONFIG_REISERFS_FS is not set11841060# CONFIG_JFS_FS is not set11851185-# CONFIG_FS_POSIX_ACL is not set10611061+CONFIG_FS_POSIX_ACL=y11861062# CONFIG_XFS_FS is not set11871063# CONFIG_OCFS2_FS is not set11881064# CONFIG_MINIX_FS is not set···11901066CONFIG_INOTIFY=y11911067# CONFIG_QUOTA is not set11921068CONFIG_DNOTIFY=y11931193-# CONFIG_AUTOFS_FS is not set10691069+CONFIG_AUTOFS_FS=y11941070# CONFIG_AUTOFS4_FS is not set11951071# CONFIG_FUSE_FS is not set11961072···12051081#12061082# DOS/FAT/NT Filesystems12071083#10841084+CONFIG_FAT_FS=y12081085# CONFIG_MSDOS_FS is not set12091209-# CONFIG_VFAT_FS is not set10861086+CONFIG_VFAT_FS=y10871087+CONFIG_FAT_DEFAULT_CODEPAGE=43710881088+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"12101089# CONFIG_NTFS_FS is not set1211109012121091#···12521125CONFIG_NFSD=y12531126CONFIG_NFSD_V3=y12541127# CONFIG_NFSD_V3_ACL is not set12551255-# CONFIG_NFSD_V4 is not set11281128+CONFIG_NFSD_V4=y12561129CONFIG_NFSD_TCP=y12571130CONFIG_ROOT_NFS=y12581131CONFIG_LOCKD=y···12601133CONFIG_EXPORTFS=y12611134CONFIG_NFS_COMMON=y12621135CONFIG_SUNRPC=y12631263-# CONFIG_RPCSEC_GSS_KRB5 is not set12641264-# CONFIG_RPCSEC_GSS_SPKM3 is not set12651265-# CONFIG_SMB_FS is not set12661266-# CONFIG_CIFS is not set11361136+CONFIG_SUNRPC_GSS=y11371137+CONFIG_RPCSEC_GSS_KRB5=y11381138+CONFIG_RPCSEC_GSS_SPKM3=m11391139+CONFIG_SMB_FS=m11401140+CONFIG_SMB_NLS_DEFAULT=y11411141+CONFIG_SMB_NLS_REMOTE="cp437"11421142+CONFIG_CIFS=m11431143+# CONFIG_CIFS_STATS is not set11441144+# CONFIG_CIFS_XATTR is not set11451145+# CONFIG_CIFS_EXPERIMENTAL is not set12671146# CONFIG_NCP_FS is not set12681147# CONFIG_CODA_FS is not set12691148# CONFIG_AFS_FS is not set···12861153#12871154CONFIG_NLS=y12881155CONFIG_NLS_DEFAULT="iso8859-1"12891289-# CONFIG_NLS_CODEPAGE_437 is not set12901290-# CONFIG_NLS_CODEPAGE_737 is not set12911291-# CONFIG_NLS_CODEPAGE_775 is not set12921292-# CONFIG_NLS_CODEPAGE_850 is not set12931293-# CONFIG_NLS_CODEPAGE_852 is not set12941294-# CONFIG_NLS_CODEPAGE_855 is not set12951295-# CONFIG_NLS_CODEPAGE_857 is not set12961296-# CONFIG_NLS_CODEPAGE_860 is not set12971297-# CONFIG_NLS_CODEPAGE_861 is not set12981298-# CONFIG_NLS_CODEPAGE_862 is not set12991299-# CONFIG_NLS_CODEPAGE_863 is not set13001300-# CONFIG_NLS_CODEPAGE_864 is not set13011301-# CONFIG_NLS_CODEPAGE_865 is not set13021302-# CONFIG_NLS_CODEPAGE_866 is not set13031303-# CONFIG_NLS_CODEPAGE_869 is not set13041304-# CONFIG_NLS_CODEPAGE_936 is not set13051305-# CONFIG_NLS_CODEPAGE_950 is not set13061306-# CONFIG_NLS_CODEPAGE_932 is not set13071307-# CONFIG_NLS_CODEPAGE_949 is not set13081308-# CONFIG_NLS_CODEPAGE_874 is not set13091309-# CONFIG_NLS_ISO8859_8 is not set13101310-# CONFIG_NLS_CODEPAGE_1250 is not set13111311-# CONFIG_NLS_CODEPAGE_1251 is not set13121312-# CONFIG_NLS_ASCII is not set13131313-# CONFIG_NLS_ISO8859_1 is not set13141314-# CONFIG_NLS_ISO8859_2 is not set13151315-# CONFIG_NLS_ISO8859_3 is not set13161316-# CONFIG_NLS_ISO8859_4 is not set13171317-# CONFIG_NLS_ISO8859_5 is not set13181318-# CONFIG_NLS_ISO8859_6 is not set13191319-# CONFIG_NLS_ISO8859_7 is not set13201320-# CONFIG_NLS_ISO8859_9 is not set13211321-# CONFIG_NLS_ISO8859_13 is not set13221322-# CONFIG_NLS_ISO8859_14 is not set13231323-# CONFIG_NLS_ISO8859_15 is not set13241324-# CONFIG_NLS_KOI8_R is not set13251325-# CONFIG_NLS_KOI8_U is not set13261326-# CONFIG_NLS_UTF8 is not set11561156+CONFIG_NLS_CODEPAGE_437=y11571157+CONFIG_NLS_CODEPAGE_737=m11581158+CONFIG_NLS_CODEPAGE_775=m11591159+CONFIG_NLS_CODEPAGE_850=m11601160+CONFIG_NLS_CODEPAGE_852=m11611161+CONFIG_NLS_CODEPAGE_855=m11621162+CONFIG_NLS_CODEPAGE_857=m11631163+CONFIG_NLS_CODEPAGE_860=m11641164+CONFIG_NLS_CODEPAGE_861=m11651165+CONFIG_NLS_CODEPAGE_862=m11661166+CONFIG_NLS_CODEPAGE_863=m11671167+CONFIG_NLS_CODEPAGE_864=m11681168+CONFIG_NLS_CODEPAGE_865=m11691169+CONFIG_NLS_CODEPAGE_866=m11701170+CONFIG_NLS_CODEPAGE_869=m11711171+CONFIG_NLS_CODEPAGE_936=m11721172+CONFIG_NLS_CODEPAGE_950=m11731173+CONFIG_NLS_CODEPAGE_932=m11741174+CONFIG_NLS_CODEPAGE_949=m11751175+CONFIG_NLS_CODEPAGE_874=m11761176+CONFIG_NLS_ISO8859_8=m11771177+CONFIG_NLS_CODEPAGE_1250=y11781178+CONFIG_NLS_CODEPAGE_1251=m11791179+CONFIG_NLS_ASCII=m11801180+CONFIG_NLS_ISO8859_1=y11811181+CONFIG_NLS_ISO8859_2=m11821182+CONFIG_NLS_ISO8859_3=m11831183+CONFIG_NLS_ISO8859_4=m11841184+CONFIG_NLS_ISO8859_5=m11851185+CONFIG_NLS_ISO8859_6=m11861186+CONFIG_NLS_ISO8859_7=m11871187+CONFIG_NLS_ISO8859_9=m11881188+CONFIG_NLS_ISO8859_13=m11891189+CONFIG_NLS_ISO8859_14=m11901190+CONFIG_NLS_ISO8859_15=m11911191+CONFIG_NLS_KOI8_R=m11921192+CONFIG_NLS_KOI8_U=m11931193+CONFIG_NLS_UTF8=y1327119413281195#13291196# Profiling support13301197#13311198CONFIG_PROFILING=y13321332-CONFIG_OPROFILE=y11991199+CONFIG_OPROFILE=m1333120013341201#13351202# Kernel hacking···13371204# CONFIG_PRINTK_TIME is not set13381205CONFIG_MAGIC_SYSRQ=y13391206CONFIG_DEBUG_KERNEL=y13401340-CONFIG_LOG_BUF_SHIFT=1512071207+CONFIG_LOG_BUF_SHIFT=1613411208CONFIG_DETECT_SOFTLOCKUP=y13421209# CONFIG_SCHEDSTATS is not set13431210# CONFIG_DEBUG_SLAB is not set···13501217# CONFIG_DEBUG_VM is not set13511218CONFIG_FORCED_INLINING=y13521219# CONFIG_RCU_TORTURE_TEST is not set13531353-CONFIG_DEBUG_RODATA=y12201220+# CONFIG_DEBUG_RODATA is not set1354122113551222#13561223# Security options13571224#13581358-# CONFIG_KEYS is not set12251225+CONFIG_KEYS=y12261226+CONFIG_KEYS_DEBUG_PROC_KEYS=y13591227# CONFIG_SECURITY is not set1360122813611229#13621230# Cryptographic options13631231#13641232CONFIG_CRYPTO=y13651365-# CONFIG_CRYPTO_HMAC is not set13661366-# CONFIG_CRYPTO_NULL is not set13671367-# CONFIG_CRYPTO_MD4 is not set13681368-# CONFIG_CRYPTO_MD5 is not set13691369-# CONFIG_CRYPTO_SHA1 is not set13701370-# CONFIG_CRYPTO_SHA256 is not set13711371-# CONFIG_CRYPTO_SHA512 is not set13721372-# CONFIG_CRYPTO_WP512 is not set13731373-# CONFIG_CRYPTO_TGR192 is not set13741374-# CONFIG_CRYPTO_DES is not set13751375-# CONFIG_CRYPTO_BLOWFISH is not set13761376-# CONFIG_CRYPTO_TWOFISH is not set13771377-# CONFIG_CRYPTO_SERPENT is not set13781378-# CONFIG_CRYPTO_AES is not set13791379-# CONFIG_CRYPTO_CAST5 is not set13801380-# CONFIG_CRYPTO_CAST6 is not set13811381-# CONFIG_CRYPTO_TEA is not set13821382-# CONFIG_CRYPTO_ARC4 is not set13831383-# CONFIG_CRYPTO_KHAZAD is not set13841384-# CONFIG_CRYPTO_ANUBIS is not set13851385-# CONFIG_CRYPTO_DEFLATE is not set13861386-# CONFIG_CRYPTO_MICHAEL_MIC is not set13871387-# CONFIG_CRYPTO_CRC32C is not set13881388-# CONFIG_CRYPTO_TEST is not set12331233+CONFIG_CRYPTO_HMAC=y12341234+CONFIG_CRYPTO_NULL=m12351235+CONFIG_CRYPTO_MD4=m12361236+CONFIG_CRYPTO_MD5=y12371237+CONFIG_CRYPTO_SHA1=y12381238+CONFIG_CRYPTO_SHA256=m12391239+CONFIG_CRYPTO_SHA512=m12401240+CONFIG_CRYPTO_WP512=m12411241+CONFIG_CRYPTO_TGR192=m12421242+CONFIG_CRYPTO_DES=y12431243+CONFIG_CRYPTO_BLOWFISH=m12441244+CONFIG_CRYPTO_TWOFISH=m12451245+CONFIG_CRYPTO_SERPENT=m12461246+CONFIG_CRYPTO_AES=m12471247+CONFIG_CRYPTO_CAST5=m12481248+CONFIG_CRYPTO_CAST6=m12491249+CONFIG_CRYPTO_TEA=m12501250+CONFIG_CRYPTO_ARC4=m12511251+CONFIG_CRYPTO_KHAZAD=m12521252+CONFIG_CRYPTO_ANUBIS=m12531253+CONFIG_CRYPTO_DEFLATE=y12541254+CONFIG_CRYPTO_MICHAEL_MIC=m12551255+CONFIG_CRYPTO_CRC32C=m12561256+CONFIG_CRYPTO_TEST=m1389125713901258#13911259# Hardware crypto devices···13951261#13961262# Library routines13971263#13981398-# CONFIG_CRC_CCITT is not set12641264+CONFIG_CRC_CCITT=m13991265# CONFIG_CRC16 is not set14001266CONFIG_CRC32=y14011401-# CONFIG_LIBCRC32C is not set12671267+CONFIG_LIBCRC32C=m12681268+CONFIG_ZLIB_INFLATE=y12691269+CONFIG_ZLIB_DEFLATE=y
···44 * License. See the file "COPYING" in the main directory of this archive55 * for more details.66 *77- * Copyright (C) 1999 Helge Deller (07-13-1999)77+ * Copyright (C) 1999-2006 Helge Deller <deller@gmx.de> (07-13-1999)88 * Copyright (C) 1999 SuSE GmbH Nuernberg99 * Copyright (C) 2000 Philipp Rumpf (prumpf@tux.org)1010 *···358358 if (!parisc_cache_flush_threshold)359359 parisc_cache_flush_threshold = FLUSH_THRESHOLD;360360361361- printk("Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());361361+ printk(KERN_INFO "Setting cache flush threshold to %x (%d CPUs online)\n", parisc_cache_flush_threshold, num_online_cpus());362362}
+22-14
arch/parisc/kernel/entry.S
···502502 * all ILP32 processes and all the kernel for machines with503503 * under 4GB of memory) */504504 .macro L3_ptep pgd,pte,index,va,fault505505+#if PT_NLEVELS == 3 /* we might have a 2-Level scheme, e.g. with 16kb page size */505506 extrd,u \va,63-ASM_PGDIR_SHIFT,ASM_BITS_PER_PGD,\index506507 copy %r0,\pte507507- extrd,u,*= \va,31,32,%r0508508+ extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0508509 ldw,s \index(\pgd),\pgd509509- extrd,u,*= \va,31,32,%r0510510+ extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0510511 bb,>=,n \pgd,_PxD_PRESENT_BIT,\fault511511- extrd,u,*= \va,31,32,%r0512512+ extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0512513 shld \pgd,PxD_VALUE_SHIFT,\index513513- extrd,u,*= \va,31,32,%r0514514+ extrd,u,*= \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0514515 copy \index,\pgd515515- extrd,u,*<> \va,31,32,%r0516516+ extrd,u,*<> \va,63-ASM_PGDIR_SHIFT,64-ASM_PGDIR_SHIFT,%r0516517 ldo ASM_PGD_PMD_OFFSET(\pgd),\pgd518518+#endif517519 L2_ptep \pgd,\pte,\index,\va,\fault518520 .endm519521···565563 extrd,u,*= \pte,_PAGE_GATEWAY_BIT+32,1,%r0566564 depd %r0,11,2,\prot /* If Gateway, Set PL2 to 0 */567565568568- /* Get rid of prot bits and convert to page addr for iitlbt and idtlbt */566566+ /* Enforce uncacheable pages.567567+ * This should ONLY be use for MMIO on PA 2.0 machines.568568+ * Memory/DMA is cache coherent on all PA2.0 machines we support569569+ * (that means T-class is NOT supported) and the memory controllers570570+ * on most of those machines only handles cache transactions.571571+ */572572+ extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0573573+ depi 1,12,1,\prot569574570570- depd %r0,63,PAGE_SHIFT,\pte571571- extrd,s \pte,(63-PAGE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte575575+ /* Drop prot bits and convert to page addr for iitlbt and idtlbt */576576+ extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte577577+ depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte572578 .endm573579574580 /* Identical macro to make_insert_tlb above, except it···594584595585 /* Get rid of prot bits and convert to page addr for iitlba */596586597597- depi 0,31,PAGE_SHIFT,\pte587587+ depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte598588 extru \pte,24,25,\pte599599-600589 .endm601590602591 /* This is for ILP32 PA2.0 only. The TLB insertion needs···12101201 */1211120212121203 /* adjust isr/ior. */12131213-12141214- extrd,u %r16,63,7,%r1 /* get high bits from isr for ior */12151215- depd %r1,31,7,%r17 /* deposit them into ior */12161216- depdi 0,63,7,%r16 /* clear them from isr */12041204+ extrd,u %r16,63,SPACEID_SHIFT,%r1 /* get high bits from isr for ior */12051205+ depd %r1,31,SPACEID_SHIFT,%r17 /* deposit them into ior */12061206+ depdi 0,63,SPACEID_SHIFT,%r16 /* clear them from isr */12171207#endif12181208 STREG %r16, PT_ISR(%r29)12191209 STREG %r17, PT_IOR(%r29)
···5353 __attribute__((aligned(128))) __attribute__((__section__(".data.init_task"))) =5454 { INIT_THREAD_INFO(init_task) };55555656-#ifdef __LP64__5656+#if PT_NLEVELS == 35757/* NOTE: This layout exactly conforms to the hybrid L2/L3 page table layout5858 * with the first pmd adjacent to the pgd and below it. gcc doesn't actually5959 * guarantee that global objects will be laid out in memory in the same order 6060 * as the order of declaration, so put these in different sections and use6161 * the linker script to order them. */6262-pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pmd"))) = { {0}, };6363-6262+pmd_t pmd0[PTRS_PER_PMD] __attribute__ ((__section__ (".data.vm0.pmd"), aligned(PAGE_SIZE)));6463#endif6565-pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pgd"))) = { {0}, };6666-pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((aligned(PAGE_SIZE))) __attribute__ ((__section__ (".data.vm0.pte"))) = { {0}, };6464+6565+pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__ ((__section__ (".data.vm0.pgd"), aligned(PAGE_SIZE)));6666+pte_t pg0[PT_INITIAL * PTRS_PER_PTE] __attribute__ ((__section__ (".data.vm0.pte"), aligned(PAGE_SIZE)));67676868/*6969 * Initial task structure.
+12-13
arch/parisc/kernel/pacache.S
···6565 */66666767 /* pcxt_ssm_bug - relied upon translation! PA 2.0 Arch. F-4 and F-5 */6868- rsm PSW_SM_I, %r19 /* save I-bit state */6868+ rsm PSW_SM_I, %r19 /* save I-bit state */6969 load32 PA(1f), %r17070 nop7171 nop···8484 rfi8585 nop86868787-1: ldil L%PA(cache_info), %r18888- ldo R%PA(cache_info)(%r1), %r18787+1: load32 PA(cache_info), %r189889089 /* Flush Instruction Tlb */9190···211212 .entry212213213214 mtsp %r0, %sr1214214- ldil L%cache_info, %r1215215- ldo R%cache_info(%r1), %r1215215+ load32 cache_info, %r1216216217217 /* Flush Instruction Cache */218218···252254 .entry253255254256 mtsp %r0, %sr1255255- ldil L%cache_info, %r1256256- ldo R%cache_info(%r1), %r1257257+ load32 cache_info, %r1257258258259 /* Flush Data Cache */259260···300303 */301304302305 ldd 0(%r25), %r19303303- ldi 32, %r1 /* PAGE_SIZE/128 == 32 */306306+ ldi ASM_PAGE_SIZE_DIV128, %r1307307+304308 ldw 64(%r25), %r0 /* prefetch 1 cacheline ahead */305309 ldw 128(%r25), %r0 /* prefetch 2 */306310···366368 * use ldd/std on a 32 bit kernel.367369 */368370 ldw 0(%r25), %r19369369- ldi 64, %r1 /* PAGE_SIZE/64 == 64 */371371+ ldi ASM_PAGE_SIZE_DIV64, %r13703723713731:372374 ldw 4(%r25), %r20···459461 sub %r25, %r1, %r23 /* move physical addr into non shadowed reg */460462461463 ldil L%(TMPALIAS_MAP_START), %r28464464+ /* FIXME for different page sizes != 4k */462465#ifdef CONFIG_64BIT463466 extrd,u %r26,56,32, %r26 /* convert phys addr to tlb insert format */464467 extrd,u %r23,56,32, %r23 /* convert phys addr to tlb insert format */···550551#ifdef CONFIG_64BIT551552#if (TMPALIAS_MAP_START >= 0x80000000)552553 depdi 0, 31,32, %r28 /* clear any sign extension */554554+ /* FIXME: page size dependend */553555#endif554556 extrd,u %r26, 56,32, %r26 /* convert phys addr to tlb insert format */555557 depd %r25, 63,22, %r28 /* Form aliased virtual address 'to' */···566566 pdtlb 0(%r28)567567568568#ifdef CONFIG_64BIT569569- ldi 32, %r1 /* PAGE_SIZE/128 == 32 */569569+ ldi ASM_PAGE_SIZE_DIV128, %r1570570571571 /* PREFETCH (Write) has not (yet) been proven to help here */572572-/* #define PREFETCHW_OP ldd 256(%0), %r0 */572572+ /* #define PREFETCHW_OP ldd 256(%0), %r0 */5735735745741: std %r0, 0(%r28)575575 std %r0, 8(%r28)···591591 ldo 128(%r28), %r28592592593593#else /* ! CONFIG_64BIT */594594-595595- ldi 64, %r1 /* PAGE_SIZE/64 == 64 */594594+ ldi ASM_PAGE_SIZE_DIV64, %r15965955975961:598597 stw %r0, 0(%r28)
+8
arch/parisc/kernel/sys_parisc.c
···231231 (loff_t)high_len << 32 | low_len, advice);232232}233233234234+asmlinkage long parisc_sync_file_range(int fd,235235+ u32 hi_off, u32 lo_off, u32 hi_nbytes, u32 lo_nbytes,236236+ unsigned int flags)237237+{238238+ return sys_sync_file_range(fd, (loff_t)hi_off << 32 | lo_off,239239+ (loff_t)hi_nbytes << 32 | lo_nbytes, flags);240240+}241241+234242asmlinkage unsigned long sys_alloc_hugepages(int key, unsigned long addr, unsigned long len, int prot, int flag)235243{236244 return -ENOMEM;
+5-5
arch/parisc/kernel/syscall.S
···5555 * pointers.5656 */57575858- .align 40965858+ .align ASM_PAGE_SIZE5959linux_gateway_page:60606161 /* ADDRESS 0x00 to 0xb0 = 176 bytes / 4 bytes per insn = 44 insns */···632632end_compare_and_swap:633633634634 /* Make sure nothing else is placed on this page */635635- .align 4096635635+ .align ASM_PAGE_SIZE636636 .export end_linux_gateway_page637637end_linux_gateway_page:638638···652652653653 .section .rodata,"a"654654655655- .align 4096655655+ .align ASM_PAGE_SIZE656656 /* Light-weight-syscall table */657657 /* Start of lws table. */658658 .export lws_table···662662 LWS_ENTRY(compare_and_swap64) /* 1 - ELF64 Atomic compare and swap */663663 /* End of lws table */664664665665- .align 4096665665+ .align ASM_PAGE_SIZE666666 .export sys_call_table667667.Lsys_call_table:668668sys_call_table:669669#include "syscall_table.S"670670671671#ifdef CONFIG_64BIT672672- .align 4096672672+ .align ASM_PAGE_SIZE673673 .export sys_call_table64674674.Lsys_call_table64:675675sys_call_table64:
+7-1
arch/parisc/kernel/syscall_table.S
···1313 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org>1414 * Copyright (C) 2000-2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>1515 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>1616- *1616+ * Copyright (C) 2005-2006 Kyle McMartin <kyle at parisc-linux.org>1717 *1818 * This program is free software; you can redistribute it and/or modify1919 * it under the terms of the GNU General Public License as published by···393393 ENTRY_SAME(readlinkat) /* 285 */394394 ENTRY_SAME(fchmodat)395395 ENTRY_SAME(faccessat)396396+ ENTRY_SAME(unshare)397397+ ENTRY_COMP(set_robust_list)398398+ ENTRY_COMP(get_robust_list) /* 290 */399399+ ENTRY_SAME(splice)400400+ ENTRY_OURS(sync_file_range)401401+ ENTRY_SAME(tee)396402 /* Nothing yet */397403
+32-22
arch/parisc/kernel/vmlinux.lds.S
···66 * Copyright (C) 2000 Michael Ang <mang with subcarrier.org>77 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>88 * Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>99+ * Copyright (C) 2006 Helge Deller <deller@gmx.de>910 *1011 *1112 * This program is free software; you can redistribute it and/or modify···2827/* needed for the processor specific cache alignment size */ 2928#include <asm/cache.h>3029#include <asm/page.h>3030+#include <asm/asm-offsets.h>31313232/* ld script to make hppa Linux kernel */3333#ifndef CONFIG_64BIT···7068 RODATA71697270 /* writeable */7373- . = ALIGN(4096); /* Make sure this is page aligned so7171+ . = ALIGN(ASM_PAGE_SIZE); /* Make sure this is page aligned so7472 that we can properly leave these7573 as writable */7674 data_start = .;···8381 __start___unwind = .; /* unwind info */8482 .PARISC.unwind : { *(.PARISC.unwind) }8583 __stop___unwind = .;8686-8484+8585+ /* rarely changed data like cpu maps */8686+ . = ALIGN(16);8787+ .data.read_mostly : { *(.data.read_mostly) }8888+8989+ . = ALIGN(L1_CACHE_BYTES);8790 .data : { /* Data */8891 *(.data)8989- *(.data.vm0.pmd)9090- *(.data.vm0.pgd)9191- *(.data.vm0.pte)9292 CONSTRUCTORS9393 }9494-9595- . = ALIGN(4096);9696- /* nosave data is really only used for software suspend...it's here9797- * just in case we ever implement it */9898- __nosave_begin = .;9999- .data_nosave : { *(.data.nosave) }100100- . = ALIGN(4096);101101- __nosave_end = .;1029410395 . = ALIGN(L1_CACHE_BYTES);10496 .data.cacheline_aligned : { *(.data.cacheline_aligned) }···101105 . = ALIGN(16);102106 .data.lock_aligned : { *(.data.lock_aligned) }103107104104- /* rarely changed data like cpu maps */105105- . = ALIGN(16);106106- .data.read_mostly : { *(.data.read_mostly) }108108+ . = ALIGN(ASM_PAGE_SIZE);109109+ /* nosave data is really only used for software suspend...it's here110110+ * just in case we ever implement it */111111+ __nosave_begin = .;112112+ .data_nosave : { *(.data.nosave) }113113+ . = ALIGN(ASM_PAGE_SIZE);114114+ __nosave_end = .;107115108116 _edata = .; /* End of data section */109117118118+ __bss_start = .; /* BSS */119119+ /* page table entries need to be PAGE_SIZE aligned */120120+ . = ALIGN(ASM_PAGE_SIZE);121121+ .data.vmpages : {122122+ *(.data.vm0.pmd)123123+ *(.data.vm0.pgd)124124+ *(.data.vm0.pte)125125+ }126126+ .bss : { *(.bss) *(COMMON) }127127+ __bss_stop = .;128128+129129+130130+ /* assembler code expects init_task to be 16k aligned */110131 . = ALIGN(16384); /* init_task */111132 .data.init_task : { *(.data.init_task) }112133···139126 .dlt : { *(.dlt) }140127#endif141128129129+ /* reserve space for interrupt stack by aligning __init* to 16k */142130 . = ALIGN(16384);143131 __init_begin = .;144132 .init.text : { ···180166 from .altinstructions and .eh_frame */181167 .exit.text : { *(.exit.text) }182168 .exit.data : { *(.exit.data) }183183- . = ALIGN(4096);169169+ . = ALIGN(ASM_PAGE_SIZE);184170 __initramfs_start = .;185171 .init.ramfs : { *(.init.ramfs) }186172 __initramfs_end = .;···188174 __per_cpu_start = .;189175 .data.percpu : { *(.data.percpu) }190176 __per_cpu_end = .;191191- . = ALIGN(4096);177177+ . = ALIGN(ASM_PAGE_SIZE);192178 __init_end = .;193179 /* freed after init ends here */194180195195- __bss_start = .; /* BSS */196196- .bss : { *(.bss) *(COMMON) }197197- __bss_stop = .; 198198-199181 _end = . ;200182201183 /* Sections to be discarded */
+1-1
arch/parisc/mm/fault.c
···186186 break;187187 case VM_FAULT_SIGBUS:188188 /*189189- * We hit a hared mapping outside of the file, or some189189+ * We hit a shared mapping outside of the file, or some190190 * other thing happened to us that made us unable to191191 * handle the page fault gracefully.192192 */
+15-13
arch/parisc/mm/init.c
···66 * changed by Philipp Rumpf77 * Copyright 1999 Philipp Rumpf (prumpf@tux.org)88 * Copyright 2004 Randolph Chung (tausq@debian.org)99+ * Copyright 2006 Helge Deller (deller@gmx.de)910 *1011 */1112···372371373372void free_initmem(void)374373{375375- unsigned long addr;376376-374374+ unsigned long addr, init_begin, init_end;375375+377376 printk(KERN_INFO "Freeing unused kernel memory: ");378377379378#ifdef CONFIG_DEBUG_KERNEL···396395 local_irq_enable();397396#endif398397399399- addr = (unsigned long)(&__init_begin);400400- for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {398398+ /* align __init_begin and __init_end to page size,399399+ ignoring linker script where we might have tried to save RAM */400400+ init_begin = PAGE_ALIGN((unsigned long)(&__init_begin));401401+ init_end = PAGE_ALIGN((unsigned long)(&__init_end));402402+ for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) {401403 ClearPageReserved(virt_to_page(addr));402404 init_page_count(virt_to_page(addr));403405 free_page(addr);···411407 /* set up a new led state on systems shipped LED State panel */412408 pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE);413409414414- printk("%luk freed\n", (unsigned long)(&__init_end - &__init_begin) >> 10);410410+ printk("%luk freed\n", (init_end - init_begin) >> 10);415411}416412417413···643639 * Map the fault vector writable so we can644640 * write the HPMC checksum.645641 */642642+#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)646643 if (address >= ro_start && address < ro_end647644 && address != fv_addr648645 && address != gw_addr)649646 pte = __mk_pte(address, PAGE_KERNEL_RO);650647 else648648+#endif651649 pte = __mk_pte(address, pgprot);652650653651 if (address >= end_paddr)···880874 flush_tlb_all(); /* flush_tlb_all() calls recycle_sids() */881875 spin_lock(&sid_lock);882876 }883883- if (free_space_ids == 0)884884- BUG();877877+ BUG_ON(free_space_ids == 0);885878 }886879887880 free_space_ids--;···904899905900 spin_lock(&sid_lock);906901907907- if (*dirty_space_offset & (1L << index))908908- BUG(); /* attempt to free space id twice */902902+ BUG_ON(*dirty_space_offset & (1L << index)); /* attempt to free space id twice */909903910904 *dirty_space_offset |= (1L << index);911905 dirty_space_ids++;···979975980976static unsigned long recycle_ndirty;981977static unsigned long recycle_dirty_array[SID_ARRAY_SIZE];982982-static unsigned int recycle_inuse = 0;978978+static unsigned int recycle_inuse;983979984980void flush_tlb_all(void)985981{···988984 do_recycle = 0;989985 spin_lock(&sid_lock);990986 if (dirty_space_ids > RECYCLE_THRESHOLD) {991991- if (recycle_inuse) {992992- BUG(); /* FIXME: Use a semaphore/wait queue here */993993- }987987+ BUG_ON(recycle_inuse); /* FIXME: Use a semaphore/wait queue here */994988 get_dirty_sids(&recycle_ndirty,recycle_dirty_array);995989 recycle_inuse++;996990 do_recycle++;
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.16-rc244-# Fri Feb 10 17:33:08 200633+# Linux kernel version: 2.6.17-rc144+# Wed Apr 19 13:24:37 200655#66CONFIG_PPC64=y77CONFIG_64BIT=y···99CONFIG_MMU=y1010CONFIG_GENERIC_HARDIRQS=y1111CONFIG_RWSEM_XCHGADD_ALGORITHM=y1212+CONFIG_GENERIC_HWEIGHT=y1213CONFIG_GENERIC_CALIBRATE_DELAY=y1314CONFIG_PPC=y1415CONFIG_EARLY_PRINTK=y···3029CONFIG_PPC_FPU=y3130CONFIG_ALTIVEC=y3231CONFIG_PPC_STD_MMU=y3232+CONFIG_VIRT_CPU_ACCOUNTING=y3333CONFIG_SMP=y3434CONFIG_NR_CPUS=43535···5553CONFIG_IKCONFIG=y5654CONFIG_IKCONFIG_PROC=y5755# CONFIG_CPUSETS is not set5656+# CONFIG_RELAY is not set5857CONFIG_INITRAMFS_SOURCE=""5958CONFIG_CC_OPTIMIZE_FOR_SIZE=y6059# CONFIG_EMBEDDED is not set···7067CONFIG_FUTEX=y7168CONFIG_EPOLL=y7269CONFIG_SHMEM=y7373-CONFIG_CC_ALIGN_FUNCTIONS=07474-CONFIG_CC_ALIGN_LABELS=07575-CONFIG_CC_ALIGN_LOOPS=07676-CONFIG_CC_ALIGN_JUMPS=07770CONFIG_SLAB=y7871# CONFIG_TINY_SHMEM is not set7972CONFIG_BASE_SMALL=0···8182CONFIG_MODULES=y8283CONFIG_MODULE_UNLOAD=y8384# CONFIG_MODULE_FORCE_UNLOAD is not set8484-CONFIG_OBSOLETE_MODPARM=y8585CONFIG_MODVERSIONS=y8686CONFIG_MODULE_SRCVERSION_ALL=y8787CONFIG_KMOD=y···8991#9092# Block layer9193#9494+# CONFIG_BLK_DEV_IO_TRACE is not set92959396#9497# IO Schedulers···184185# CONFIG_PPC_INDIRECT_PCI is not set185186CONFIG_PCI=y186187CONFIG_PCI_DOMAINS=y187187-CONFIG_PCI_LEGACY_PROC=y188188# CONFIG_PCI_DEBUG is not set189189190190#···225227CONFIG_INET_AH=m226228CONFIG_INET_ESP=m227229CONFIG_INET_IPCOMP=m230230+CONFIG_INET_XFRM_TUNNEL=m228231CONFIG_INET_TUNNEL=y229232CONFIG_INET_DIAG=y230233CONFIG_INET_TCP_DIAG=y···237238#238239# CONFIG_IP_VS is not set239240# CONFIG_IPV6 is not set241241+# CONFIG_INET6_XFRM_TUNNEL is not set242242+# CONFIG_INET6_TUNNEL is not set240243CONFIG_NETFILTER=y241244# CONFIG_NETFILTER_DEBUG is not set242245···262261CONFIG_IP_NF_TFTP=m263262CONFIG_IP_NF_AMANDA=m264263# CONFIG_IP_NF_PPTP is not set264264+# CONFIG_IP_NF_H323 is not set265265CONFIG_IP_NF_QUEUE=m266266267267#···515513CONFIG_MD_RAID1=y516514CONFIG_MD_RAID10=m517515CONFIG_MD_RAID5=y516516+# CONFIG_MD_RAID5_RESHAPE is not set518517CONFIG_MD_RAID6=m519518CONFIG_MD_MULTIPATH=m520519CONFIG_MD_FAULTY=m···764761# Watchdog Cards765762#766763# CONFIG_WATCHDOG is not set767767-# CONFIG_RTC is not set768764CONFIG_GEN_RTC=y769765# CONFIG_GEN_RTC_X is not set770766# CONFIG_DTLK is not set···774772# Ftape, the floppy tape device driver775773#776774CONFIG_AGP=m775775+# CONFIG_AGP_VIA is not set777776CONFIG_AGP_UNINORTH=m778777# CONFIG_DRM is not set779778CONFIG_RAW_DRIVER=y···816813# CONFIG_I2C_PARPORT_LIGHT is not set817814# CONFIG_I2C_PROSAVAGE is not set818815# CONFIG_I2C_SAVAGE4 is not set819819-# CONFIG_SCx200_ACB is not set820816# CONFIG_I2C_SIS5595 is not set821817# CONFIG_I2C_SIS630 is not set822818# CONFIG_I2C_SIS96X is not set···834832# CONFIG_SENSORS_PCF8574 is not set835833# CONFIG_SENSORS_PCA9539 is not set836834# CONFIG_SENSORS_PCF8591 is not set837837-# CONFIG_SENSORS_RTC8564 is not set838835# CONFIG_SENSORS_MAX6875 is not set839839-# CONFIG_RTC_X1205_I2C is not set840836# CONFIG_I2C_DEBUG_CORE is not set841837# CONFIG_I2C_DEBUG_ALGO is not set842838# CONFIG_I2C_DEBUG_BUS is not set···862862#863863864864#865865-# Multimedia Capabilities Port drivers866866-#867867-868868-#869865# Multimedia devices870866#871867# CONFIG_VIDEO_DEV is not set···870874# Digital Video Broadcasting Devices871875#872876# CONFIG_DVB is not set877877+# CONFIG_USB_DABUSB is not set873878874879#875880# Graphics support···880883CONFIG_FB_CFB_COPYAREA=y881884CONFIG_FB_CFB_IMAGEBLIT=y882885CONFIG_FB_MACMODES=y886886+CONFIG_FB_FIRMWARE_EDID=y883887CONFIG_FB_MODE_HELPERS=y884888CONFIG_FB_TILEBLITTING=y885889# CONFIG_FB_CIRRUS is not set···899901CONFIG_FB_NVIDIA_I2C=y900902# CONFIG_FB_RIVA is not set901903# CONFIG_FB_MATROX is not set902902-# CONFIG_FB_RADEON_OLD is not set903904CONFIG_FB_RADEON=y904905CONFIG_FB_RADEON_I2C=y905906# CONFIG_FB_RADEON_DEBUG is not set···955958CONFIG_SND_OSSEMUL=y956959CONFIG_SND_MIXER_OSS=m957960CONFIG_SND_PCM_OSS=m961961+CONFIG_SND_PCM_OSS_PLUGINS=y958962CONFIG_SND_SEQUENCER_OSS=y959963# CONFIG_SND_DYNAMIC_MINORS is not set960964CONFIG_SND_SUPPORT_OLD_API=y965965+CONFIG_SND_VERBOSE_PROCFS=y961966# CONFIG_SND_VERBOSE_PRINTK is not set962967# CONFIG_SND_DEBUG is not set963968···976977# PCI devices977978#978979# CONFIG_SND_AD1889 is not set980980+# CONFIG_SND_ALS300 is not set979981# CONFIG_SND_ALS4000 is not set980982# CONFIG_SND_ALI5451 is not set981983# CONFIG_SND_ATIIXP is not set···10091009# CONFIG_SND_MIXART is not set10101010# CONFIG_SND_NM256 is not set10111011# CONFIG_SND_PCXHR is not set10121012+# CONFIG_SND_RIPTIDE is not set10121013# CONFIG_SND_RME32 is not set10131014# CONFIG_SND_RME96 is not set10141015# CONFIG_SND_RME9652 is not set···10421041#10431042CONFIG_USB_ARCH_HAS_HCD=y10441043CONFIG_USB_ARCH_HAS_OHCI=y10441044+CONFIG_USB_ARCH_HAS_EHCI=y10451045CONFIG_USB=y10461046# CONFIG_USB_DEBUG is not set10471047···10701068#10711069# USB Device Class drivers10721070#10731073-# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set10741071CONFIG_USB_ACM=m10751072CONFIG_USB_PRINTER=y10761073···11251124#11261125# CONFIG_USB_MDC800 is not set11271126# CONFIG_USB_MICROTEK is not set11281128-11291129-#11301130-# USB Multimedia devices11311131-#11321132-# CONFIG_USB_DABUSB is not set11331133-11341134-#11351135-# Video4Linux support is needed for USB Multimedia device support11361136-#1137112711381128#11391129# USB Network Adapters···11861194CONFIG_USB_SERIAL_KLSI=m11871195CONFIG_USB_SERIAL_KOBIL_SCT=m11881196CONFIG_USB_SERIAL_MCT_U232=m11971197+# CONFIG_USB_SERIAL_NAVMAN is not set11891198CONFIG_USB_SERIAL_PL2303=m11901199# CONFIG_USB_SERIAL_HP4X is not set11911200CONFIG_USB_SERIAL_SAFE=m···12301237# CONFIG_MMC is not set1231123812321239#12401240+# LED devices12411241+#12421242+# CONFIG_NEW_LEDS is not set12431243+12441244+#12331245# InfiniBand support12341246#12351247# CONFIG_INFINIBAND is not set1236124812371249#12381238-# SN Devices12501250+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)12391251#1240125212411253#12421242-# EDAC - error detection and reporting (RAS)12541254+# Real Time Clock12431255#12561256+# CONFIG_RTC_CLASS is not set1244125712451258#12461259# File systems···13181319CONFIG_HUGETLBFS=y13191320CONFIG_HUGETLB_PAGE=y13201321CONFIG_RAMFS=y13211321-# CONFIG_RELAYFS_FS is not set13221322# CONFIG_CONFIGFS_FS is not set1323132313241324#
+26-17
arch/powerpc/configs/iseries_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.16-rc644-# Wed Mar 15 16:19:52 200633+# Linux kernel version: 2.6.17-rc144+# Wed Apr 19 11:46:44 200655#66CONFIG_PPC64=y77CONFIG_64BIT=y···99CONFIG_MMU=y1010CONFIG_GENERIC_HARDIRQS=y1111CONFIG_RWSEM_XCHGADD_ALGORITHM=y1212+CONFIG_GENERIC_HWEIGHT=y1213CONFIG_GENERIC_CALIBRATE_DELAY=y1314CONFIG_PPC=y1415CONFIG_EARLY_PRINTK=y···3130CONFIG_PPC_FPU=y3231# CONFIG_ALTIVEC is not set3332CONFIG_PPC_STD_MMU=y3333+CONFIG_VIRT_CPU_ACCOUNTING=y3434CONFIG_SMP=y3535CONFIG_NR_CPUS=323636···5755CONFIG_IKCONFIG=y5856CONFIG_IKCONFIG_PROC=y5957# CONFIG_CPUSETS is not set5858+# CONFIG_RELAY is not set6059CONFIG_INITRAMFS_SOURCE=""6160CONFIG_CC_OPTIMIZE_FOR_SIZE=y6261# CONFIG_EMBEDDED is not set···7269CONFIG_FUTEX=y7370CONFIG_EPOLL=y7471CONFIG_SHMEM=y7575-CONFIG_CC_ALIGN_FUNCTIONS=07676-CONFIG_CC_ALIGN_LABELS=07777-CONFIG_CC_ALIGN_LOOPS=07878-CONFIG_CC_ALIGN_JUMPS=07972CONFIG_SLAB=y8073# CONFIG_TINY_SHMEM is not set8174CONFIG_BASE_SMALL=0···8384CONFIG_MODULES=y8485CONFIG_MODULE_UNLOAD=y8586# CONFIG_MODULE_FORCE_UNLOAD is not set8686-CONFIG_OBSOLETE_MODPARM=y8787CONFIG_MODVERSIONS=y8888CONFIG_MODULE_SRCVERSION_ALL=y8989CONFIG_KMOD=y···9193#9294# Block layer9395#9696+# CONFIG_BLK_DEV_IO_TRACE is not set94979598#9699# IO Schedulers···164165# CONFIG_PPC_INDIRECT_PCI is not set165166CONFIG_PCI=y166167CONFIG_PCI_DOMAINS=y167167-CONFIG_PCI_LEGACY_PROC=y168168# CONFIG_PCI_DEBUG is not set169169170170#···205207CONFIG_INET_AH=m206208CONFIG_INET_ESP=m207209CONFIG_INET_IPCOMP=m210210+CONFIG_INET_XFRM_TUNNEL=m208211CONFIG_INET_TUNNEL=y209212CONFIG_INET_DIAG=y210213CONFIG_INET_TCP_DIAG=y···217218#218219# CONFIG_IP_VS is not set219220# CONFIG_IPV6 is not set221221+# CONFIG_INET6_XFRM_TUNNEL is not set222222+# CONFIG_INET6_TUNNEL is not set220223CONFIG_NETFILTER=y221224# CONFIG_NETFILTER_DEBUG is not set222225···237236CONFIG_NETFILTER_XT_MATCH_CONNMARK=m238237CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m239238# CONFIG_NETFILTER_XT_MATCH_DCCP is not set239239+# CONFIG_NETFILTER_XT_MATCH_ESP is not set240240CONFIG_NETFILTER_XT_MATCH_HELPER=m241241CONFIG_NETFILTER_XT_MATCH_LENGTH=m242242CONFIG_NETFILTER_XT_MATCH_LIMIT=m243243CONFIG_NETFILTER_XT_MATCH_MAC=m244244CONFIG_NETFILTER_XT_MATCH_MARK=m245245+# CONFIG_NETFILTER_XT_MATCH_POLICY is not set246246+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set245247CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m246248CONFIG_NETFILTER_XT_MATCH_REALM=m247249CONFIG_NETFILTER_XT_MATCH_SCTP=m···266262CONFIG_IP_NF_TFTP=m267263CONFIG_IP_NF_AMANDA=m268264# CONFIG_IP_NF_PPTP is not set265265+# CONFIG_IP_NF_H323 is not set269266CONFIG_IP_NF_QUEUE=m270267CONFIG_IP_NF_IPTABLES=m271268CONFIG_IP_NF_MATCH_IPRANGE=m272272-CONFIG_IP_NF_MATCH_MULTIPORT=m273269CONFIG_IP_NF_MATCH_TOS=m274270CONFIG_IP_NF_MATCH_RECENT=m275271CONFIG_IP_NF_MATCH_ECN=m276272CONFIG_IP_NF_MATCH_DSCP=m277277-CONFIG_IP_NF_MATCH_AH_ESP=m273273+# CONFIG_IP_NF_MATCH_AH is not set278274CONFIG_IP_NF_MATCH_TTL=m279275CONFIG_IP_NF_MATCH_OWNER=m280276CONFIG_IP_NF_MATCH_ADDRTYPE=m281277CONFIG_IP_NF_MATCH_HASHLIMIT=m282282-CONFIG_IP_NF_MATCH_POLICY=m283278CONFIG_IP_NF_FILTER=m284279CONFIG_IP_NF_TARGET_REJECT=m285280CONFIG_IP_NF_TARGET_LOG=m···482479CONFIG_MD_RAID1=y483480CONFIG_MD_RAID10=m484481CONFIG_MD_RAID5=y482482+# CONFIG_MD_RAID5_RESHAPE is not set485483CONFIG_MD_RAID6=m486484CONFIG_MD_MULTIPATH=m487485CONFIG_MD_FAULTY=m···706702# Watchdog Cards707703#708704# CONFIG_WATCHDOG is not set709709-# CONFIG_RTC is not set710705CONFIG_GEN_RTC=y711706# CONFIG_GEN_RTC_X is not set712707# CONFIG_DTLK is not set···754751#755752756753#757757-# Multimedia Capabilities Port drivers758758-#759759-760760-#761754# Multimedia devices762755#763756# CONFIG_VIDEO_DEV is not set···778779#779780CONFIG_USB_ARCH_HAS_HCD=y780781CONFIG_USB_ARCH_HAS_OHCI=y782782+CONFIG_USB_ARCH_HAS_EHCI=y781783# CONFIG_USB is not set782784783785#···796796# CONFIG_MMC is not set797797798798#799799+# LED devices800800+#801801+# CONFIG_NEW_LEDS is not set802802+803803+#799804# InfiniBand support800805#801806# CONFIG_INFINIBAND is not set···808803#809804# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)810805#806806+807807+#808808+# Real Time Clock809809+#810810+# CONFIG_RTC_CLASS is not set811811812812#813813# File systems···888878# CONFIG_HUGETLBFS is not set889879# CONFIG_HUGETLB_PAGE is not set890880CONFIG_RAMFS=y891891-# CONFIG_RELAYFS_FS is not set892881# CONFIG_CONFIGFS_FS is not set893882894883#
+25-29
arch/powerpc/configs/pseries_defconfig
···11#22# Automatically generated make config: don't edit33-# Linux kernel version: 2.6.16-rc244-# Fri Feb 10 17:33:32 200633+# Linux kernel version: 2.6.17-rc144+# Wed Apr 19 11:48:00 200655#66CONFIG_PPC64=y77CONFIG_64BIT=y···99CONFIG_MMU=y1010CONFIG_GENERIC_HARDIRQS=y1111CONFIG_RWSEM_XCHGADD_ALGORITHM=y1212+CONFIG_GENERIC_HWEIGHT=y1213CONFIG_GENERIC_CALIBRATE_DELAY=y1314CONFIG_PPC=y1415CONFIG_EARLY_PRINTK=y···3130CONFIG_PPC_FPU=y3231CONFIG_ALTIVEC=y3332CONFIG_PPC_STD_MMU=y3333+CONFIG_VIRT_CPU_ACCOUNTING=y3434CONFIG_SMP=y3535CONFIG_NR_CPUS=1283636···5755CONFIG_IKCONFIG=y5856CONFIG_IKCONFIG_PROC=y5957CONFIG_CPUSETS=y5858+# CONFIG_RELAY is not set6059CONFIG_INITRAMFS_SOURCE=""6160CONFIG_CC_OPTIMIZE_FOR_SIZE=y6261# CONFIG_EMBEDDED is not set···7269CONFIG_FUTEX=y7370CONFIG_EPOLL=y7471CONFIG_SHMEM=y7575-CONFIG_CC_ALIGN_FUNCTIONS=07676-CONFIG_CC_ALIGN_LABELS=07777-CONFIG_CC_ALIGN_LOOPS=07878-CONFIG_CC_ALIGN_JUMPS=07972CONFIG_SLAB=y8073# CONFIG_TINY_SHMEM is not set8174CONFIG_BASE_SMALL=0···8384CONFIG_MODULES=y8485CONFIG_MODULE_UNLOAD=y8586# CONFIG_MODULE_FORCE_UNLOAD is not set8686-CONFIG_OBSOLETE_MODPARM=y8787CONFIG_MODVERSIONS=y8888CONFIG_MODULE_SRCVERSION_ALL=y8989CONFIG_KMOD=y···9193#9294# Block layer9395#9696+# CONFIG_BLK_DEV_IO_TRACE is not set94979598#9699# IO Schedulers···187188# CONFIG_PPC_INDIRECT_PCI is not set188189CONFIG_PCI=y189190CONFIG_PCI_DOMAINS=y190190-CONFIG_PCI_LEGACY_PROC=y191191# CONFIG_PCI_DEBUG is not set192192193193#···233235CONFIG_INET_AH=m234236CONFIG_INET_ESP=m235237CONFIG_INET_IPCOMP=m238238+CONFIG_INET_XFRM_TUNNEL=m236239CONFIG_INET_TUNNEL=y237240CONFIG_INET_DIAG=y238241CONFIG_INET_TCP_DIAG=y···245246#246247# CONFIG_IP_VS is not set247248# CONFIG_IPV6 is not set249249+# CONFIG_INET6_XFRM_TUNNEL is not set250250+# CONFIG_INET6_TUNNEL is not set248251CONFIG_NETFILTER=y249252# CONFIG_NETFILTER_DEBUG is not set250253···273272CONFIG_IP_NF_TFTP=m274273CONFIG_IP_NF_AMANDA=m275274# CONFIG_IP_NF_PPTP is not set275275+# CONFIG_IP_NF_H323 is not set276276CONFIG_IP_NF_QUEUE=m277277278278#···521519CONFIG_MD_RAID1=y522520CONFIG_MD_RAID10=m523521CONFIG_MD_RAID5=y522522+# CONFIG_MD_RAID5_RESHAPE is not set524523CONFIG_MD_RAID6=m525524CONFIG_MD_MULTIPATH=m526525CONFIG_MD_FAULTY=m···753750#754751CONFIG_SERIAL_8250=y755752CONFIG_SERIAL_8250_CONSOLE=y753753+CONFIG_SERIAL_8250_PCI=y756754CONFIG_SERIAL_8250_NR_UARTS=4757755CONFIG_SERIAL_8250_RUNTIME_UARTS=4758756# CONFIG_SERIAL_8250_EXTENDED is not set···771767# CONFIG_PRINTER is not set772768# CONFIG_PPDEV is not set773769# CONFIG_TIPAR is not set770770+CONFIG_HVC_DRIVER=y774771CONFIG_HVC_CONSOLE=y772772+# CONFIG_HVC_RTAS is not set775773CONFIG_HVCS=m776774777775#···785779# Watchdog Cards786780#787781# CONFIG_WATCHDOG is not set788788-# CONFIG_RTC is not set789782CONFIG_GEN_RTC=y790783# CONFIG_GEN_RTC_X is not set791784# CONFIG_DTLK is not set···835830# CONFIG_I2C_PARPORT_LIGHT is not set836831# CONFIG_I2C_PROSAVAGE is not set837832# CONFIG_I2C_SAVAGE4 is not set838838-# CONFIG_SCx200_ACB is not set839833# CONFIG_I2C_SIS5595 is not set840834# CONFIG_I2C_SIS630 is not set841835# CONFIG_I2C_SIS96X is not set···853849# CONFIG_SENSORS_PCF8574 is not set854850# CONFIG_SENSORS_PCA9539 is not set855851# CONFIG_SENSORS_PCF8591 is not set856856-# CONFIG_SENSORS_RTC8564 is not set857852# CONFIG_SENSORS_MAX6875 is not set858858-# CONFIG_RTC_X1205_I2C is not set859853# CONFIG_I2C_DEBUG_CORE is not set860854# CONFIG_I2C_DEBUG_ALGO is not set861855# CONFIG_I2C_DEBUG_BUS is not set···881879#882880883881#884884-# Multimedia Capabilities Port drivers885885-#886886-887887-#888882# Multimedia devices889883#890884# CONFIG_VIDEO_DEV is not set···889891# Digital Video Broadcasting Devices890892#891893# CONFIG_DVB is not set894894+# CONFIG_USB_DABUSB is not set892895893896#894897# Graphics support···899900CONFIG_FB_CFB_COPYAREA=y900901CONFIG_FB_CFB_IMAGEBLIT=y901902CONFIG_FB_MACMODES=y903903+CONFIG_FB_FIRMWARE_EDID=y902904CONFIG_FB_MODE_HELPERS=y903905CONFIG_FB_TILEBLITTING=y904906# CONFIG_FB_CIRRUS is not set···919919CONFIG_FB_MATROX_G=y920920# CONFIG_FB_MATROX_I2C is not set921921CONFIG_FB_MATROX_MULTIHEAD=y922922-# CONFIG_FB_RADEON_OLD is not set923922CONFIG_FB_RADEON=y924923CONFIG_FB_RADEON_I2C=y925924# CONFIG_FB_RADEON_DEBUG is not set···967968#968969CONFIG_USB_ARCH_HAS_HCD=y969970CONFIG_USB_ARCH_HAS_OHCI=y971971+CONFIG_USB_ARCH_HAS_EHCI=y970972CONFIG_USB=y971973# CONFIG_USB_DEBUG is not set972974···10481048# CONFIG_USB_MICROTEK is not set1049104910501050#10511051-# USB Multimedia devices10521052-#10531053-# CONFIG_USB_DABUSB is not set10541054-10551055-#10561056-# Video4Linux support is needed for USB Multimedia device support10571057-#10581058-10591059-#10601051# USB Network Adapters10611052#10621053# CONFIG_USB_CATC is not set···11001109# CONFIG_MMC is not set1101111011021111#11121112+# LED devices11131113+#11141114+# CONFIG_NEW_LEDS is not set11151115+11161116+#11031117# InfiniBand support11041118#11051119CONFIG_INFINIBAND=m···11171121# CONFIG_INFINIBAND_SRP is not set1118112211191123#11201120-# SN Devices11241124+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)11211125#1122112611231127#11241124-# EDAC - error detection and reporting (RAS)11281128+# Real Time Clock11251129#11301130+# CONFIG_RTC_CLASS is not set1126113111271132#11281133# File systems···11991202CONFIG_HUGETLBFS=y12001203CONFIG_HUGETLB_PAGE=y12011204CONFIG_RAMFS=y12021202-# CONFIG_RELAYFS_FS is not set12031205# CONFIG_CONFIGFS_FS is not set1204120612051207#
+26-10
arch/powerpc/kernel/iommu.c
···6161static unsigned long iommu_range_alloc(struct iommu_table *tbl,6262 unsigned long npages,6363 unsigned long *handle,6464+ unsigned long mask,6465 unsigned int align_order)6566{ 6667 unsigned long n, end, i, start;···9897 */9998 if (start >= limit)10099 start = largealloc ? tbl->it_largehint : tbl->it_hint;101101-100100+102101 again:102102+103103+ if (limit + tbl->it_offset > mask) {104104+ limit = mask - tbl->it_offset + 1;105105+ /* If we're constrained on address range, first try106106+ * at the masked hint to avoid O(n) search complexity,107107+ * but on second pass, start at 0.108108+ */109109+ if ((start & mask) >= limit || pass > 0)110110+ start = 0;111111+ else112112+ start &= mask;113113+ }103114104115 n = find_next_zero_bit(tbl->it_map, limit, start);105116···163150164151static dma_addr_t iommu_alloc(struct iommu_table *tbl, void *page,165152 unsigned int npages, enum dma_data_direction direction,166166- unsigned int align_order)153153+ unsigned long mask, unsigned int align_order)167154{168155 unsigned long entry, flags;169156 dma_addr_t ret = DMA_ERROR_CODE;170170-157157+171158 spin_lock_irqsave(&(tbl->it_lock), flags);172159173173- entry = iommu_range_alloc(tbl, npages, NULL, align_order);160160+ entry = iommu_range_alloc(tbl, npages, NULL, mask, align_order);174161175162 if (unlikely(entry == DMA_ERROR_CODE)) {176163 spin_unlock_irqrestore(&(tbl->it_lock), flags);···249236250237int iommu_map_sg(struct device *dev, struct iommu_table *tbl,251238 struct scatterlist *sglist, int nelems,252252- enum dma_data_direction direction)239239+ unsigned long mask, enum dma_data_direction direction)253240{254241 dma_addr_t dma_next = 0, dma_addr;255242 unsigned long flags;···287274 vaddr = (unsigned long)page_address(s->page) + s->offset;288275 npages = PAGE_ALIGN(vaddr + slen) - (vaddr & PAGE_MASK);289276 npages >>= PAGE_SHIFT;290290- entry = iommu_range_alloc(tbl, npages, &handle, 0);277277+ entry = iommu_range_alloc(tbl, npages, &handle, mask >> PAGE_SHIFT, 0);291278292279 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);293280···492479 * byte within the page as vaddr.493480 */494481dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,495495- size_t size, enum dma_data_direction direction)482482+ size_t size, unsigned long mask,483483+ enum dma_data_direction direction)496484{497485 dma_addr_t dma_handle = DMA_ERROR_CODE;498486 unsigned long uaddr;···506492 npages >>= PAGE_SHIFT;507493508494 if (tbl) {509509- dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 0);495495+ dma_handle = iommu_alloc(tbl, vaddr, npages, direction,496496+ mask >> PAGE_SHIFT, 0);510497 if (dma_handle == DMA_ERROR_CODE) {511498 if (printk_ratelimit()) {512499 printk(KERN_INFO "iommu_alloc failed, "···536521 * to the dma address (mapping) of the first page.537522 */538523void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,539539- dma_addr_t *dma_handle, gfp_t flag)524524+ dma_addr_t *dma_handle, unsigned long mask, gfp_t flag)540525{541526 void *ret = NULL;542527 dma_addr_t mapping;···566551 memset(ret, 0, size);567552568553 /* Set up tces to cover the allocated range */569569- mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL, order);554554+ mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL,555555+ mask >> PAGE_SHIFT, order);570556 if (mapping == DMA_ERROR_CODE) {571557 free_pages((unsigned long)ret, order);572558 ret = NULL;
+36-4
arch/powerpc/kernel/pci_iommu.c
···5959}606061616262+static inline unsigned long device_to_mask(struct device *hwdev)6363+{6464+ struct pci_dev *pdev;6565+6666+ if (!hwdev) {6767+ pdev = ppc64_isabridge_dev;6868+ if (!pdev) /* This is the best guess we can do */6969+ return 0xfffffffful;7070+ } else7171+ pdev = to_pci_dev(hwdev);7272+7373+ if (pdev->dma_mask)7474+ return pdev->dma_mask;7575+7676+ /* Assume devices without mask can take 32 bit addresses */7777+ return 0xfffffffful;7878+}7979+8080+6281/* Allocates a contiguous real buffer and creates mappings over it.6382 * Returns the virtual address of the buffer and sets dma_handle6483 * to the dma address (mapping) of the first page.···8667 dma_addr_t *dma_handle, gfp_t flag)8768{8869 return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle,8989- flag);7070+ device_to_mask(hwdev), flag);9071}91729273static void pci_iommu_free_coherent(struct device *hwdev, size_t size,···10485static dma_addr_t pci_iommu_map_single(struct device *hwdev, void *vaddr,10586 size_t size, enum dma_data_direction direction)10687{107107- return iommu_map_single(devnode_table(hwdev), vaddr, size, direction);8888+ return iommu_map_single(devnode_table(hwdev), vaddr, size,8989+ device_to_mask(hwdev), direction);10890}1099111092···120100 int nelems, enum dma_data_direction direction)121101{122102 return iommu_map_sg(pdev, devnode_table(pdev), sglist,123123- nelems, direction);103103+ nelems, device_to_mask(pdev), direction);124104}125105126106static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,···132112/* We support DMA to/from any memory page via the iommu */133113static int pci_iommu_dma_supported(struct device *dev, u64 mask)134114{135135- return 1;115115+ struct iommu_table *tbl = devnode_table(dev);116116+117117+ if (!tbl || tbl->it_offset > mask) {118118+ printk(KERN_INFO "Warning: IOMMU table offset too big for device mask\n");119119+ if (tbl)120120+ printk(KERN_INFO "mask: 0x%08lx, table offset: 0x%08lx\n",121121+ mask, tbl->it_offset);122122+ else123123+ printk(KERN_INFO "mask: 0x%08lx, table unavailable\n",124124+ mask);125125+ return 0;126126+ } else127127+ return 1;136128}137129138130void pci_iommu_init(void)
···6262static int __initdata dt_root_size_cells;63636464#ifdef CONFIG_PPC646565-static int __initdata iommu_is_off;6565+int __initdata iommu_is_off;6666int __initdata iommu_force_on;6767unsigned long tce_alloc_start, tce_alloc_end;6868#endif
+2-2
arch/powerpc/kernel/sysfs.c
···279279}280280#endif /* CONFIG_HOTPLUG_CPU */281281282282-static int __devinit sysfs_cpu_notify(struct notifier_block *self,282282+static int sysfs_cpu_notify(struct notifier_block *self,283283 unsigned long action, void *hcpu)284284{285285 unsigned int cpu = (unsigned int)(long)hcpu;···297297 return NOTIFY_OK;298298}299299300300-static struct notifier_block __devinitdata sysfs_cpu_nb = {300300+static struct notifier_block sysfs_cpu_nb = {301301 .notifier_call = sysfs_cpu_notify,302302};303303
+6
arch/powerpc/kernel/systbl.S
···324324SYSCALL(unshare)325325SYSCALL(splice)326326SYSCALL(tee)327327+SYSCALL(vmsplice)328328+329329+/*330330+ * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c331331+ * as well when appropriate.332332+ */
···231231 return isr;232232}233233234234+static void kw_i2c_do_stop(struct pmac_i2c_host_kw *host, int result)235235+{236236+ kw_write_reg(reg_control, KW_I2C_CTL_STOP);237237+ host->state = state_stop;238238+ host->result = result;239239+}240240+241241+234242static void kw_i2c_handle_interrupt(struct pmac_i2c_host_kw *host, u8 isr)235243{236244 u8 ack;···254246 }255247256248 if (isr == 0) {249249+ printk(KERN_WARNING "low_i2c: Timeout in i2c transfer"250250+ " on keywest !\n");257251 if (host->state != state_stop) {258258- DBG_LOW("KW: Timeout !\n");259259- host->result = -EIO;260260- goto stop;252252+ kw_i2c_do_stop(host, -EIO);253253+ return;261254 }262262- if (host->state == state_stop) {263263- ack = kw_read_reg(reg_status);264264- if (ack & KW_I2C_STAT_BUSY)265265- kw_write_reg(reg_status, 0);266266- host->state = state_idle;267267- kw_write_reg(reg_ier, 0x00);268268- if (!host->polled)269269- complete(&host->complete);270270- }255255+ ack = kw_read_reg(reg_status);256256+ if (ack & KW_I2C_STAT_BUSY)257257+ kw_write_reg(reg_status, 0);258258+ host->state = state_idle;259259+ kw_write_reg(reg_ier, 0x00);260260+ if (!host->polled)261261+ complete(&host->complete);271262 return;272263 }273264274265 if (isr & KW_I2C_IRQ_ADDR) {275266 ack = kw_read_reg(reg_status);276267 if (host->state != state_addr) {277277- kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR);278268 WRONG_STATE("KW_I2C_IRQ_ADDR"); 279279- host->result = -EIO;280280- goto stop;269269+ kw_i2c_do_stop(host, -EIO);281270 }282271 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {283283- host->result = -ENODEV;284284- DBG_LOW("KW: NAK on address\n");272272+ host->result = -ENXIO;285273 host->state = state_stop;286286- return;274274+ DBG_LOW("KW: NAK on address\n");287275 } else {288288- if (host->len == 0) {289289- kw_write_reg(reg_isr, KW_I2C_IRQ_ADDR);290290- goto stop;291291- }292292- if (host->rw) {276276+ if (host->len == 0)277277+ kw_i2c_do_stop(host, 0);278278+ else if (host->rw) {293279 host->state = state_read;294280 if (host->len > 1)295281 kw_write_reg(reg_control,···310308 ack = kw_read_reg(reg_status);311309 if ((ack & KW_I2C_STAT_LAST_AAK) == 0) {312310 DBG_LOW("KW: nack on data write\n");313313- host->result = -EIO;314314- goto stop;311311+ host->result = -EFBIG;312312+ host->state = state_stop;315313 } else if (host->len) {316314 kw_write_reg(reg_data, *(host->data++));317315 host->len--;318318- } else {319319- kw_write_reg(reg_control, KW_I2C_CTL_STOP);320320- host->state = state_stop;321321- host->result = 0;322322- }323323- kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);316316+ } else317317+ kw_i2c_do_stop(host, 0);324318 } else {325325- kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);326319 WRONG_STATE("KW_I2C_IRQ_DATA"); 327327- if (host->state != state_stop) {328328- host->result = -EIO;329329- goto stop;330330- }320320+ if (host->state != state_stop)321321+ kw_i2c_do_stop(host, -EIO);331322 }323323+ kw_write_reg(reg_isr, KW_I2C_IRQ_DATA);332324 }333325334326 if (isr & KW_I2C_IRQ_STOP) {···336340 complete(&host->complete);337341 }338342343343+ /* Below should only happen in manual mode which we don't use ... */339344 if (isr & KW_I2C_IRQ_START)340345 kw_write_reg(reg_isr, KW_I2C_IRQ_START);341346342342- return;343343- stop:344344- kw_write_reg(reg_control, KW_I2C_CTL_STOP); 345345- host->state = state_stop;346346- return;347347}348348349349/* Interrupt handler */···536544 return NULL;537545 }538546539539- /* Make sure IRA is disabled */547547+ /* Make sure IRQ is disabled */540548 kw_write_reg(reg_ier, 0);541549542550 /* Request chip interrupt */543543- if (request_irq(host->irq, kw_i2c_irq, SA_SHIRQ, "keywest i2c", host))551551+ if (request_irq(host->irq, kw_i2c_irq, 0, "keywest i2c", host))544552 host->irq = NO_IRQ;545553546554 printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
+10-2
arch/powerpc/sysdev/dart_iommu.c
···49495050#include "dart.h"51515252+extern int iommu_is_off;5253extern int iommu_force_on;53545455/* Physical base address and size of the DART table */···330329331330void __init alloc_dart_table(void)332331{333333- /* Only reserve DART space if machine has more than 2GB of RAM332332+ /* Only reserve DART space if machine has more than 1GB of RAM334333 * or if requested with iommu=on on cmdline.334334+ *335335+ * 1GB of RAM is picked as limit because some default devices336336+ * (i.e. Airport Extreme) have 30 bit address range limits.335337 */336336- if (lmb_end_of_DRAM() <= 0x80000000ull && !iommu_force_on)338338+339339+ if (iommu_is_off)340340+ return;341341+342342+ if (!iommu_force_on && lmb_end_of_DRAM() <= 0x40000000ull)337343 return;338344339345 /* 512 pages (2MB) is max DART tablesize. */
···629629#endif630630631631/* Get notified when a cpu comes on/off. Be hotplug friendly. */632632-static __cpuinit int632632+static int633633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)634634{635635 unsigned int cpu = (unsigned long)hcpu;
+1-1
arch/x86_64/kernel/mce_amd.c
···482482#endif483483484484/* get notified when a cpu comes on/off */485485-static __cpuinit int threshold_cpu_callback(struct notifier_block *nfb,485485+static int threshold_cpu_callback(struct notifier_block *nfb,486486 unsigned long action, void *hcpu)487487{488488 /* cpu was unsigned int to begin with */
-4
arch/x86_64/kernel/pci-gart.c
···112112static void free_iommu(unsigned long offset, int size)113113{ 114114 unsigned long flags;115115- if (size == 1) { 116116- clear_bit(offset, iommu_gart_bitmap); 117117- return;118118- }119115 spin_lock_irqsave(&iommu_bitmap_lock, flags);120116 __clear_bit_string(iommu_gart_bitmap, offset, size);121117 spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
···107107 return 0;108108}109109110110-static int __cpuinit topology_cpu_callback(struct notifier_block *nfb,110110+static int topology_cpu_callback(struct notifier_block *nfb,111111 unsigned long action, void *hcpu)112112{113113 unsigned int cpu = (unsigned long)hcpu;
-1
drivers/char/drm/drmP.h
···889889 /* Buffer management support (drm_bufs.h) */890890extern int drm_addbufs_agp(drm_device_t * dev, drm_buf_desc_t * request);891891extern int drm_addbufs_pci(drm_device_t * dev, drm_buf_desc_t * request);892892-extern int drm_addbufs_fb(drm_device_t *dev, drm_buf_desc_t *request);893892extern int drm_addmap(drm_device_t * dev, unsigned int offset,894893 unsigned int size, drm_map_type_t type,895894 drm_map_flags_t flags, drm_local_map_t ** map_ptr);
···386386387387 return 0;388388}389389-EXPORT_SYMBOL(drm_rmmap_locked);390389391390int drm_rmmap(drm_device_t *dev, drm_local_map_t *map)392391{···397398398399 return ret;399400}400400-EXPORT_SYMBOL(drm_rmmap);401401402402/* The rmmap ioctl appears to be unnecessary. All mappings are torn down on403403 * the last close of the device, and this is necessary for cleanup when things···10511053 return 0;10521054}1053105510541054-int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)10561056+static int drm_addbufs_fb(drm_device_t * dev, drm_buf_desc_t * request)10551057{10561058 drm_device_dma_t *dma = dev->dma;10571059 drm_buf_entry_t *entry;···12101212 atomic_dec(&dev->buf_alloc);12111213 return 0;12121214}12131213-EXPORT_SYMBOL(drm_addbufs_fb);121412151215121612161217/**
···2020 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI2121 and CONFIG_PNPACPI.22222323+config TCG_TIS2424+ tristate "TPM Interface Specification 1.2 Interface"2525+ depends on TCG_TPM2626+ ---help---2727+ If you have a TPM security chip that is compliant with the2828+ TCG TIS 1.2 TPM specification say Yes and it will be accessible2929+ from within Linux. To compile this driver as a module, choose3030+ M here; the module will be called tpm_tis.3131+2332config TCG_NSC2433 tristate "National Semiconductor TPM Interface"2525- depends on TCG_TPM3434+ depends on TCG_TPM && PNPACPI2635 ---help---2736 If you have a TPM security chip from National Semicondutor 2837 say Yes and it will be accessible from within Linux. To
···1515 * License.1616 */17171818+#include <linux/init.h>1819#include <linux/pnp.h>1920#include "tpm.h"2021···105104106105 if (clear_wrfifo) {107106 for (i = 0; i < 4096; i++) {108108- status = inb(chip->vendor->base + WRFIFO);107107+ status = inb(chip->vendor.base + WRFIFO);109108 if (status == 0xff) {110109 if (check == 5)111110 break;···125124 */126125 i = 0;127126 do {128128- status = inb(chip->vendor->base + RDFIFO);129129- status = inb(chip->vendor->base + STAT);127127+ status = inb(chip->vendor.base + RDFIFO);128128+ status = inb(chip->vendor.base + STAT);130129 i++;131130 if (i == TPM_MAX_TRIES)132131 return -EIO;···139138 int status;140139 int i;141140 for (i = 0; i < TPM_MAX_TRIES; i++) {142142- status = inb(chip->vendor->base + STAT);141141+ status = inb(chip->vendor.base + STAT);143142 /* check the status-register if wait_for_bit is set */144143 if (status & 1 << wait_for_bit)145144 break;···158157static void wait_and_send(struct tpm_chip *chip, u8 sendbyte)159158{160159 wait(chip, STAT_XFE);161161- outb(sendbyte, chip->vendor->base + WRFIFO);160160+ outb(sendbyte, chip->vendor.base + WRFIFO);162161}163162164163 /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more···205204 ret = wait(chip, STAT_RDA);206205 if (ret)207206 return -EIO;208208- buf[i] = inb(chip->vendor->base + RDFIFO);207207+ buf[i] = inb(chip->vendor.base + RDFIFO);209208 }210209211210 if (buf[0] != TPM_VL_VER) {···220219221220 for (i = 0; i < size; i++) {222221 wait(chip, STAT_RDA);223223- buf[i] = inb(chip->vendor->base + RDFIFO);222222+ buf[i] = inb(chip->vendor.base + RDFIFO);224223 }225224226225 if ((size == 0x6D00) && (buf[1] == 0x80)) {···269268 u8 count_high, count_low, count_4, count_3, count_2, count_1;270269271270 /* Disabling Reset, LP and IRQC */272272- outb(RESET_LP_IRQC_DISABLE, chip->vendor->base + CMD);271271+ outb(RESET_LP_IRQC_DISABLE, chip->vendor.base + CMD);273272274273 ret = empty_fifo(chip, 1);275274 if (ret) {···320319321320static u8 tpm_inf_status(struct tpm_chip *chip)322321{323323- return inb(chip->vendor->base + STAT);322322+ return inb(chip->vendor.base + STAT);324323}325324326325static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);···347346 .release = tpm_release,348347};349348350350-static struct tpm_vendor_specific tpm_inf = {349349+static const struct tpm_vendor_specific tpm_inf = {351350 .recv = tpm_inf_recv,352351 .send = tpm_inf_send,353352 .cancel = tpm_inf_cancel,···376375 int version[2];377376 int productid[2];378377 char chipname[20];378378+ struct tpm_chip *chip;379379380380 /* read IO-ports through PnP */381381 if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) &&···397395 goto err_last;398396 }399397 /* publish my base address and request region */400400- tpm_inf.base = TPM_INF_BASE;401398 if (request_region402402- (tpm_inf.base, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {399399+ (TPM_INF_BASE, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {403400 rc = -EINVAL;404401 goto err_last;405402 }406406- if (request_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN,407407- "tpm_infineon0") == NULL) {403403+ if (request_region404404+ (TPM_INF_ADDR, TPM_INF_ADDR_LEN, "tpm_infineon0") == NULL) {408405 rc = -EINVAL;409406 goto err_last;410407 }···443442444443 /* configure TPM with IO-ports */445444 outb(IOLIMH, TPM_INF_ADDR);446446- outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA);445445+ outb(((TPM_INF_BASE >> 8) & 0xff), TPM_INF_DATA);447446 outb(IOLIML, TPM_INF_ADDR);448448- outb((tpm_inf.base & 0xff), TPM_INF_DATA);447447+ outb((TPM_INF_BASE & 0xff), TPM_INF_DATA);449448450449 /* control if IO-ports are set correctly */451450 outb(IOLIMH, TPM_INF_ADDR);···453452 outb(IOLIML, TPM_INF_ADDR);454453 iol = inb(TPM_INF_DATA);455454456456- if ((ioh << 8 | iol) != tpm_inf.base) {455455+ if ((ioh << 8 | iol) != TPM_INF_BASE) {457456 dev_err(&dev->dev,458458- "Could not set IO-ports to 0x%lx\n",459459- tpm_inf.base);457457+ "Could not set IO-ports to 0x%x\n",458458+ TPM_INF_BASE);460459 rc = -EIO;461460 goto err_release_region;462461 }···467466 outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR);468467469468 /* disable RESET, LP and IRQC */470470- outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD);469469+ outb(RESET_LP_IRQC_DISABLE, TPM_INF_BASE + CMD);471470472471 /* Finally, we're done, print some infos */473472 dev_info(&dev->dev, "TPM found: "474473 "config base 0x%x, "475474 "io base 0x%x, "476476- "chip version %02x%02x, "477477- "vendor id %x%x (Infineon), "478478- "product id %02x%02x"475475+ "chip version 0x%02x%02x, "476476+ "vendor id 0x%x%x (Infineon), "477477+ "product id 0x%02x%02x"479478 "%s\n",480479 TPM_INF_ADDR,481480 TPM_INF_BASE,···483482 vendorid[0], vendorid[1],484483 productid[0], productid[1], chipname);485484486486- rc = tpm_register_hardware(&dev->dev, &tpm_inf);487487- if (rc < 0) {488488- rc = -ENODEV;485485+ if (!(chip = tpm_register_hardware(&dev->dev, &tpm_inf))) {489486 goto err_release_region;490487 }488488+ chip->vendor.base = TPM_INF_BASE;491489 return 0;492490 } else {493491 rc = -ENODEV;···494494 }495495496496err_release_region:497497- release_region(tpm_inf.base, TPM_INF_PORT_LEN);497497+ release_region(TPM_INF_BASE, TPM_INF_PORT_LEN);498498 release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);499499500500err_last:···506506 struct tpm_chip *chip = pnp_get_drvdata(dev);507507508508 if (chip) {509509- release_region(chip->vendor->base, TPM_INF_PORT_LEN);509509+ release_region(TPM_INF_BASE, TPM_INF_PORT_LEN);510510+ release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);510511 tpm_remove_hardware(chip->dev);511512 }512513}···521520 },522521 .id_table = tpm_pnp_tbl,523522 .probe = tpm_inf_pnp_probe,524524- .remove = tpm_inf_pnp_remove,523523+ .remove = __devexit_p(tpm_inf_pnp_remove),525524};526525527526static int __init init_inf(void)···539538540539MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>");541540MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2");542542-MODULE_VERSION("1.7");541541+MODULE_VERSION("1.8");543542MODULE_LICENSE("GPL");
+27-22
drivers/char/tpm/tpm_nsc.c
···7171 unsigned long stop;72727373 /* status immediately available check */7474- *data = inb(chip->vendor->base + NSC_STATUS);7474+ *data = inb(chip->vendor.base + NSC_STATUS);7575 if ((*data & mask) == val)7676 return 0;7777···7979 stop = jiffies + 10 * HZ;8080 do {8181 msleep(TPM_TIMEOUT);8282- *data = inb(chip->vendor->base + 1);8282+ *data = inb(chip->vendor.base + 1);8383 if ((*data & mask) == val)8484 return 0;8585 }···9494 unsigned long stop;95959696 /* status immediately available check */9797- status = inb(chip->vendor->base + NSC_STATUS);9797+ status = inb(chip->vendor.base + NSC_STATUS);9898 if (status & NSC_STATUS_OBF)9999- status = inb(chip->vendor->base + NSC_DATA);9999+ status = inb(chip->vendor.base + NSC_DATA);100100 if (status & NSC_STATUS_RDY)101101 return 0;102102···104104 stop = jiffies + 100;105105 do {106106 msleep(TPM_TIMEOUT);107107- status = inb(chip->vendor->base + NSC_STATUS);107107+ status = inb(chip->vendor.base + NSC_STATUS);108108 if (status & NSC_STATUS_OBF)109109- status = inb(chip->vendor->base + NSC_DATA);109109+ status = inb(chip->vendor.base + NSC_DATA);110110 if (status & NSC_STATUS_RDY)111111 return 0;112112 }···132132 return -EIO;133133 }134134 if ((data =135135- inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_NORMAL) {135135+ inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_NORMAL) {136136 dev_err(chip->dev, "not in normal mode (0x%x)\n",137137 data);138138 return -EIO;···148148 }149149 if (data & NSC_STATUS_F0)150150 break;151151- *p = inb(chip->vendor->base + NSC_DATA);151151+ *p = inb(chip->vendor.base + NSC_DATA);152152 }153153154154 if ((data & NSC_STATUS_F0) == 0 &&···156156 dev_err(chip->dev, "F0 not set\n");157157 return -EIO;158158 }159159- if ((data = inb(chip->vendor->base + NSC_DATA)) != NSC_COMMAND_EOC) {159159+ if ((data = inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_EOC) {160160 dev_err(chip->dev,161161 "expected end of command(0x%x)\n", data);162162 return -EIO;···182182 * fix it. Not sure why this is needed, we followed the flow183183 * chart in the manual to the letter.184184 */185185- outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND);185185+ outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);186186187187 if (nsc_wait_for_ready(chip) != 0)188188 return -EIO;···192192 return -EIO;193193 }194194195195- outb(NSC_COMMAND_NORMAL, chip->vendor->base + NSC_COMMAND);195195+ outb(NSC_COMMAND_NORMAL, chip->vendor.base + NSC_COMMAND);196196 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) {197197 dev_err(chip->dev, "IBR timeout\n");198198 return -EIO;···204204 "IBF timeout (while writing data)\n");205205 return -EIO;206206 }207207- outb(buf[i], chip->vendor->base + NSC_DATA);207207+ outb(buf[i], chip->vendor.base + NSC_DATA);208208 }209209210210 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) {211211 dev_err(chip->dev, "IBF timeout\n");212212 return -EIO;213213 }214214- outb(NSC_COMMAND_EOC, chip->vendor->base + NSC_COMMAND);214214+ outb(NSC_COMMAND_EOC, chip->vendor.base + NSC_COMMAND);215215216216 return count;217217}218218219219static void tpm_nsc_cancel(struct tpm_chip *chip)220220{221221- outb(NSC_COMMAND_CANCEL, chip->vendor->base + NSC_COMMAND);221221+ outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);222222}223223224224static u8 tpm_nsc_status(struct tpm_chip *chip)225225{226226- return inb(chip->vendor->base + NSC_STATUS);226226+ return inb(chip->vendor.base + NSC_STATUS);227227}228228229229static struct file_operations nsc_ops = {···250250251251static struct attribute_group nsc_attr_grp = { .attrs = nsc_attrs };252252253253-static struct tpm_vendor_specific tpm_nsc = {253253+static const struct tpm_vendor_specific tpm_nsc = {254254 .recv = tpm_nsc_recv,255255 .send = tpm_nsc_send,256256 .cancel = tpm_nsc_cancel,···268268{269269 struct tpm_chip *chip = dev_get_drvdata(dev);270270 if ( chip ) {271271- release_region(chip->vendor->base, 2);271271+ release_region(chip->vendor.base, 2);272272 tpm_remove_hardware(chip->dev);273273 }274274}···286286 int rc = 0;287287 int lo, hi;288288 int nscAddrBase = TPM_ADDR;289289-289289+ struct tpm_chip *chip;290290+ unsigned long base;290291291292 /* verify that it is a National part (SID) */292293 if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) {···301300302301 hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI);303302 lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO);304304- tpm_nsc.base = (hi<<8) | lo;303303+ base = (hi<<8) | lo;305304306305 /* enable the DPM module */307306 tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01);···321320 if ((rc = platform_device_register(pdev)) < 0)322321 goto err_free_dev;323322324324- if (request_region(tpm_nsc.base, 2, "tpm_nsc0") == NULL ) {323323+ if (request_region(base, 2, "tpm_nsc0") == NULL ) {325324 rc = -EBUSY;326325 goto err_unreg_dev;327326 }328327329329- if ((rc = tpm_register_hardware(&pdev->dev, &tpm_nsc)) < 0)328328+ if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {329329+ rc = -ENODEV;330330 goto err_rel_reg;331331+ }331332332333 dev_dbg(&pdev->dev, "NSC TPM detected\n");333334 dev_dbg(&pdev->dev,···364361 "NSC TPM revision %d\n",365362 tpm_read_index(nscAddrBase, 0x27) & 0x1F);366363364364+ chip->vendor.base = base;365365+367366 return 0;368367369368err_rel_reg:370370- release_region(tpm_nsc.base, 2);369369+ release_region(base, 2);371370err_unreg_dev:372371 platform_device_unregister(pdev);373372err_free_dev:
+669
drivers/char/tpm/tpm_tis.c
···11+/*22+ * Copyright (C) 2005, 2006 IBM Corporation33+ *44+ * Authors:55+ * Leendert van Doorn <leendert@watson.ibm.com>66+ * Kylene Hall <kjhall@us.ibm.com>77+ *88+ * Device driver for TCG/TCPA TPM (trusted platform module).99+ * Specifications at www.trustedcomputinggroup.org1010+ *1111+ * This device driver implements the TPM interface as defined in1212+ * the TCG TPM Interface Spec version 1.2, revision 1.0.1313+ *1414+ * This program is free software; you can redistribute it and/or1515+ * modify it under the terms of the GNU General Public License as1616+ * published by the Free Software Foundation, version 2 of the1717+ * License.1818+ */1919+#include <linux/init.h>2020+#include <linux/module.h>2121+#include <linux/moduleparam.h>2222+#include <linux/pnp.h>2323+#include <linux/interrupt.h>2424+#include <linux/wait.h>2525+#include "tpm.h"2626+2727+#define TPM_HEADER_SIZE 102828+2929+enum tis_access {3030+ TPM_ACCESS_VALID = 0x80,3131+ TPM_ACCESS_ACTIVE_LOCALITY = 0x20,3232+ TPM_ACCESS_REQUEST_PENDING = 0x04,3333+ TPM_ACCESS_REQUEST_USE = 0x02,3434+};3535+3636+enum tis_status {3737+ TPM_STS_VALID = 0x80,3838+ TPM_STS_COMMAND_READY = 0x40,3939+ TPM_STS_GO = 0x20,4040+ TPM_STS_DATA_AVAIL = 0x10,4141+ TPM_STS_DATA_EXPECT = 0x08,4242+};4343+4444+enum tis_int_flags {4545+ TPM_GLOBAL_INT_ENABLE = 0x80000000,4646+ TPM_INTF_BURST_COUNT_STATIC = 0x100,4747+ TPM_INTF_CMD_READY_INT = 0x080,4848+ TPM_INTF_INT_EDGE_FALLING = 0x040,4949+ TPM_INTF_INT_EDGE_RISING = 0x020,5050+ TPM_INTF_INT_LEVEL_LOW = 0x010,5151+ TPM_INTF_INT_LEVEL_HIGH = 0x008,5252+ TPM_INTF_LOCALITY_CHANGE_INT = 0x004,5353+ TPM_INTF_STS_VALID_INT = 0x002,5454+ TPM_INTF_DATA_AVAIL_INT = 0x001,5555+};5656+5757+enum tis_defaults {5858+ TIS_MEM_BASE = 0xFED4000,5959+ TIS_MEM_LEN = 0x5000,6060+ TIS_SHORT_TIMEOUT = 750, /* ms */6161+ TIS_LONG_TIMEOUT = 2000, /* 2 sec */6262+};6363+6464+#define TPM_ACCESS(l) (0x0000 | ((l) << 12))6565+#define TPM_INT_ENABLE(l) (0x0008 | ((l) << 12))6666+#define TPM_INT_VECTOR(l) (0x000C | ((l) << 12))6767+#define TPM_INT_STATUS(l) (0x0010 | ((l) << 12))6868+#define TPM_INTF_CAPS(l) (0x0014 | ((l) << 12))6969+#define TPM_STS(l) (0x0018 | ((l) << 12))7070+#define TPM_DATA_FIFO(l) (0x0024 | ((l) << 12))7171+7272+#define TPM_DID_VID(l) (0x0F00 | ((l) << 12))7373+#define TPM_RID(l) (0x0F04 | ((l) << 12))7474+7575+static LIST_HEAD(tis_chips);7676+static DEFINE_SPINLOCK(tis_lock);7777+7878+static int check_locality(struct tpm_chip *chip, int l)7979+{8080+ if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &8181+ (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==8282+ (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))8383+ return chip->vendor.locality = l;8484+8585+ return -1;8686+}8787+8888+static void release_locality(struct tpm_chip *chip, int l, int force)8989+{9090+ if (force || (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &9191+ (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==9292+ (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))9393+ iowrite8(TPM_ACCESS_ACTIVE_LOCALITY,9494+ chip->vendor.iobase + TPM_ACCESS(l));9595+}9696+9797+static int request_locality(struct tpm_chip *chip, int l)9898+{9999+ unsigned long stop;100100+ long rc;101101+102102+ if (check_locality(chip, l) >= 0)103103+ return l;104104+105105+ iowrite8(TPM_ACCESS_REQUEST_USE,106106+ chip->vendor.iobase + TPM_ACCESS(l));107107+108108+ if (chip->vendor.irq) {109109+ rc = wait_event_interruptible_timeout(chip->vendor.int_queue,110110+ (check_locality111111+ (chip, l) >= 0),112112+ chip->vendor.timeout_a);113113+ if (rc > 0)114114+ return l;115115+116116+ } else {117117+ /* wait for burstcount */118118+ stop = jiffies + chip->vendor.timeout_a;119119+ do {120120+ if (check_locality(chip, l) >= 0)121121+ return l;122122+ msleep(TPM_TIMEOUT);123123+ }124124+ while (time_before(jiffies, stop));125125+ }126126+ return -1;127127+}128128+129129+static u8 tpm_tis_status(struct tpm_chip *chip)130130+{131131+ return ioread8(chip->vendor.iobase +132132+ TPM_STS(chip->vendor.locality));133133+}134134+135135+static void tpm_tis_ready(struct tpm_chip *chip)136136+{137137+ /* this causes the current command to be aborted */138138+ iowrite8(TPM_STS_COMMAND_READY,139139+ chip->vendor.iobase + TPM_STS(chip->vendor.locality));140140+}141141+142142+static int get_burstcount(struct tpm_chip *chip)143143+{144144+ unsigned long stop;145145+ int burstcnt;146146+147147+ /* wait for burstcount */148148+ /* which timeout value, spec has 2 answers (c & d) */149149+ stop = jiffies + chip->vendor.timeout_d;150150+ do {151151+ burstcnt = ioread8(chip->vendor.iobase +152152+ TPM_STS(chip->vendor.locality) + 1);153153+ burstcnt += ioread8(chip->vendor.iobase +154154+ TPM_STS(chip->vendor.locality) +155155+ 2) << 8;156156+ if (burstcnt)157157+ return burstcnt;158158+ msleep(TPM_TIMEOUT);159159+ } while (time_before(jiffies, stop));160160+ return -EBUSY;161161+}162162+163163+static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,164164+ wait_queue_head_t *queue)165165+{166166+ unsigned long stop;167167+ long rc;168168+ u8 status;169169+170170+ /* check current status */171171+ status = tpm_tis_status(chip);172172+ if ((status & mask) == mask)173173+ return 0;174174+175175+ if (chip->vendor.irq) {176176+ rc = wait_event_interruptible_timeout(*queue,177177+ ((tpm_tis_status178178+ (chip) & mask) ==179179+ mask), timeout);180180+ if (rc > 0)181181+ return 0;182182+ } else {183183+ stop = jiffies + timeout;184184+ do {185185+ msleep(TPM_TIMEOUT);186186+ status = tpm_tis_status(chip);187187+ if ((status & mask) == mask)188188+ return 0;189189+ } while (time_before(jiffies, stop));190190+ }191191+ return -ETIME;192192+}193193+194194+static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)195195+{196196+ int size = 0, burstcnt;197197+ while (size < count &&198198+ wait_for_stat(chip,199199+ TPM_STS_DATA_AVAIL | TPM_STS_VALID,200200+ chip->vendor.timeout_c,201201+ &chip->vendor.read_queue)202202+ == 0) {203203+ burstcnt = get_burstcount(chip);204204+ for (; burstcnt > 0 && size < count; burstcnt--)205205+ buf[size++] = ioread8(chip->vendor.iobase +206206+ TPM_DATA_FIFO(chip->vendor.207207+ locality));208208+ }209209+ return size;210210+}211211+212212+static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)213213+{214214+ int size = 0;215215+ int expected, status;216216+217217+ if (count < TPM_HEADER_SIZE) {218218+ size = -EIO;219219+ goto out;220220+ }221221+222222+ /* read first 10 bytes, including tag, paramsize, and result */223223+ if ((size =224224+ recv_data(chip, buf, TPM_HEADER_SIZE)) < TPM_HEADER_SIZE) {225225+ dev_err(chip->dev, "Unable to read header\n");226226+ goto out;227227+ }228228+229229+ expected = be32_to_cpu(*(__be32 *) (buf + 2));230230+ if (expected > count) {231231+ size = -EIO;232232+ goto out;233233+ }234234+235235+ if ((size +=236236+ recv_data(chip, &buf[TPM_HEADER_SIZE],237237+ expected - TPM_HEADER_SIZE)) < expected) {238238+ dev_err(chip->dev, "Unable to read remainder of result\n");239239+ size = -ETIME;240240+ goto out;241241+ }242242+243243+ wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,244244+ &chip->vendor.int_queue);245245+ status = tpm_tis_status(chip);246246+ if (status & TPM_STS_DATA_AVAIL) { /* retry? */247247+ dev_err(chip->dev, "Error left over data\n");248248+ size = -EIO;249249+ goto out;250250+ }251251+252252+out:253253+ tpm_tis_ready(chip);254254+ release_locality(chip, chip->vendor.locality, 0);255255+ return size;256256+}257257+258258+/*259259+ * If interrupts are used (signaled by an irq set in the vendor structure)260260+ * tpm.c can skip polling for the data to be available as the interrupt is261261+ * waited for here262262+ */263263+static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)264264+{265265+ int rc, status, burstcnt;266266+ size_t count = 0;267267+ u32 ordinal;268268+269269+ if (request_locality(chip, 0) < 0)270270+ return -EBUSY;271271+272272+ status = tpm_tis_status(chip);273273+ if ((status & TPM_STS_COMMAND_READY) == 0) {274274+ tpm_tis_ready(chip);275275+ if (wait_for_stat276276+ (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,277277+ &chip->vendor.int_queue) < 0) {278278+ rc = -ETIME;279279+ goto out_err;280280+ }281281+ }282282+283283+ while (count < len - 1) {284284+ burstcnt = get_burstcount(chip);285285+ for (; burstcnt > 0 && count < len - 1; burstcnt--) {286286+ iowrite8(buf[count], chip->vendor.iobase +287287+ TPM_DATA_FIFO(chip->vendor.locality));288288+ count++;289289+ }290290+291291+ wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,292292+ &chip->vendor.int_queue);293293+ status = tpm_tis_status(chip);294294+ if ((status & TPM_STS_DATA_EXPECT) == 0) {295295+ rc = -EIO;296296+ goto out_err;297297+ }298298+ }299299+300300+ /* write last byte */301301+ iowrite8(buf[count],302302+ chip->vendor.iobase +303303+ TPM_DATA_FIFO(chip->vendor.locality));304304+ wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,305305+ &chip->vendor.int_queue);306306+ status = tpm_tis_status(chip);307307+ if ((status & TPM_STS_DATA_EXPECT) != 0) {308308+ rc = -EIO;309309+ goto out_err;310310+ }311311+312312+ /* go and do it */313313+ iowrite8(TPM_STS_GO,314314+ chip->vendor.iobase + TPM_STS(chip->vendor.locality));315315+316316+ if (chip->vendor.irq) {317317+ ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));318318+ if (wait_for_stat319319+ (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,320320+ tpm_calc_ordinal_duration(chip, ordinal),321321+ &chip->vendor.read_queue) < 0) {322322+ rc = -ETIME;323323+ goto out_err;324324+ }325325+ }326326+ return len;327327+out_err:328328+ tpm_tis_ready(chip);329329+ release_locality(chip, chip->vendor.locality, 0);330330+ return rc;331331+}332332+333333+static struct file_operations tis_ops = {334334+ .owner = THIS_MODULE,335335+ .llseek = no_llseek,336336+ .open = tpm_open,337337+ .read = tpm_read,338338+ .write = tpm_write,339339+ .release = tpm_release,340340+};341341+342342+static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL);343343+static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL);344344+static DEVICE_ATTR(enabled, S_IRUGO, tpm_show_enabled, NULL);345345+static DEVICE_ATTR(active, S_IRUGO, tpm_show_active, NULL);346346+static DEVICE_ATTR(owned, S_IRUGO, tpm_show_owned, NULL);347347+static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated,348348+ NULL);349349+static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL);350350+static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel);351351+352352+static struct attribute *tis_attrs[] = {353353+ &dev_attr_pubek.attr,354354+ &dev_attr_pcrs.attr,355355+ &dev_attr_enabled.attr,356356+ &dev_attr_active.attr,357357+ &dev_attr_owned.attr,358358+ &dev_attr_temp_deactivated.attr,359359+ &dev_attr_caps.attr,360360+ &dev_attr_cancel.attr, NULL,361361+};362362+363363+static struct attribute_group tis_attr_grp = {364364+ .attrs = tis_attrs365365+};366366+367367+static struct tpm_vendor_specific tpm_tis = {368368+ .status = tpm_tis_status,369369+ .recv = tpm_tis_recv,370370+ .send = tpm_tis_send,371371+ .cancel = tpm_tis_ready,372372+ .req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID,373373+ .req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID,374374+ .req_canceled = TPM_STS_COMMAND_READY,375375+ .attr_group = &tis_attr_grp,376376+ .miscdev = {377377+ .fops = &tis_ops,},378378+};379379+380380+static irqreturn_t tis_int_probe(int irq, void *dev_id, struct pt_regs *regs)381381+{382382+ struct tpm_chip *chip = (struct tpm_chip *) dev_id;383383+ u32 interrupt;384384+385385+ interrupt = ioread32(chip->vendor.iobase +386386+ TPM_INT_STATUS(chip->vendor.locality));387387+388388+ if (interrupt == 0)389389+ return IRQ_NONE;390390+391391+ chip->vendor.irq = irq;392392+393393+ /* Clear interrupts handled with TPM_EOI */394394+ iowrite32(interrupt,395395+ chip->vendor.iobase +396396+ TPM_INT_STATUS(chip->vendor.locality));397397+ return IRQ_HANDLED;398398+}399399+400400+static irqreturn_t tis_int_handler(int irq, void *dev_id, struct pt_regs *regs)401401+{402402+ struct tpm_chip *chip = (struct tpm_chip *) dev_id;403403+ u32 interrupt;404404+ int i;405405+406406+ interrupt = ioread32(chip->vendor.iobase +407407+ TPM_INT_STATUS(chip->vendor.locality));408408+409409+ if (interrupt == 0)410410+ return IRQ_NONE;411411+412412+ if (interrupt & TPM_INTF_DATA_AVAIL_INT)413413+ wake_up_interruptible(&chip->vendor.read_queue);414414+ if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)415415+ for (i = 0; i < 5; i++)416416+ if (check_locality(chip, i) >= 0)417417+ break;418418+ if (interrupt &419419+ (TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_STS_VALID_INT |420420+ TPM_INTF_CMD_READY_INT))421421+ wake_up_interruptible(&chip->vendor.int_queue);422422+423423+ /* Clear interrupts handled with TPM_EOI */424424+ iowrite32(interrupt,425425+ chip->vendor.iobase +426426+ TPM_INT_STATUS(chip->vendor.locality));427427+ return IRQ_HANDLED;428428+}429429+430430+static int interrupts = 1;431431+module_param(interrupts, bool, 0444);432432+MODULE_PARM_DESC(interrupts, "Enable interrupts");433433+434434+static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,435435+ const struct pnp_device_id *pnp_id)436436+{437437+ u32 vendor, intfcaps, intmask;438438+ int rc, i;439439+ unsigned long start, len;440440+ struct tpm_chip *chip;441441+442442+ start = pnp_mem_start(pnp_dev, 0);443443+ len = pnp_mem_len(pnp_dev, 0);444444+445445+ if (!start)446446+ start = TIS_MEM_BASE;447447+ if (!len)448448+ len = TIS_MEM_LEN;449449+450450+ if (!(chip = tpm_register_hardware(&pnp_dev->dev, &tpm_tis)))451451+ return -ENODEV;452452+453453+ chip->vendor.iobase = ioremap(start, len);454454+ if (!chip->vendor.iobase) {455455+ rc = -EIO;456456+ goto out_err;457457+ }458458+459459+ vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));460460+ if ((vendor & 0xFFFF) == 0xFFFF) {461461+ rc = -ENODEV;462462+ goto out_err;463463+ }464464+465465+ /* Default timeouts */466466+ chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);467467+ chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);468468+ chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);469469+ chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);470470+471471+ dev_info(&pnp_dev->dev,472472+ "1.2 TPM (device-id 0x%X, rev-id %d)\n",473473+ vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));474474+475475+ /* Figure out the capabilities */476476+ intfcaps =477477+ ioread32(chip->vendor.iobase +478478+ TPM_INTF_CAPS(chip->vendor.locality));479479+ dev_dbg(&pnp_dev->dev, "TPM interface capabilities (0x%x):\n",480480+ intfcaps);481481+ if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)482482+ dev_dbg(&pnp_dev->dev, "\tBurst Count Static\n");483483+ if (intfcaps & TPM_INTF_CMD_READY_INT)484484+ dev_dbg(&pnp_dev->dev, "\tCommand Ready Int Support\n");485485+ if (intfcaps & TPM_INTF_INT_EDGE_FALLING)486486+ dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Falling\n");487487+ if (intfcaps & TPM_INTF_INT_EDGE_RISING)488488+ dev_dbg(&pnp_dev->dev, "\tInterrupt Edge Rising\n");489489+ if (intfcaps & TPM_INTF_INT_LEVEL_LOW)490490+ dev_dbg(&pnp_dev->dev, "\tInterrupt Level Low\n");491491+ if (intfcaps & TPM_INTF_INT_LEVEL_HIGH)492492+ dev_dbg(&pnp_dev->dev, "\tInterrupt Level High\n");493493+ if (intfcaps & TPM_INTF_LOCALITY_CHANGE_INT)494494+ dev_dbg(&pnp_dev->dev, "\tLocality Change Int Support\n");495495+ if (intfcaps & TPM_INTF_STS_VALID_INT)496496+ dev_dbg(&pnp_dev->dev, "\tSts Valid Int Support\n");497497+ if (intfcaps & TPM_INTF_DATA_AVAIL_INT)498498+ dev_dbg(&pnp_dev->dev, "\tData Avail Int Support\n");499499+500500+ if (request_locality(chip, 0) != 0) {501501+ rc = -ENODEV;502502+ goto out_err;503503+ }504504+505505+ /* INTERRUPT Setup */506506+ init_waitqueue_head(&chip->vendor.read_queue);507507+ init_waitqueue_head(&chip->vendor.int_queue);508508+509509+ intmask =510510+ ioread32(chip->vendor.iobase +511511+ TPM_INT_ENABLE(chip->vendor.locality));512512+513513+ intmask |= TPM_INTF_CMD_READY_INT514514+ | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT515515+ | TPM_INTF_STS_VALID_INT;516516+517517+ iowrite32(intmask,518518+ chip->vendor.iobase +519519+ TPM_INT_ENABLE(chip->vendor.locality));520520+ if (interrupts) {521521+ chip->vendor.irq =522522+ ioread8(chip->vendor.iobase +523523+ TPM_INT_VECTOR(chip->vendor.locality));524524+525525+ for (i = 3; i < 16 && chip->vendor.irq == 0; i++) {526526+ iowrite8(i, chip->vendor.iobase +527527+ TPM_INT_VECTOR(chip->vendor.locality));528528+ if (request_irq529529+ (i, tis_int_probe, SA_SHIRQ,530530+ chip->vendor.miscdev.name, chip) != 0) {531531+ dev_info(chip->dev,532532+ "Unable to request irq: %d for probe\n",533533+ i);534534+ continue;535535+ }536536+537537+ /* Clear all existing */538538+ iowrite32(ioread32539539+ (chip->vendor.iobase +540540+ TPM_INT_STATUS(chip->vendor.locality)),541541+ chip->vendor.iobase +542542+ TPM_INT_STATUS(chip->vendor.locality));543543+544544+ /* Turn on */545545+ iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,546546+ chip->vendor.iobase +547547+ TPM_INT_ENABLE(chip->vendor.locality));548548+549549+ /* Generate Interrupts */550550+ tpm_gen_interrupt(chip);551551+552552+ /* Turn off */553553+ iowrite32(intmask,554554+ chip->vendor.iobase +555555+ TPM_INT_ENABLE(chip->vendor.locality));556556+ free_irq(i, chip);557557+ }558558+ }559559+ if (chip->vendor.irq) {560560+ iowrite8(chip->vendor.irq,561561+ chip->vendor.iobase +562562+ TPM_INT_VECTOR(chip->vendor.locality));563563+ if (request_irq564564+ (chip->vendor.irq, tis_int_handler, SA_SHIRQ,565565+ chip->vendor.miscdev.name, chip) != 0) {566566+ dev_info(chip->dev,567567+ "Unable to request irq: %d for use\n",568568+ chip->vendor.irq);569569+ chip->vendor.irq = 0;570570+ } else {571571+ /* Clear all existing */572572+ iowrite32(ioread32573573+ (chip->vendor.iobase +574574+ TPM_INT_STATUS(chip->vendor.locality)),575575+ chip->vendor.iobase +576576+ TPM_INT_STATUS(chip->vendor.locality));577577+578578+ /* Turn on */579579+ iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,580580+ chip->vendor.iobase +581581+ TPM_INT_ENABLE(chip->vendor.locality));582582+ }583583+ }584584+585585+ INIT_LIST_HEAD(&chip->vendor.list);586586+ spin_lock(&tis_lock);587587+ list_add(&chip->vendor.list, &tis_chips);588588+ spin_unlock(&tis_lock);589589+590590+ tpm_get_timeouts(chip);591591+ tpm_continue_selftest(chip);592592+593593+ return 0;594594+out_err:595595+ if (chip->vendor.iobase)596596+ iounmap(chip->vendor.iobase);597597+ tpm_remove_hardware(chip->dev);598598+ return rc;599599+}600600+601601+static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)602602+{603603+ return tpm_pm_suspend(&dev->dev, msg);604604+}605605+606606+static int tpm_tis_pnp_resume(struct pnp_dev *dev)607607+{608608+ return tpm_pm_resume(&dev->dev);609609+}610610+611611+static struct pnp_device_id tpm_pnp_tbl[] __devinitdata = {612612+ {"PNP0C31", 0}, /* TPM */613613+ {"ATM1200", 0}, /* Atmel */614614+ {"IFX0102", 0}, /* Infineon */615615+ {"BCM0101", 0}, /* Broadcom */616616+ {"NSC1200", 0}, /* National */617617+ /* Add new here */618618+ {"", 0}, /* User Specified */619619+ {"", 0} /* Terminator */620620+};621621+622622+static struct pnp_driver tis_pnp_driver = {623623+ .name = "tpm_tis",624624+ .id_table = tpm_pnp_tbl,625625+ .probe = tpm_tis_pnp_init,626626+ .suspend = tpm_tis_pnp_suspend,627627+ .resume = tpm_tis_pnp_resume,628628+};629629+630630+#define TIS_HID_USR_IDX sizeof(tpm_pnp_tbl)/sizeof(struct pnp_device_id) -2631631+module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,632632+ sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);633633+MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");634634+635635+static int __init init_tis(void)636636+{637637+ return pnp_register_driver(&tis_pnp_driver);638638+}639639+640640+static void __exit cleanup_tis(void)641641+{642642+ struct tpm_vendor_specific *i, *j;643643+ struct tpm_chip *chip;644644+ spin_lock(&tis_lock);645645+ list_for_each_entry_safe(i, j, &tis_chips, list) {646646+ chip = to_tpm_chip(i);647647+ iowrite32(~TPM_GLOBAL_INT_ENABLE &648648+ ioread32(chip->vendor.iobase +649649+ TPM_INT_ENABLE(chip->vendor.650650+ locality)),651651+ chip->vendor.iobase +652652+ TPM_INT_ENABLE(chip->vendor.locality));653653+ release_locality(chip, chip->vendor.locality, 1);654654+ if (chip->vendor.irq)655655+ free_irq(chip->vendor.irq, chip);656656+ iounmap(i->iobase);657657+ list_del(&i->list);658658+ tpm_remove_hardware(chip->dev);659659+ }660660+ spin_unlock(&tis_lock);661661+ pnp_unregister_driver(&tis_pnp_driver);662662+}663663+664664+module_init(init_tis);665665+module_exit(cleanup_tis);666666+MODULE_AUTHOR("Leendert van Doorn (leendert@watson.ibm.com)");667667+MODULE_DESCRIPTION("TPM Driver");668668+MODULE_VERSION("2.0");669669+MODULE_LICENSE("GPL");
+1-1
drivers/cpufreq/cpufreq.c
···14971497}14981498EXPORT_SYMBOL(cpufreq_update_policy);1499149915001500-static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb,15001500+static int cpufreq_cpu_callback(struct notifier_block *nfb,15011501 unsigned long action, void *hcpu)15021502{15031503 unsigned int cpu = (unsigned long)hcpu;
···55 * Tilman Schmidt <tilman@imap.cc>,66 * Stefan Eilers.77 *88- * Based on usb-gigaset.c.99- *108 * =====================================================================119 * This program is free software; you can redistribute it and/or1210 * modify it under the terms of the GNU General Public License as···4446#define GIGASET_DEVFSNAME "gig/bas/"4547#define GIGASET_DEVNAME "ttyGB"46484747-#define IF_WRITEBUF 256 //FIXME4949+/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */5050+#define IF_WRITEBUF 26448514952/* Values for the Gigaset 307x */5053#define USB_GIGA_VENDOR_ID 0x06815151-#define USB_GIGA_PRODUCT_ID 0x00015252-#define USB_4175_PRODUCT_ID 0x00025454+#define USB_3070_PRODUCT_ID 0x00015555+#define USB_3075_PRODUCT_ID 0x00025356#define USB_SX303_PRODUCT_ID 0x00215457#define USB_SX353_PRODUCT_ID 0x002255585659/* table of devices that work with this driver */5760static struct usb_device_id gigaset_table [] = {5858- { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_GIGA_PRODUCT_ID) },5959- { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_4175_PRODUCT_ID) },6161+ { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3070_PRODUCT_ID) },6262+ { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_3075_PRODUCT_ID) },6063 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX303_PRODUCT_ID) },6164 { USB_DEVICE(USB_GIGA_VENDOR_ID, USB_SX353_PRODUCT_ID) },6265 { } /* Terminating entry */···7677/* Function will be called if the device is unplugged */7778static void gigaset_disconnect(struct usb_interface *interface);78798080+static void read_ctrl_callback(struct urb *, struct pt_regs *);8181+static void stopurbs(struct bas_bc_state *);8282+static int atwrite_submit(struct cardstate *, unsigned char *, int);8383+static int start_cbsend(struct cardstate *);79848085/*==============================================================================*/8186···114111};115112116113/* status of direct USB connection to 307x base (bits in basstate) */117117-#define BS_ATOPEN 0x001118118-#define BS_B1OPEN 0x002119119-#define BS_B2OPEN 0x004120120-#define BS_ATREADY 0x008121121-#define BS_INIT 0x010122122-#define BS_ATTIMER 0x020114114+#define BS_ATOPEN 0x001 /* AT channel open */115115+#define BS_B1OPEN 0x002 /* B channel 1 open */116116+#define BS_B2OPEN 0x004 /* B channel 2 open */117117+#define BS_ATREADY 0x008 /* base ready for AT command */118118+#define BS_INIT 0x010 /* base has signalled INIT_OK */119119+#define BS_ATTIMER 0x020 /* waiting for HD_READY_SEND_ATDATA */120120+#define BS_ATRDPEND 0x040 /* urb_cmd_in in use */121121+#define BS_ATWRPEND 0x080 /* urb_cmd_out in use */123122124123125124static struct gigaset_driver *driver = NULL;···135130 .id_table = gigaset_table,136131};137132133133+/* get message text for usb_submit_urb return code134134+ */135135+static char *get_usb_rcmsg(int rc)136136+{137137+ static char unkmsg[28];138138+139139+ switch (rc) {140140+ case 0:141141+ return "success";142142+ case -ENOMEM:143143+ return "out of memory";144144+ case -ENODEV:145145+ return "device not present";146146+ case -ENOENT:147147+ return "endpoint not present";148148+ case -ENXIO:149149+ return "URB type not supported";150150+ case -EINVAL:151151+ return "invalid argument";152152+ case -EAGAIN:153153+ return "start frame too early or too much scheduled";154154+ case -EFBIG:155155+ return "too many isochronous frames requested";156156+ case -EPIPE:157157+ return "endpoint stalled";158158+ case -EMSGSIZE:159159+ return "invalid packet size";160160+ case -ENOSPC:161161+ return "would overcommit USB bandwidth";162162+ case -ESHUTDOWN:163163+ return "device shut down";164164+ case -EPERM:165165+ return "reject flag set";166166+ case -EHOSTUNREACH:167167+ return "device suspended";168168+ default:169169+ snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", rc);170170+ return unkmsg;171171+ }172172+}173173+138174/* get message text for USB status code139175 */140176static char *get_usb_statmsg(int status)···186140 case 0:187141 return "success";188142 case -ENOENT:189189- return "canceled";190190- case -ECONNRESET:191191- return "canceled (async)";143143+ return "unlinked (sync)";192144 case -EINPROGRESS:193145 return "pending";194146 case -EPROTO:195195- return "bit stuffing or unknown USB error";147147+ return "bit stuffing error, timeout, or unknown USB error";196148 case -EILSEQ:197197- return "Illegal byte sequence (CRC mismatch)";198198- case -EPIPE:199199- return "babble detect or endpoint stalled";200200- case -ENOSR:201201- return "buffer error";149149+ return "CRC mismatch, timeout, or unknown USB error";202150 case -ETIMEDOUT:203151 return "timed out";204204- case -ENODEV:205205- return "device not present";152152+ case -EPIPE:153153+ return "endpoint stalled";154154+ case -ECOMM:155155+ return "IN buffer overrun";156156+ case -ENOSR:157157+ return "OUT buffer underrun";158158+ case -EOVERFLOW:159159+ return "too much data";206160 case -EREMOTEIO:207161 return "short packet detected";162162+ case -ENODEV:163163+ return "device removed";208164 case -EXDEV:209165 return "partial isochronous transfer";210166 case -EINVAL:211167 return "invalid argument";212212- case -ENXIO:213213- return "URB already queued";214214- case -EAGAIN:215215- return "isochronous start frame too early or too much scheduled";216216- case -EFBIG:217217- return "too many isochronous frames requested";218218- case -EMSGSIZE:219219- return "endpoint message size zero";168168+ case -ECONNRESET:169169+ return "unlinked (async)";220170 case -ESHUTDOWN:221221- return "endpoint shutdown";222222- case -EBUSY:223223- return "another request pending";171171+ return "device shut down";224172 default:225225- snprintf(unkmsg, sizeof(unkmsg), "unknown error %d", status);173173+ snprintf(unkmsg, sizeof(unkmsg), "unknown status %d", status);226174 return unkmsg;227175 }228176}···317277 gig_dbg(DEBUG_ANY, "%s: scheduling HUP for channel %d",318278 __func__, bcs->channel);319279320320- if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL)) {321321- //FIXME what should we do?322322- return;323323- }280280+ if (!gigaset_add_event(cs, &bcs->at_state, EV_HUP, NULL, 0, NULL))281281+ dev_err(cs->dev, "event queue full\n");324282325283 gigaset_schedule_event(cs);326284}327285328286/* error_reset329287 * reset Gigaset device because of an unrecoverable error330330- * This function may be called from any context and takes care of scheduling331331- * the necessary actions for execution outside of interrupt context.288288+ * This function may be called from any context, and should take care of289289+ * scheduling the necessary actions for execution outside of interrupt context.290290+ * Right now, it just generates a kernel message calling for help.332291 * argument:333292 * controller state structure334293 */···403364{404365 struct cardstate *cs = (struct cardstate *) data;405366 struct bas_cardstate *ucs = cs->hw.bas;406406- unsigned long flags;407367408408- spin_lock_irqsave(&cs->lock, flags);409409- if (unlikely(!cs->connected)) {410410- gig_dbg(DEBUG_USBREQ, "%s: disconnected", __func__);411411- spin_unlock_irqrestore(&cs->lock, flags);412412- return;413413- }414368 if (!ucs->rcvbuf_size) {415369 gig_dbg(DEBUG_USBREQ, "%s: no receive in progress", __func__);416416- spin_unlock_irqrestore(&cs->lock, flags);417370 return;418371 }419419- spin_unlock_irqrestore(&cs->lock, flags);420372421373 dev_err(cs->dev, "timeout reading AT response\n");422374 error_reset(cs); //FIXME retry?423375}424376377377+/* set/clear bits in base connection state, return previous state378378+ */379379+inline static int update_basstate(struct bas_cardstate *ucs,380380+ int set, int clear)381381+{382382+ unsigned long flags;383383+ int state;425384426426-static void read_ctrl_callback(struct urb *urb, struct pt_regs *regs);385385+ spin_lock_irqsave(&ucs->lock, flags);386386+ state = atomic_read(&ucs->basstate);387387+ atomic_set(&ucs->basstate, (state & ~clear) | set);388388+ spin_unlock_irqrestore(&ucs->lock, flags);389389+ return state;390390+}427391428392/* atread_submit429429- * submit an HD_READ_ATMESSAGE command URB393393+ * submit an HD_READ_ATMESSAGE command URB and optionally start a timeout430394 * parameters:431395 * cs controller state structure432396 * timeout timeout in 1/10 sec., 0: none433397 * return value:434398 * 0 on success435435- * -EINVAL if a NULL pointer is encountered somewhere436399 * -EBUSY if another request is pending437400 * any URB submission error code438401 */···446405 gig_dbg(DEBUG_USBREQ, "-------> HD_READ_ATMESSAGE (%d)",447406 ucs->rcvbuf_size);448407449449- if (ucs->urb_cmd_in->status == -EINPROGRESS) {408408+ if (update_basstate(ucs, BS_ATRDPEND, 0) & BS_ATRDPEND) {450409 dev_err(cs->dev,451410 "could not submit HD_READ_ATMESSAGE: URB busy\n");452411 return -EBUSY;···464423 read_ctrl_callback, cs->inbuf);465424466425 if ((ret = usb_submit_urb(ucs->urb_cmd_in, SLAB_ATOMIC)) != 0) {426426+ update_basstate(ucs, 0, BS_ATRDPEND);467427 dev_err(cs->dev, "could not submit HD_READ_ATMESSAGE: %s\n",468428 get_usb_statmsg(ret));469429 return ret;···480438 return 0;481439}482440483483-static void stopurbs(struct bas_bc_state *);484484-static int start_cbsend(struct cardstate *);485485-486486-/* set/clear bits in base connection state487487- */488488-inline static void update_basstate(struct bas_cardstate *ucs,489489- int set, int clear)490490-{491491- unsigned long flags;492492- int state;493493-494494- spin_lock_irqsave(&ucs->lock, flags);495495- state = atomic_read(&ucs->basstate);496496- state &= ~clear;497497- state |= set;498498- atomic_set(&ucs->basstate, state);499499- spin_unlock_irqrestore(&ucs->lock, flags);500500-}501501-502502-503441/* read_int_callback504442 * USB completion handler for interrupt pipe input505443 * called by the USB subsystem in interrupt context···493471 struct bas_cardstate *ucs = cs->hw.bas;494472 struct bc_state *bcs;495473 unsigned long flags;496496- int status;474474+ int rc;497475 unsigned l;498476 int channel;499477500478 switch (urb->status) {501479 case 0: /* success */502480 break;503503- case -ENOENT: /* canceled */504504- case -ECONNRESET: /* canceled (async) */481481+ case -ENOENT: /* cancelled */482482+ case -ECONNRESET: /* cancelled (async) */505483 case -EINPROGRESS: /* pending */506484 /* ignore silently */507485 gig_dbg(DEBUG_USBREQ, "%s: %s",508486 __func__, get_usb_statmsg(urb->status));509487 return;488488+ case -ENODEV: /* device removed */489489+ case -ESHUTDOWN: /* device shut down */490490+ //FIXME use this as disconnect indicator?491491+ gig_dbg(DEBUG_USBREQ, "%s: device disconnected", __func__);492492+ return;510493 default: /* severe trouble */511494 dev_warn(cs->dev, "interrupt read: %s\n",512495 get_usb_statmsg(urb->status));513496 //FIXME corrective action? resubmission always ok?497497+ goto resubmit;498498+ }499499+500500+ /* drop incomplete packets even if the missing bytes wouldn't matter */501501+ if (unlikely(urb->actual_length < 3)) {502502+ dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",503503+ urb->actual_length);514504 goto resubmit;515505 }516506···592558 }593559 spin_lock_irqsave(&cs->lock, flags);594560 if (ucs->rcvbuf_size) {595595- spin_unlock_irqrestore(&cs->lock, flags);561561+ /* throw away previous buffer - we have no queue */596562 dev_err(cs->dev,597597- "receive AT data overrun, %d bytes lost\n", l);598598- error_reset(cs); //FIXME reschedule599599- break;563563+ "receive AT data overrun, %d bytes lost\n",564564+ ucs->rcvbuf_size);565565+ kfree(ucs->rcvbuf);566566+ ucs->rcvbuf_size = 0;600567 }601568 if ((ucs->rcvbuf = kmalloc(l, GFP_ATOMIC)) == NULL) {602569 spin_unlock_irqrestore(&cs->lock, flags);603603- dev_err(cs->dev, "out of memory, %d bytes lost\n", l);604604- error_reset(cs); //FIXME reschedule570570+ dev_err(cs->dev, "out of memory receiving AT data\n");571571+ error_reset(cs);605572 break;606573 }607574 ucs->rcvbuf_size = l;608575 ucs->retry_cmd_in = 0;609609- if ((status = atread_submit(cs, BAS_TIMEOUT)) < 0) {576576+ if ((rc = atread_submit(cs, BAS_TIMEOUT)) < 0) {610577 kfree(ucs->rcvbuf);611578 ucs->rcvbuf = NULL;612579 ucs->rcvbuf_size = 0;613613- error_reset(cs); //FIXME reschedule580580+ if (rc != -ENODEV)581581+ //FIXME corrective action?582582+ error_reset(cs);614583 }615584 spin_unlock_irqrestore(&cs->lock, flags);616585 break;···635598 check_pending(ucs);636599637600resubmit:638638- spin_lock_irqsave(&cs->lock, flags);639639- status = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV;640640- spin_unlock_irqrestore(&cs->lock, flags);641641- if (unlikely(status)) {601601+ rc = usb_submit_urb(urb, SLAB_ATOMIC);602602+ if (unlikely(rc != 0 && rc != -ENODEV)) {642603 dev_err(cs->dev, "could not resubmit interrupt URB: %s\n",643643- get_usb_statmsg(status));604604+ get_usb_rcmsg(rc));644605 error_reset(cs);645606 }646607}···657622 struct bas_cardstate *ucs = cs->hw.bas;658623 int have_data = 0;659624 unsigned numbytes;660660- unsigned long flags;625625+ int rc;661626662662- spin_lock_irqsave(&cs->lock, flags);663663- if (unlikely(!cs->connected)) {664664- warn("%s: disconnected", __func__);665665- spin_unlock_irqrestore(&cs->lock, flags);666666- return;667667- }627627+ update_basstate(ucs, 0, BS_ATRDPEND);668628669629 if (!ucs->rcvbuf_size) {670630 dev_warn(cs->dev, "%s: no receive in progress\n", __func__);671671- spin_unlock_irqrestore(&cs->lock, flags);672631 return;673632 }674633···695666 }696667 break;697668698698- case -ENOENT: /* canceled */699699- case -ECONNRESET: /* canceled (async) */669669+ case -ENOENT: /* cancelled */670670+ case -ECONNRESET: /* cancelled (async) */700671 case -EINPROGRESS: /* pending */672672+ case -ENODEV: /* device removed */673673+ case -ESHUTDOWN: /* device shut down */701674 /* no action necessary */702675 gig_dbg(DEBUG_USBREQ, "%s: %s",703676 __func__, get_usb_statmsg(urb->status));···712681 if (ucs->retry_cmd_in++ < BAS_RETRY) {713682 dev_notice(cs->dev, "control read: retry %d\n",714683 ucs->retry_cmd_in);715715- if (atread_submit(cs, BAS_TIMEOUT) >= 0) {716716- /* resubmitted - bypass regular exit block */717717- spin_unlock_irqrestore(&cs->lock, flags);684684+ rc = atread_submit(cs, BAS_TIMEOUT);685685+ if (rc >= 0 || rc == -ENODEV)686686+ /* resubmitted or disconnected */687687+ /* - bypass regular exit block */718688 return;719719- }720689 } else {721690 dev_err(cs->dev,722691 "control read: giving up after %d tries\n",···728697 kfree(ucs->rcvbuf);729698 ucs->rcvbuf = NULL;730699 ucs->rcvbuf_size = 0;731731- spin_unlock_irqrestore(&cs->lock, flags);732700 if (have_data) {733701 gig_dbg(DEBUG_INTR, "%s-->BH", __func__);734702 gigaset_schedule_event(cs);···749719 int i, rc;750720751721 /* status codes not worth bothering the tasklet with */752752- if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET ||753753- urb->status == -EINPROGRESS)) {722722+ if (unlikely(urb->status == -ENOENT ||723723+ urb->status == -ECONNRESET ||724724+ urb->status == -EINPROGRESS ||725725+ urb->status == -ENODEV ||726726+ urb->status == -ESHUTDOWN)) {754727 gig_dbg(DEBUG_ISO, "%s: %s",755728 __func__, get_usb_statmsg(urb->status));756729 return;···773740 for (i = 0; i < BAS_NUMFRAMES; i++) {774741 ubc->isoinlost += urb->iso_frame_desc[i].actual_length;775742 if (unlikely(urb->iso_frame_desc[i].status != 0 &&776776- urb->iso_frame_desc[i].status != -EINPROGRESS)) {743743+ urb->iso_frame_desc[i].status !=744744+ -EINPROGRESS))777745 ubc->loststatus = urb->iso_frame_desc[i].status;778778- }779746 urb->iso_frame_desc[i].status = 0;780747 urb->iso_frame_desc[i].actual_length = 0;781748 }···787754 gig_dbg(DEBUG_ISO, "%s: isoc read overrun/resubmit",788755 __func__);789756 rc = usb_submit_urb(urb, SLAB_ATOMIC);790790- if (unlikely(rc != 0)) {757757+ if (unlikely(rc != 0 && rc != -ENODEV)) {791758 dev_err(bcs->cs->dev,792759 "could not resubmit isochronous read "793793- "URB: %s\n", get_usb_statmsg(rc));760760+ "URB: %s\n", get_usb_rcmsg(rc));794761 dump_urb(DEBUG_ISO, "isoc read", urb);795762 error_hangup(bcs);796763 }···813780 unsigned long flags;814781815782 /* status codes not worth bothering the tasklet with */816816- if (unlikely(urb->status == -ENOENT || urb->status == -ECONNRESET ||817817- urb->status == -EINPROGRESS)) {783783+ if (unlikely(urb->status == -ENOENT ||784784+ urb->status == -ECONNRESET ||785785+ urb->status == -EINPROGRESS ||786786+ urb->status == -ENODEV ||787787+ urb->status == -ESHUTDOWN)) {818788 gig_dbg(DEBUG_ISO, "%s: %s",819789 __func__, get_usb_statmsg(urb->status));820790 return;···858822 for (k = 0; k < BAS_INURBS; k++) {859823 urb = ubc->isoinurbs[k];860824 if (!urb) {861861- dev_err(bcs->cs->dev, "isoinurbs[%d]==NULL\n", k);862825 rc = -EFAULT;863826 goto error;864827 }···879844 }880845881846 dump_urb(DEBUG_ISO, "Initial isoc read", urb);882882- if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0) {883883- dev_err(bcs->cs->dev,884884- "could not submit isochronous read URB %d: %s\n",885885- k, get_usb_statmsg(rc));847847+ if ((rc = usb_submit_urb(urb, SLAB_ATOMIC)) != 0)886848 goto error;887887- }888849 }889850890851 /* initialize L2 transmission */···890859 for (k = 0; k < BAS_OUTURBS; ++k) {891860 urb = ubc->isoouturbs[k].urb;892861 if (!urb) {893893- dev_err(bcs->cs->dev, "isoouturbs[%d].urb==NULL\n", k);894862 rc = -EFAULT;895863 goto error;896864 }···915885 for (k = 0; k < 2; ++k) {916886 dump_urb(DEBUG_ISO, "Initial isoc write", urb);917887 rc = usb_submit_urb(ubc->isoouturbs[k].urb, SLAB_ATOMIC);918918- if (rc != 0) {919919- dev_err(bcs->cs->dev,920920- "could not submit isochronous write URB %d: %s\n",921921- k, get_usb_statmsg(rc));888888+ if (rc != 0)922889 goto error;923923- }924890 }925891 dump_urb(DEBUG_ISO, "Initial isoc write (free)", urb);926892 ubc->isooutfree = &ubc->isoouturbs[2];···942916 for (k = 0; k < BAS_INURBS; ++k) {943917 rc = usb_unlink_urb(ubc->isoinurbs[k]);944918 gig_dbg(DEBUG_ISO,945945- "%s: isoc input URB %d unlinked, result = %d",946946- __func__, k, rc);919919+ "%s: isoc input URB %d unlinked, result = %s",920920+ __func__, k, get_usb_rcmsg(rc));947921 }948922949923 for (k = 0; k < BAS_OUTURBS; ++k) {950924 rc = usb_unlink_urb(ubc->isoouturbs[k].urb);951925 gig_dbg(DEBUG_ISO,952952- "%s: isoc output URB %d unlinked, result = %d",953953- __func__, k, rc);926926+ "%s: isoc output URB %d unlinked, result = %s",927927+ __func__, k, get_usb_rcmsg(rc));954928 }955929}956930···960934/* submit_iso_write_urb961935 * fill and submit the next isochronous write URB962936 * parameters:963963- * bcs B channel state structure937937+ * ucx context structure containing URB964938 * return value:965939 * number of frames submitted in URB966940 * 0 if URB not submitted because no data available (isooutbuf busy)···972946 struct bas_bc_state *ubc = ucx->bcs->hw.bas;973947 struct usb_iso_packet_descriptor *ifd;974948 int corrbytes, nframe, rc;975975- unsigned long flags;976949977950 /* urb->dev is clobbered by USB subsystem */978951 urb->dev = ucx->bcs->cs->hw.bas->udev;···1017992 ifd->status = 0;1018993 ifd->actual_length = 0;1019994 }10201020- if ((urb->number_of_packets = nframe) > 0) {10211021- spin_lock_irqsave(&ucx->bcs->cs->lock, flags);10221022- rc = ucx->bcs->cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV;10231023- spin_unlock_irqrestore(&ucx->bcs->cs->lock, flags);995995+ if (unlikely(nframe == 0))996996+ return 0; /* no data to send */997997+ urb->number_of_packets = nframe;102499810251025- if (rc) {999999+ rc = usb_submit_urb(urb, SLAB_ATOMIC);10001000+ if (unlikely(rc)) {10011001+ if (rc == -ENODEV)10021002+ /* device removed - give up silently */10031003+ gig_dbg(DEBUG_ISO, "%s: disconnected", __func__);10041004+ else10261005 dev_err(ucx->bcs->cs->dev,10271006 "could not submit isochronous write URB: %s\n",10281028- get_usb_statmsg(rc));10291029- dump_urb(DEBUG_ISO, "isoc write", urb);10301030- return rc;10311031- }10321032- ++ubc->numsub;10071007+ get_usb_rcmsg(rc));10081008+ return rc;10331009 }10101010+ ++ubc->numsub;10341011 return nframe;10351012}10361013···10551028 int i;10561029 struct sk_buff *skb;10571030 int len;10311031+ int rc;1058103210591033 /* loop while completed URBs arrive in time */10601034 for (;;) {···10851057 ubc->isooutfree = NULL;10861058 spin_unlock_irqrestore(&ubc->isooutlock, flags);10871059 if (next) {10881088- if (submit_iso_write_urb(next) <= 0) {10601060+ rc = submit_iso_write_urb(next);10611061+ if (unlikely(rc <= 0 && rc != -ENODEV)) {10891062 /* could not submit URB, put it back */10901063 spin_lock_irqsave(&ubc->isooutlock, flags);10911064 if (ubc->isooutfree == NULL) {···11061077 /* process completed URB */11071078 urb = done->urb;11081079 switch (urb->status) {10801080+ case -EXDEV: /* partial completion */10811081+ gig_dbg(DEBUG_ISO, "%s: URB partially completed",10821082+ __func__);10831083+ /* fall through - what's the difference anyway? */11091084 case 0: /* normal completion */11101110- break;11111111- case -EXDEV: /* inspect individual frames */11121112- /* assumptions (for lack of documentation):11131113- * - actual_length bytes of the frame in error are10851085+ /* inspect individual frames10861086+ * assumptions (for lack of documentation):10871087+ * - actual_length bytes of first frame in error are11141088 * successfully sent11151089 * - all following frames are not sent at all11161090 */11171117- gig_dbg(DEBUG_ISO, "%s: URB partially completed",11181118- __func__);11191119- offset = done->limit; /* just in case */10911091+ offset = done->limit; /* default (no error) */11201092 for (i = 0; i < BAS_NUMFRAMES; i++) {11211093 ifd = &urb->iso_frame_desc[i];11221094 if (ifd->status ||···11521122 }11531123#endif11541124 break;11551155- case -EPIPE: //FIXME is this the code for "underrun"?11251125+ case -EPIPE: /* stall - probably underrun */11561126 dev_err(cs->dev, "isochronous write stalled\n");11571127 error_hangup(bcs);11581128 break;···11721142 spin_unlock_irqrestore(&ubc->isooutlock, flags);11731143 if (next) {11741144 /* only one URB still active - resubmit one */11751175- if (submit_iso_write_urb(next) <= 0) {11451145+ rc = submit_iso_write_urb(next);11461146+ if (unlikely(rc <= 0 && rc != -ENODEV)) {11761147 /* couldn't submit */11771148 error_hangup(bcs);11781149 }···12531222 break;12541223 case -ENOENT:12551224 case -ECONNRESET:12561256- gig_dbg(DEBUG_ISO, "%s: URB canceled", __func__);12571257- continue; /* -> skip */12581258- case -EINPROGRESS: /* huh? */12591259- gig_dbg(DEBUG_ISO, "%s: URB still pending", __func__);12251225+ case -EINPROGRESS:12261226+ gig_dbg(DEBUG_ISO, "%s: %s",12271227+ __func__, get_usb_statmsg(urb->status));12601228 continue; /* -> skip */12611229 case -EPIPE:12621230 dev_err(cs->dev, "isochronous read stalled\n");···13201290 urb->dev = bcs->cs->hw.bas->udev;13211291 urb->transfer_flags = URB_ISO_ASAP;13221292 urb->number_of_packets = BAS_NUMFRAMES;13231323- spin_lock_irqsave(&cs->lock, flags);13241324- rc = cs->connected ? usb_submit_urb(urb, SLAB_ATOMIC) : -ENODEV;13251325- spin_unlock_irqrestore(&cs->lock, flags);13261326- if (rc) {12931293+ rc = usb_submit_urb(urb, SLAB_ATOMIC);12941294+ if (unlikely(rc != 0 && rc != -ENODEV)) {13271295 dev_err(cs->dev,13281296 "could not resubmit isochronous read URB: %s\n",13291329- get_usb_statmsg(rc));12971297+ get_usb_rcmsg(rc));13301298 dump_urb(DEBUG_ISO, "resubmit iso read", urb);13311299 error_hangup(bcs);13321300 }···14251397 * timeout timeout in seconds (0: no timeout)14261398 * return value:14271399 * 0 on success14281428- * -EINVAL if a NULL pointer is encountered somewhere14291400 * -EBUSY if another request is pending14301401 * any URB submission error code14311402 */···14431416 "submission of request 0x%02x failed: "14441417 "request 0x%02x still pending\n",14451418 req, ucs->pending);14461446- return -EBUSY;14471447- }14481448- if (ucs->urb_ctrl->status == -EINPROGRESS) {14491449- spin_unlock_irqrestore(&ucs->lock, flags);14501450- dev_err(bcs->cs->dev,14511451- "could not submit request 0x%02x: URB busy\n", req);14521419 return -EBUSY;14531420 }14541421···14861465static int gigaset_init_bchannel(struct bc_state *bcs)14871466{14881467 int req, ret;14681468+ unsigned long flags;14691469+14701470+ spin_lock_irqsave(&bcs->cs->lock, flags);14711471+ if (unlikely(!bcs->cs->connected)) {14721472+ gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);14731473+ spin_unlock_irqrestore(&bcs->cs->lock, flags);14741474+ return -ENODEV;14751475+ }1489147614901477 if ((ret = starturbs(bcs)) < 0) {14911478 dev_err(bcs->cs->dev,14921492- "could not start isochronous I/O for channel %d\n",14931493- bcs->channel + 1);14941494- error_hangup(bcs);14791479+ "could not start isochronous I/O for channel B%d: %s\n",14801480+ bcs->channel + 1,14811481+ ret == -EFAULT ? "null URB" : get_usb_rcmsg(ret));14821482+ if (ret != -ENODEV)14831483+ error_hangup(bcs);14841484+ spin_unlock_irqrestore(&bcs->cs->lock, flags);14951485 return ret;14961486 }1497148714981488 req = bcs->channel ? HD_OPEN_B2CHANNEL : HD_OPEN_B1CHANNEL;14991489 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0) {15001500- dev_err(bcs->cs->dev, "could not open channel %d: %s\n",15011501- bcs->channel + 1, get_usb_statmsg(ret));14901490+ dev_err(bcs->cs->dev, "could not open channel B%d\n",14911491+ bcs->channel + 1);15021492 stopurbs(bcs->hw.bas);15031503- error_hangup(bcs);14931493+ if (ret != -ENODEV)14941494+ error_hangup(bcs);15041495 }14961496+14971497+ spin_unlock_irqrestore(&bcs->cs->lock, flags);15051498 return ret;15061499}15071500···15321497static int gigaset_close_bchannel(struct bc_state *bcs)15331498{15341499 int req, ret;15001500+ unsigned long flags;15011501+15021502+ spin_lock_irqsave(&bcs->cs->lock, flags);15031503+ if (unlikely(!bcs->cs->connected)) {15041504+ spin_unlock_irqrestore(&bcs->cs->lock, flags);15051505+ gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);15061506+ return -ENODEV;15071507+ }1535150815361509 if (!(atomic_read(&bcs->cs->hw.bas->basstate) &15371510 (bcs->channel ? BS_B2OPEN : BS_B1OPEN))) {15381511 /* channel not running: just signal common.c */15121512+ spin_unlock_irqrestore(&bcs->cs->lock, flags);15391513 gigaset_bchannel_down(bcs);15401514 return 0;15411515 }1542151615171517+ /* channel running: tell device to close it */15431518 req = bcs->channel ? HD_CLOSE_B2CHANNEL : HD_CLOSE_B1CHANNEL;15441519 if ((ret = req_submit(bcs, req, 0, BAS_TIMEOUT)) < 0)15451545- dev_err(bcs->cs->dev,15461546- "could not submit HD_CLOSE_BxCHANNEL request: %s\n",15471547- get_usb_statmsg(ret));15201520+ dev_err(bcs->cs->dev, "closing channel B%d failed\n",15211521+ bcs->channel + 1);15221522+15231523+ spin_unlock_irqrestore(&bcs->cs->lock, flags);15481524 return ret;15491525}15501526···15911545 kfree(cb);15921546}1593154715941594-static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len);15951595-15961548/* write_command_callback15971549 * USB completion handler for AT command transmission15981550 * called by the USB subsystem in interrupt context···16041560 struct bas_cardstate *ucs = cs->hw.bas;16051561 unsigned long flags;1606156215631563+ update_basstate(ucs, 0, BS_ATWRPEND);15641564+16071565 /* check status */16081566 switch (urb->status) {16091567 case 0: /* normal completion */16101568 break;16111611- case -ENOENT: /* canceled */16121612- case -ECONNRESET: /* canceled (async) */15691569+ case -ENOENT: /* cancelled */15701570+ case -ECONNRESET: /* cancelled (async) */16131571 case -EINPROGRESS: /* pending */15721572+ case -ENODEV: /* device removed */15731573+ case -ESHUTDOWN: /* device shut down */16141574 /* ignore silently */16151575 gig_dbg(DEBUG_USBREQ, "%s: %s",16161576 __func__, get_usb_statmsg(urb->status));···16751627 * len length of command to send16761628 * return value:16771629 * 0 on success16781678- * -EFAULT if a NULL pointer is encountered somewhere16791630 * -EBUSY if another request is pending16801631 * any URB submission error code16811632 */16821633static int atwrite_submit(struct cardstate *cs, unsigned char *buf, int len)16831634{16841635 struct bas_cardstate *ucs = cs->hw.bas;16851685- unsigned long flags;16861686- int ret;16361636+ int rc;1687163716881638 gig_dbg(DEBUG_USBREQ, "-------> HD_WRITE_ATMESSAGE (%d)", len);1689163916901690- if (ucs->urb_cmd_out->status == -EINPROGRESS) {16401640+ if (update_basstate(ucs, BS_ATWRPEND, 0) & BS_ATWRPEND) {16911641 dev_err(cs->dev,16921642 "could not submit HD_WRITE_ATMESSAGE: URB busy\n");16931643 return -EBUSY;···17001654 usb_sndctrlpipe(ucs->udev, 0),17011655 (unsigned char*) &ucs->dr_cmd_out, buf, len,17021656 write_command_callback, cs);17031703-17041704- spin_lock_irqsave(&cs->lock, flags);17051705- ret = cs->connected ? usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC) : -ENODEV;17061706- spin_unlock_irqrestore(&cs->lock, flags);17071707-17081708- if (ret) {16571657+ rc = usb_submit_urb(ucs->urb_cmd_out, SLAB_ATOMIC);16581658+ if (unlikely(rc)) {16591659+ update_basstate(ucs, 0, BS_ATWRPEND);17091660 dev_err(cs->dev, "could not submit HD_WRITE_ATMESSAGE: %s\n",17101710- get_usb_statmsg(ret));17111711- return ret;16611661+ get_usb_rcmsg(rc));16621662+ return rc;17121663 }1713166417141714- /* submitted successfully */17151715- update_basstate(ucs, 0, BS_ATREADY);17161716-17171717- /* start timeout if necessary */17181718- if (!(atomic_read(&ucs->basstate) & BS_ATTIMER)) {16651665+ /* submitted successfully, start timeout if necessary */16661666+ if (!(update_basstate(ucs, BS_ATTIMER, BS_ATREADY) & BS_ATTIMER)) {17191667 gig_dbg(DEBUG_OUTPUT, "setting ATREADY timeout of %d/10 secs",17201668 ATRDY_TIMEOUT);17211669 ucs->timer_atrdy.expires = jiffies + ATRDY_TIMEOUT * HZ / 10;17221670 ucs->timer_atrdy.data = (unsigned long) cs;17231671 ucs->timer_atrdy.function = atrdy_timeout;17241672 add_timer(&ucs->timer_atrdy);17251725- update_basstate(ucs, BS_ATTIMER, 0);17261673 }17271674 return 0;17281675}···17411702 gig_dbg(DEBUG_TRANSCMD|DEBUG_LOCKCMD, "AT channel not open");17421703 rc = req_submit(cs->bcs, HD_OPEN_ATCHANNEL, 0, BAS_TIMEOUT);17431704 if (rc < 0) {17441744- dev_err(cs->dev, "could not open AT channel\n");17451705 /* flush command queue */17461706 spin_lock_irqsave(&cs->cmdlock, flags);17471707 while (cs->cmdbuf != NULL)···18241786 cs->lastcmdbuf = cb;18251787 spin_unlock_irqrestore(&cs->cmdlock, flags);1826178817891789+ spin_lock_irqsave(&cs->lock, flags);17901790+ if (unlikely(!cs->connected)) {17911791+ spin_unlock_irqrestore(&cs->lock, flags);17921792+ gig_dbg(DEBUG_USBREQ, "%s: not connected", __func__);17931793+ return -ENODEV;17941794+ }18271795 status = start_cbsend(cs);18281828-17961796+ spin_unlock_irqrestore(&cs->lock, flags);18291797 return status < 0 ? status : len;18301798}18311799···18931849 */18941850static int gigaset_freebcshw(struct bc_state *bcs)18951851{18961896- if (!bcs->hw.bas)18521852+ struct bas_bc_state *ubc = bcs->hw.bas;18531853+ int i;18541854+18551855+ if (!ubc)18971856 return 0;1898185718991899- if (bcs->hw.bas->isooutbuf)19001900- kfree(bcs->hw.bas->isooutbuf);19011901- kfree(bcs->hw.bas);18581858+ /* kill URBs and tasklets before freeing - better safe than sorry */18591859+ atomic_set(&ubc->running, 0);18601860+ for (i = 0; i < BAS_OUTURBS; ++i)18611861+ if (ubc->isoouturbs[i].urb) {18621862+ gig_dbg(DEBUG_INIT, "%s: killing iso out URB %d",18631863+ __func__, i);18641864+ usb_kill_urb(ubc->isoouturbs[i].urb);18651865+ usb_free_urb(ubc->isoouturbs[i].urb);18661866+ }18671867+ for (i = 0; i < BAS_INURBS; ++i)18681868+ if (ubc->isoinurbs[i]) {18691869+ gig_dbg(DEBUG_INIT, "%s: killing iso in URB %d",18701870+ __func__, i);18711871+ usb_kill_urb(ubc->isoinurbs[i]);18721872+ usb_free_urb(ubc->isoinurbs[i]);18731873+ }18741874+ tasklet_kill(&ubc->sent_tasklet);18751875+ tasklet_kill(&ubc->rcvd_tasklet);18761876+ kfree(ubc->isooutbuf);18771877+ kfree(ubc);19021878 bcs->hw.bas = NULL;19031879 return 1;19041880}···1995193119961932static void gigaset_freecshw(struct cardstate *cs)19971933{19981998- struct bas_cardstate *ucs = cs->hw.bas;19991999-20002000- del_timer(&ucs->timer_ctrl);20012001- del_timer(&ucs->timer_atrdy);20022002- del_timer(&ucs->timer_cmd_in);20032003-19341934+ /* timers, URBs and rcvbuf are disposed of in disconnect */20041935 kfree(cs->hw.bas);19361936+ cs->hw.bas = NULL;20051937}2006193820071939static int gigaset_initcshw(struct cardstate *cs)···21012041 struct bas_bc_state *ubc;21022042 struct usb_endpoint_descriptor *endpoint;21032043 int i, j;21042104- int ret;20442044+ int rc;2105204521062046 gig_dbg(DEBUG_ANY,21072047 "%s: Check if device matches .. (Vendor: 0x%x, Product: 0x%x)",21082048 __func__, le16_to_cpu(udev->descriptor.idVendor),21092049 le16_to_cpu(udev->descriptor.idProduct));21102110-21112111- /* See if the device offered us matches what we can accept */21122112- if ((le16_to_cpu(udev->descriptor.idVendor) != USB_GIGA_VENDOR_ID) ||21132113- (le16_to_cpu(udev->descriptor.idProduct) != USB_GIGA_PRODUCT_ID &&21142114- le16_to_cpu(udev->descriptor.idProduct) != USB_4175_PRODUCT_ID &&21152115- le16_to_cpu(udev->descriptor.idProduct) != USB_SX303_PRODUCT_ID &&21162116- le16_to_cpu(udev->descriptor.idProduct) != USB_SX353_PRODUCT_ID)) {21172117- gig_dbg(DEBUG_ANY, "%s: unmatched ID - exiting", __func__);21182118- return -ENODEV;21192119- }2120205021212051 /* set required alternate setting */21222052 hostif = interface->cur_altsetting;···21552105 * - three for the different uses of the default control pipe21562106 * - three for each isochronous pipe21572107 */21582158- ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL);21592159- if (!ucs->urb_int_in) {21602160- dev_err(cs->dev, "no free urbs available\n");21612161- goto error;21622162- }21632163- ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL);21642164- if (!ucs->urb_cmd_in) {21652165- dev_err(cs->dev, "no free urbs available\n");21662166- goto error;21672167- }21682168- ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL);21692169- if (!ucs->urb_cmd_out) {21702170- dev_err(cs->dev, "no free urbs available\n");21712171- goto error;21722172- }21732173- ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL);21742174- if (!ucs->urb_ctrl) {21752175- dev_err(cs->dev, "no free urbs available\n");21762176- goto error;21772177- }21082108+ if (!(ucs->urb_int_in = usb_alloc_urb(0, SLAB_KERNEL)) ||21092109+ !(ucs->urb_cmd_in = usb_alloc_urb(0, SLAB_KERNEL)) ||21102110+ !(ucs->urb_cmd_out = usb_alloc_urb(0, SLAB_KERNEL)) ||21112111+ !(ucs->urb_ctrl = usb_alloc_urb(0, SLAB_KERNEL)))21122112+ goto allocerr;2178211321792114 for (j = 0; j < 2; ++j) {21802115 ubc = cs->bcs[j].hw.bas;21812181- for (i = 0; i < BAS_OUTURBS; ++i) {21822182- ubc->isoouturbs[i].urb =21832183- usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL);21842184- if (!ubc->isoouturbs[i].urb) {21852185- dev_err(cs->dev, "no free urbs available\n");21862186- goto error;21872187- }21882188- }21892189- for (i = 0; i < BAS_INURBS; ++i) {21902190- ubc->isoinurbs[i] =21912191- usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL);21922192- if (!ubc->isoinurbs[i]) {21932193- dev_err(cs->dev, "no free urbs available\n");21942194- goto error;21952195- }21962196- }21162116+ for (i = 0; i < BAS_OUTURBS; ++i)21172117+ if (!(ubc->isoouturbs[i].urb =21182118+ usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL)))21192119+ goto allocerr;21202120+ for (i = 0; i < BAS_INURBS; ++i)21212121+ if (!(ubc->isoinurbs[i] =21222122+ usb_alloc_urb(BAS_NUMFRAMES, SLAB_KERNEL)))21232123+ goto allocerr;21972124 }2198212521992126 ucs->rcvbuf = NULL;···21832156 (endpoint->bEndpointAddress) & 0x0f),21842157 ucs->int_in_buf, 3, read_int_callback, cs,21852158 endpoint->bInterval);21862186- ret = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL);21872187- if (ret) {21592159+ if ((rc = usb_submit_urb(ucs->urb_int_in, SLAB_KERNEL)) != 0) {21882160 dev_err(cs->dev, "could not submit interrupt URB: %s\n",21892189- get_usb_statmsg(ret));21612161+ get_usb_rcmsg(rc));21902162 goto error;21912163 }2192216421932165 /* tell the device that the driver is ready */21942194- if ((ret = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0)21662166+ if ((rc = req_submit(cs->bcs, HD_DEVICE_INIT_ACK, 0, 0)) != 0)21952167 goto error;2196216821972169 /* tell common part that the device is ready */···2205217922062180 return 0;2207218121822182+allocerr:21832183+ dev_err(cs->dev, "could not allocate URBs\n");22082184error:22092185 freeurbs(cs);22102186 usb_set_intfdata(interface, NULL);···22212193{22222194 struct cardstate *cs;22232195 struct bas_cardstate *ucs;21962196+ int j;2224219722252198 cs = usb_get_intfdata(interface);2226219922272200 ucs = cs->hw.bas;2228220122292202 dev_info(cs->dev, "disconnecting Gigaset base\n");22032203+22042204+ /* mark base as not ready, all channels disconnected */22052205+ atomic_set(&ucs->basstate, 0);22062206+22072207+ /* tell LL all channels are down */22082208+ //FIXME shouldn't gigaset_stop() do this?22092209+ for (j = 0; j < 2; ++j)22102210+ gigaset_bchannel_down(cs->bcs + j);22112211+22122212+ /* stop driver (common part) */22302213 gigaset_stop(cs);22142214+22152215+ /* stop timers and URBs, free ressources */22162216+ del_timer_sync(&ucs->timer_ctrl);22172217+ del_timer_sync(&ucs->timer_atrdy);22182218+ del_timer_sync(&ucs->timer_cmd_in);22312219 freeurbs(cs);22322220 usb_set_intfdata(interface, NULL);22332221 kfree(ucs->rcvbuf);22342222 ucs->rcvbuf = NULL;22352223 ucs->rcvbuf_size = 0;22362236- atomic_set(&ucs->basstate, 0);22372224 usb_put_dev(ucs->udev);22382225 ucs->interface = NULL;22392226 ucs->udev = NULL;···23202277 */23212278static void __exit bas_gigaset_exit(void)23222279{22802280+ struct bas_cardstate *ucs = cardstate->hw.bas;22812281+23232282 gigaset_blockdriver(driver); /* => probe will fail23242283 * => no gigaset_start any more23252284 */···23292284 gigaset_shutdown(cardstate);23302285 /* from now on, no isdn callback should be possible */2331228623322332- if (atomic_read(&cardstate->hw.bas->basstate) & BS_ATOPEN) {23332333- gig_dbg(DEBUG_ANY, "closing AT channel");23342334- if (req_submit(cardstate->bcs,23352335- HD_CLOSE_ATCHANNEL, 0, BAS_TIMEOUT) >= 0) {23362336- /* successfully submitted */23372337- //FIXME wait for completion?23382338- }22872287+ /* close all still open channels */22882288+ if (atomic_read(&ucs->basstate) & BS_B1OPEN) {22892289+ gig_dbg(DEBUG_INIT, "closing B1 channel");22902290+ usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),22912291+ HD_CLOSE_B1CHANNEL, OUT_VENDOR_REQ, 0, 0,22922292+ NULL, 0, BAS_TIMEOUT);23392293 }22942294+ if (atomic_read(&ucs->basstate) & BS_B2OPEN) {22952295+ gig_dbg(DEBUG_INIT, "closing B2 channel");22962296+ usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),22972297+ HD_CLOSE_B2CHANNEL, OUT_VENDOR_REQ, 0, 0,22982298+ NULL, 0, BAS_TIMEOUT);22992299+ }23002300+ if (atomic_read(&ucs->basstate) & BS_ATOPEN) {23012301+ gig_dbg(DEBUG_INIT, "closing AT channel");23022302+ usb_control_msg(ucs->udev, usb_sndctrlpipe(ucs->udev, 0),23032303+ HD_CLOSE_ATCHANNEL, OUT_VENDOR_REQ, 0, 0,23042304+ NULL, 0, BAS_TIMEOUT);23052305+ }23062306+ atomic_set(&ucs->basstate, 0);2340230723412308 /* deregister this driver with the USB subsystem */23422309 usb_deregister(&gigaset_usb_driver);
+1-2
drivers/isdn/gigaset/common.c
···781781}782782EXPORT_SYMBOL_GPL(gigaset_initcs);783783784784-/* ReInitialize the b-channel structure */785785-/* e.g. called on hangup, disconnect */784784+/* ReInitialize the b-channel structure on hangup */786785void gigaset_bcs_reinit(struct bc_state *bcs)787786{788787 struct sk_buff *skb;
···7575 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and7676 * DEBUG_INTR.7777 */7878-enum debuglevel { /* up to 24 bits (atomic_t) */7878+enum debuglevel {7979 DEBUG_REG = 0x0002, /* serial port I/O register operations */8080 DEBUG_OPEN = 0x0004, /* open/close serial port */8181 DEBUG_INTR = 0x0008, /* interrupt processing */···141141 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \142142 ## arg); \143143 } while (0)144144-#define DEBUG_DEFAULT (DEBUG_INIT | DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)144144+#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)145145146146#else147147···627627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */628628 int (*freebcshw)(struct bc_state *bcs);629629630630- /* Called by gigaset_stop() or gigaset_bchannel_down() for resetting631631- bcs->hw.xxx */630630+ /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */632631 void (*reinitbcshw)(struct bc_state *bcs);633632634633 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
···105105 * 0.50: 20 Jan 2006: Add 8021pq tagging support.106106 * 0.51: 20 Jan 2006: Add 64bit consistent memory allocation for rings.107107 * 0.52: 20 Jan 2006: Add MSI/MSIX support.108108+ * 0.53: 19 Mar 2006: Fix init from low power mode and add hw reset.108109 *109110 * Known bugs:110111 * We suspect that on some hardware no TX done interrupts are generated.···117116 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few118117 * superfluous timer interrupts from the nic.119118 */120120-#define FORCEDETH_VERSION "0.52"119119+#define FORCEDETH_VERSION "0.53"121120#define DRV_NAME "forcedeth"122121123122#include <linux/module.h>···161160#define DEV_HAS_VLAN 0x0020 /* device supports vlan tagging and striping */162161#define DEV_HAS_MSI 0x0040 /* device supports MSI */163162#define DEV_HAS_MSI_X 0x0080 /* device supports MSI-X */163163+#define DEV_HAS_POWER_CNTRL 0x0100 /* device supports power savings */164164165165enum {166166 NvRegIrqStatus = 0x000,···205203#define NVREG_MISC1_HD 0x02206204#define NVREG_MISC1_FORCE 0x3b0f3c207205206206+ NvRegMacReset = 0x3c,207207+#define NVREG_MAC_RESET_ASSERT 0x0F3208208 NvRegTransmitterControl = 0x084,209209#define NVREG_XMITCTL_START 0x01210210 NvRegTransmitterStatus = 0x088,···330326 NvRegMSIXMap0 = 0x3e0,331327 NvRegMSIXMap1 = 0x3e4,332328 NvRegMSIXIrqStatus = 0x3f0,329329+330330+ NvRegPowerState2 = 0x600,331331+#define NVREG_POWERSTATE2_POWERUP_MASK 0x0F11332332+#define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001333333};334334335335/* Big endian: should work, but is untested */···422414#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF)423415424416/* Miscelaneous hardware related defines: */425425-#define NV_PCI_REGSZ 0x270417417+#define NV_PCI_REGSZ_VER1 0x270418418+#define NV_PCI_REGSZ_VER2 0x604426419427420/* various timeout delays: all in usec */428421#define NV_TXRX_RESET_DELAY 4···440431#define NV_MIIBUSY_DELAY 50441432#define NV_MIIPHY_DELAY 10442433#define NV_MIIPHY_DELAYMAX 10000434434+#define NV_MAC_RESET_DELAY 64443435444436#define NV_WAKEUPPATTERNS 5445437#define NV_WAKEUPMASKENTRIES 4···562552 u32 desc_ver;563553 u32 txrxctl_bits;564554 u32 vlanctl_bits;555555+ u32 driver_data;556556+ u32 register_size;565557566558 void __iomem *base;567559···927915 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);928916 pci_push(base);929917 udelay(NV_TXRX_RESET_DELAY);918918+ writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);919919+ pci_push(base);920920+}921921+922922+static void nv_mac_reset(struct net_device *dev)923923+{924924+ struct fe_priv *np = netdev_priv(dev);925925+ u8 __iomem *base = get_hwbase(dev);926926+927927+ dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name);928928+ writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);929929+ pci_push(base);930930+ writel(NVREG_MAC_RESET_ASSERT, base + NvRegMacReset);931931+ pci_push(base);932932+ udelay(NV_MAC_RESET_DELAY);933933+ writel(0, base + NvRegMacReset);934934+ pci_push(base);935935+ udelay(NV_MAC_RESET_DELAY);930936 writel(NVREG_TXRXCTL_BIT2 | np->txrxctl_bits, base + NvRegTxRxControl);931937 pci_push(base);932938}···13611331 dev->name, (unsigned long)np->ring_addr,13621332 np->next_tx, np->nic_tx);13631333 printk(KERN_INFO "%s: Dumping tx registers\n", dev->name);13641364- for (i=0;i<0x400;i+= 32) {13341334+ for (i=0;i<=np->register_size;i+= 32) {13651335 printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n",13661336 i,13671337 readl(base + i + 0), readl(base + i + 4),···25182488}2519248925202490#define FORCEDETH_REGS_VER 125212521-#define FORCEDETH_REGS_SIZE 0x400 /* 256 32-bit registers */2522249125232492static int nv_get_regs_len(struct net_device *dev)25242493{25252525- return FORCEDETH_REGS_SIZE;24942494+ struct fe_priv *np = netdev_priv(dev);24952495+ return np->register_size;25262496}2527249725282498static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *buf)···2534250425352505 regs->version = FORCEDETH_REGS_VER;25362506 spin_lock_irq(&np->lock);25372537- for (i=0;i<FORCEDETH_REGS_SIZE/sizeof(u32);i++)25072507+ for (i = 0;i <= np->register_size/sizeof(u32); i++)25382508 rbuf[i] = readl(base + i*sizeof(u32));25392509 spin_unlock_irq(&np->lock);25402510}···26382608 dprintk(KERN_DEBUG "nv_open: begin\n");2639260926402610 /* 1) erase previous misconfiguration */26112611+ if (np->driver_data & DEV_HAS_POWER_CNTRL)26122612+ nv_mac_reset(dev);26412613 /* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */26422614 writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);26432615 writel(0, base + NvRegMulticastAddrB);···29102878 unsigned long addr;29112879 u8 __iomem *base;29122880 int err, i;28812881+ u32 powerstate;2913288229142883 dev = alloc_etherdev(sizeof(struct fe_priv));29152884 err = -ENOMEM;···29432910 if (err < 0)29442911 goto out_disable;2945291229132913+ if (id->driver_data & (DEV_HAS_VLAN|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL))29142914+ np->register_size = NV_PCI_REGSZ_VER2;29152915+ else29162916+ np->register_size = NV_PCI_REGSZ_VER1;29172917+29462918 err = -EINVAL;29472919 addr = 0;29482920 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {···29562918 pci_resource_len(pci_dev, i),29572919 pci_resource_flags(pci_dev, i));29582920 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM &&29592959- pci_resource_len(pci_dev, i) >= NV_PCI_REGSZ) {29212921+ pci_resource_len(pci_dev, i) >= np->register_size) {29602922 addr = pci_resource_start(pci_dev, i);29612923 break;29622924 }···29662928 pci_name(pci_dev));29672929 goto out_relreg;29682930 }29312931+29322932+ /* copy of driver data */29332933+ np->driver_data = id->driver_data;2969293429702935 /* handle different descriptor versions */29712936 if (id->driver_data & DEV_HAS_HIGH_DMA) {···30272986 }3028298730292988 err = -ENOMEM;30303030- np->base = ioremap(addr, NV_PCI_REGSZ);29892989+ np->base = ioremap(addr, np->register_size);30312990 if (!np->base)30322991 goto out_relreg;30332992 dev->base_addr = (unsigned long)np->base;···31023061 /* disable WOL */31033062 writel(0, base + NvRegWakeUpFlags);31043063 np->wolenabled = 0;30643064+30653065+ if (id->driver_data & DEV_HAS_POWER_CNTRL) {30663066+ u8 revision_id;30673067+ pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id);30683068+30693069+ /* take phy and nic out of low power mode */30703070+ powerstate = readl(base + NvRegPowerState2);30713071+ powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK;30723072+ if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 ||30733073+ id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) &&30743074+ revision_id >= 0xA3)30753075+ powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3;30763076+ writel(powerstate, base + NvRegPowerState2);30773077+ }3105307831063079 if (np->desc_ver == DESC_VER_1) {31073080 np->tx_flags = NV_TX_VALID;···32783223 },32793224 { /* MCP51 Ethernet Controller */32803225 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_12),32813281- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA,32263226+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL,32823227 },32833228 { /* MCP51 Ethernet Controller */32843229 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_13),32853285- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA,32303230+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL,32863231 },32873232 { /* MCP55 Ethernet Controller */32883233 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_14),32893289- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X,32343234+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL,32903235 },32913236 { /* MCP55 Ethernet Controller */32923237 PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_15),32933293- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X,32383238+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_VLAN|DEV_HAS_MSI|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL,32943239 },32953240 {0,},32963241};
+28-28
drivers/net/gianfar.c
···210210 goto regs_fail;211211 }212212213213- spin_lock_init(&priv->lock);213213+ spin_lock_init(&priv->txlock);214214+ spin_lock_init(&priv->rxlock);214215215216 platform_set_drvdata(pdev, dev);216217···516515 phy_stop(priv->phydev);517516518517 /* Lock it down */519519- spin_lock_irqsave(&priv->lock, flags);518518+ spin_lock_irqsave(&priv->txlock, flags);519519+ spin_lock(&priv->rxlock);520520521521 gfar_halt(dev);522522523523- spin_unlock_irqrestore(&priv->lock, flags);523523+ spin_unlock(&priv->rxlock);524524+ spin_unlock_irqrestore(&priv->txlock, flags);524525525526 /* Free the IRQs */526527 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {···608605 tempval |= DMACTRL_INIT_SETTINGS;609606 gfar_write(&priv->regs->dmactrl, tempval);610607611611- /* Clear THLT, so that the DMA starts polling now */612612- gfar_write(®s->tstat, TSTAT_CLEAR_THALT);613613-614608 /* Make sure we aren't stopped */615609 tempval = gfar_read(&priv->regs->dmactrl);616610 tempval &= ~(DMACTRL_GRS | DMACTRL_GTS);617611 gfar_write(&priv->regs->dmactrl, tempval);612612+613613+ /* Clear THLT/RHLT, so that the DMA starts polling now */614614+ gfar_write(®s->tstat, TSTAT_CLEAR_THALT);615615+ gfar_write(®s->rstat, RSTAT_CLEAR_RHALT);618616619617 /* Unmask the interrupts we look for */620618 gfar_write(®s->imask, IMASK_DEFAULT);···932928 struct txfcb *fcb = NULL;933929 struct txbd8 *txbdp;934930 u16 status;931931+ unsigned long flags;935932936933 /* Update transmit stats */937934 priv->stats.tx_bytes += skb->len;938935939936 /* Lock priv now */940940- spin_lock_irq(&priv->lock);937937+ spin_lock_irqsave(&priv->txlock, flags);941938942939 /* Point at the first free tx descriptor */943940 txbdp = priv->cur_tx;···10091004 gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT);1010100510111006 /* Unlock priv */10121012- spin_unlock_irq(&priv->lock);10071007+ spin_unlock_irqrestore(&priv->txlock, flags);1013100810141009 return 0;10151010}···10541049 unsigned long flags;10551050 u32 tempval;1056105110571057- spin_lock_irqsave(&priv->lock, flags);10521052+ spin_lock_irqsave(&priv->rxlock, flags);1058105310591054 priv->vlgrp = grp;10601055···10811076 gfar_write(&priv->regs->rctrl, tempval);10821077 }1083107810841084- spin_unlock_irqrestore(&priv->lock, flags);10791079+ spin_unlock_irqrestore(&priv->rxlock, flags);10851080}1086108110871082···10901085 struct gfar_private *priv = netdev_priv(dev);10911086 unsigned long flags;1092108710931093- spin_lock_irqsave(&priv->lock, flags);10881088+ spin_lock_irqsave(&priv->rxlock, flags);1094108910951090 if (priv->vlgrp)10961091 priv->vlgrp->vlan_devices[vid] = NULL;1097109210981098- spin_unlock_irqrestore(&priv->lock, flags);10931093+ spin_unlock_irqrestore(&priv->rxlock, flags);10991094}1100109511011096···11841179 gfar_write(&priv->regs->ievent, IEVENT_TX_MASK);1185118011861181 /* Lock priv */11871187- spin_lock(&priv->lock);11821182+ spin_lock(&priv->txlock);11881183 bdp = priv->dirty_tx;11891184 while ((bdp->status & TXBD_READY) == 0) {11901185 /* If dirty_tx and cur_tx are the same, then either the */···12291224 else12301225 gfar_write(&priv->regs->txic, 0);1231122612321232- spin_unlock(&priv->lock);12271227+ spin_unlock(&priv->txlock);1233122812341229 return IRQ_HANDLED;12351230}···13101305{13111306 struct net_device *dev = (struct net_device *) dev_id;13121307 struct gfar_private *priv = netdev_priv(dev);13131313-13141308#ifdef CONFIG_GFAR_NAPI13151309 u32 tempval;13101310+#else13111311+ unsigned long flags;13161312#endif1317131313181314 /* Clear IEVENT, so rx interrupt isn't called again···13361330 }13371331#else1338133213391339- spin_lock(&priv->lock);13331333+ spin_lock_irqsave(&priv->rxlock, flags);13401334 gfar_clean_rx_ring(dev, priv->rx_ring_size);1341133513421336 /* If we are coalescing interrupts, update the timer */···13471341 else13481342 gfar_write(&priv->regs->rxic, 0);1349134313501350- spin_unlock(&priv->lock);13441344+ spin_unlock_irqrestore(&priv->rxlock, flags);13511345#endif1352134613531347 return IRQ_HANDLED;···14961490 /* Update the current rxbd pointer to be the next one */14971491 priv->cur_rx = bdp;1498149214991499- /* If no packets have arrived since the15001500- * last one we processed, clear the IEVENT RX and15011501- * BSY bits so that another interrupt won't be15021502- * generated when we set IMASK */15031503- if (bdp->status & RXBD_EMPTY)15041504- gfar_write(&priv->regs->ievent, IEVENT_RX_MASK);15051505-15061493 return howmany;15071494}15081495···15151516 rx_work_limit -= howmany;15161517 *budget -= howmany;1517151815181518- if (rx_work_limit >= 0) {15191519+ if (rx_work_limit > 0) {15191520 netif_rx_complete(dev);1520152115211522 /* Clear the halt bit in RSTAT */···15321533 gfar_write(&priv->regs->rxic, 0);15331534 }1534153515351535- return (rx_work_limit < 0) ? 1 : 0;15361536+ /* Return 1 if there's more work to do */15371537+ return (rx_work_limit > 0) ? 0 : 1;15361538}15371539#endif15381540···16291629 struct phy_device *phydev = priv->phydev;16301630 int new_state = 0;1631163116321632- spin_lock_irqsave(&priv->lock, flags);16321632+ spin_lock_irqsave(&priv->txlock, flags);16331633 if (phydev->link) {16341634 u32 tempval = gfar_read(®s->maccfg2);16351635 u32 ecntrl = gfar_read(®s->ecntrl);···16941694 if (new_state && netif_msg_link(priv))16951695 phy_print_status(phydev);1696169616971697- spin_unlock_irqrestore(&priv->lock, flags);16971697+ spin_unlock_irqrestore(&priv->txlock, flags);16981698}1699169917001700/* Update the hash table based on the current list of multicast
+46-21
drivers/net/gianfar.h
···656656 * the buffer descriptor determines the actual condition.657657 */658658struct gfar_private {659659- /* pointers to arrays of skbuffs for tx and rx */659659+ /* Fields controlled by TX lock */660660+ spinlock_t txlock;661661+662662+ /* Pointer to the array of skbuffs */660663 struct sk_buff ** tx_skbuff;661661- struct sk_buff ** rx_skbuff;662664663663- /* indices pointing to the next free sbk in skb arrays */665665+ /* next free skb in the array */664666 u16 skb_curtx;665665- u16 skb_currx;666667667667- /* index of the first skb which hasn't been transmitted668668- * yet. */668668+ /* First skb in line to be transmitted */669669 u16 skb_dirtytx;670670671671 /* Configuration info for the coalescing features */672672 unsigned char txcoalescing;673673 unsigned short txcount;674674 unsigned short txtime;675675+676676+ /* Buffer descriptor pointers */677677+ struct txbd8 *tx_bd_base; /* First tx buffer descriptor */678678+ struct txbd8 *cur_tx; /* Next free ring entry */679679+ struct txbd8 *dirty_tx; /* First buffer in line680680+ to be transmitted */681681+ unsigned int tx_ring_size;682682+683683+ /* RX Locked fields */684684+ spinlock_t rxlock;685685+686686+ /* skb array and index */687687+ struct sk_buff ** rx_skbuff;688688+ u16 skb_currx;689689+690690+ /* RX Coalescing values */675691 unsigned char rxcoalescing;676692 unsigned short rxcount;677693 unsigned short rxtime;678694679679- /* GFAR addresses */680680- struct rxbd8 *rx_bd_base; /* Base addresses of Rx and Tx Buffers */681681- struct txbd8 *tx_bd_base;695695+ struct rxbd8 *rx_bd_base; /* First Rx buffers */682696 struct rxbd8 *cur_rx; /* Next free rx ring entry */683683- struct txbd8 *cur_tx; /* Next free ring entry */684684- struct txbd8 *dirty_tx; /* The Ring entry to be freed. */685685- struct gfar __iomem *regs; /* Pointer to the GFAR memory mapped Registers */686686- u32 __iomem *hash_regs[16];687687- int hash_width;688688- struct net_device_stats stats; /* linux network statistics */689689- struct gfar_extra_stats extra_stats;690690- spinlock_t lock;697697+698698+ /* RX parameters */699699+ unsigned int rx_ring_size;691700 unsigned int rx_buffer_size;692701 unsigned int rx_stash_size;693702 unsigned int rx_stash_index;694694- unsigned int tx_ring_size;695695- unsigned int rx_ring_size;703703+704704+ struct vlan_group *vlgrp;705705+706706+ /* Unprotected fields */707707+ /* Pointer to the GFAR memory mapped Registers */708708+ struct gfar __iomem *regs;709709+710710+ /* Hash registers and their width */711711+ u32 __iomem *hash_regs[16];712712+ int hash_width;713713+714714+ /* global parameters */696715 unsigned int fifo_threshold;697716 unsigned int fifo_starve;698717 unsigned int fifo_starve_off;···721702 extended_hash:1,722703 bd_stash_en:1;723704 unsigned short padding;724724- struct vlan_group *vlgrp;725725- /* Info structure initialized by board setup code */705705+726706 unsigned int interruptTransmit;727707 unsigned int interruptReceive;728708 unsigned int interruptError;709709+710710+ /* info structure initialized by platform code */729711 struct gianfar_platform_data *einfo;730712713713+ /* PHY stuff */731714 struct phy_device *phydev;732715 struct mii_bus *mii_bus;733716 int oldspeed;···737716 int oldlink;738717739718 uint32_t msg_enable;719719+720720+ /* Network Statistics */721721+ struct net_device_stats stats;722722+ struct gfar_extra_stats extra_stats;740723};741724742725static inline u32 gfar_read(volatile unsigned __iomem *addr)
+14-6
drivers/net/gianfar_ethtool.c
···455455456456 /* Halt TX and RX, and process the frames which457457 * have already been received */458458- spin_lock_irqsave(&priv->lock, flags);458458+ spin_lock_irqsave(&priv->txlock, flags);459459+ spin_lock(&priv->rxlock);460460+459461 gfar_halt(dev);460462 gfar_clean_rx_ring(dev, priv->rx_ring_size);461461- spin_unlock_irqrestore(&priv->lock, flags);463463+464464+ spin_unlock(&priv->rxlock);465465+ spin_unlock_irqrestore(&priv->txlock, flags);462466463467 /* Now we take down the rings to rebuild them */464468 stop_gfar(dev);···492488493489 /* Halt TX and RX, and process the frames which494490 * have already been received */495495- spin_lock_irqsave(&priv->lock, flags);491491+ spin_lock_irqsave(&priv->txlock, flags);492492+ spin_lock(&priv->rxlock);493493+496494 gfar_halt(dev);497495 gfar_clean_rx_ring(dev, priv->rx_ring_size);498498- spin_unlock_irqrestore(&priv->lock, flags);496496+497497+ spin_unlock(&priv->rxlock);498498+ spin_unlock_irqrestore(&priv->txlock, flags);499499500500 /* Now we take down the rings to rebuild them */501501 stop_gfar(dev);···531523 if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_CSUM))532524 return -EOPNOTSUPP;533525534534- spin_lock_irqsave(&priv->lock, flags);526526+ spin_lock_irqsave(&priv->txlock, flags);535527 gfar_halt(dev);536528537529 if (data)···540532 dev->features &= ~NETIF_F_IP_CSUM;541533542534 gfar_start(dev);543543- spin_unlock_irqrestore(&priv->lock, flags);535535+ spin_unlock_irqrestore(&priv->txlock, flags);544536545537 return 0;546538}
···178178#define ROPE6_CTL 0x230179179#define ROPE7_CTL 0x238180180181181+#define IOC_ROPE0_CFG 0x500 /* pluto only */182182+#define IOC_ROPE_AO 0x10 /* Allow "Relaxed Ordering" */183183+184184+185185+181186#define HF_ENABLE 0x40182187183188···1764175917651760 sba_dev->num_ioc = num_ioc;17661761 for (i = 0; i < num_ioc; i++) {17671767- /*17681768- ** Make sure the box crashes if we get any errors on a rope.17691769- */17701770- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE0_CTL);17711771- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE1_CTL);17721772- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE2_CTL);17731773- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE3_CTL);17741774- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE4_CTL);17751775- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE5_CTL);17761776- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE6_CTL);17771777- WRITE_REG(HF_ENABLE, sba_dev->ioc[i].ioc_hpa + ROPE7_CTL);17621762+ unsigned long ioc_hpa = sba_dev->ioc[i].ioc_hpa;17631763+ unsigned int j;1778176417791779- /* flush out the writes */17651765+ for (j=0; j < sizeof(u64) * ROPES_PER_IOC; j+=sizeof(u64)) {17661766+17671767+ /*17681768+ * Clear ROPE(N)_CONFIG AO bit.17691769+ * Disables "NT Ordering" (~= !"Relaxed Ordering")17701770+ * Overrides bit 1 in DMA Hint Sets.17711771+ * Improves netperf UDP_STREAM by ~10% for bcm5701.17721772+ */17731773+ if (IS_PLUTO(sba_dev->iodc)) {17741774+ unsigned long rope_cfg, cfg_val;17751775+17761776+ rope_cfg = ioc_hpa + IOC_ROPE0_CFG + j;17771777+ cfg_val = READ_REG(rope_cfg);17781778+ cfg_val &= ~IOC_ROPE_AO;17791779+ WRITE_REG(cfg_val, rope_cfg);17801780+ }17811781+17821782+ /*17831783+ ** Make sure the box crashes on rope errors.17841784+ */17851785+ WRITE_REG(HF_ENABLE, ioc_hpa + ROPE0_CTL + j);17861786+ }17871787+17881788+ /* flush out the last writes */17801789 READ_REG(sba_dev->ioc[i].ioc_hpa + ROPE7_CTL);1781179017821791 DBG_INIT(" ioc[%d] ROPE_CFG 0x%Lx ROPE_DBG 0x%Lx\n",
+2-2
drivers/parisc/superio.c
···155155 struct pci_dev *pdev = sio->lio_pdev;156156 u16 word;157157158158- if (sio->suckyio_irq_enabled) 158158+ if (sio->suckyio_irq_enabled)159159 return;160160161161 BUG_ON(!pdev);···194194 request_region (sio->acpi_base, 0x1f, "acpi");195195196196 /* Enable the legacy I/O function */197197- pci_read_config_word (pdev, PCI_COMMAND, &word);197197+ pci_read_config_word (pdev, PCI_COMMAND, &word);198198 word |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO;199199 pci_write_config_word (pdev, PCI_COMMAND, word);200200
+1-1
drivers/pcmcia/Kconfig
···250250251251config PCMCIA_VRC4171252252 tristate "NEC VRC4171 Card Controllers support"253253- depends on VRC4171 && PCMCIA253253+ depends on CPU_VR41XX && ISA && PCMCIA254254255255config PCMCIA_VRC4173256256 tristate "NEC VRC4173 CARDU support"
+7-9
drivers/pcmcia/ds.c
···236236/**237237 * pcmcia_load_firmware - load CIS from userspace if device-provided is broken238238 * @dev - the pcmcia device which needs a CIS override239239- * @filename - requested filename in /lib/firmware/cis/239239+ * @filename - requested filename in /lib/firmware/240240 *241241 * This uses the in-kernel firmware loading mechanism to use a "fake CIS" if242242 * the one provided by the card is broken. The firmware files reside in243243- * /lib/firmware/cis/ in userspace.243243+ * /lib/firmware/ in userspace.244244 */245245static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)246246{···298298 *299299 * Registers a PCMCIA driver with the PCMCIA bus core.300300 */301301-static int pcmcia_device_probe(struct device *dev);302302-static int pcmcia_device_remove(struct device * dev);303303-304301int pcmcia_register_driver(struct pcmcia_driver *driver)305302{306303 if (!driver)···397400 * call which will then check whether there are two398401 * pseudo devices, and if not, add the second one.399402 */400400- did = (struct pcmcia_device_id *) p_dev->dev.driver_data;403403+ did = p_dev->dev.driver_data;401404 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&402405 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))403406 pcmcia_add_pseudo_device(p_dev->socket);···445448 return;446449}447450448448-449451static int pcmcia_device_remove(struct device * dev)450452{451453 struct pcmcia_device *p_dev;···459463 * pseudo multi-function card, we need to unbind460464 * all devices461465 */462462- did = (struct pcmcia_device_id *) p_dev->dev.driver_data;466466+ did = p_dev->dev.driver_data;463467 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&464468 (p_dev->socket->device_count != 0) &&465469 (p_dev->device_no == 0))···471475472476 if (p_drv->remove)473477 p_drv->remove(p_dev);478478+479479+ p_dev->dev_node = NULL;474480475481 /* check for proper unloading */476482 if (p_dev->_irq || p_dev->_io || p_dev->_locked)···626628 }627629628630 /* Add to the list in pcmcia_bus_socket */629629- list_add_tail(&p_dev->socket_device_list, &s->devices_list);631631+ list_add(&p_dev->socket_device_list, &s->devices_list);630632631633 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);632634
+11-7
drivers/pcmcia/pcmcia_resource.c
···8888 }8989 if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {9090 *base = s->io_offset | (*base & 0x0fff);9191- s->io[0].res->flags = (s->io[0].res->flags & ~IORESOURCE_BITS) | (attr & IORESOURCE_BITS);9291 return 0;9392 }9493 /* Check for an already-allocated window that must conflict with···208209 if (!(s->state & SOCKET_PRESENT))209210 return CS_NO_CARD;210211211211- config->Function = p_dev->func;212212213213#ifdef CONFIG_CARDBUS214214 if (s->state & SOCKET_CARDBUS) {···221223 config->AssignedIRQ = s->irq.AssignedIRQ;222224 if (config->AssignedIRQ)223225 config->Attributes |= CONF_ENABLE_IRQ;224224- config->BasePort1 = s->io[0].res->start;225225- config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1;226226+ if (s->io[0].res) {227227+ config->BasePort1 = s->io[0].res->start;228228+ config->NumPorts1 = s->io[0].res->end - config->BasePort1 + 1;229229+ }226230 }227231 return CS_SUCCESS;228232 }229233#endif230234231231- c = (p_dev) ? p_dev->function_config : NULL;235235+ if (p_dev) {236236+ c = p_dev->function_config;237237+ config->Function = p_dev->func;238238+ } else {239239+ c = NULL;240240+ config->Function = 0;241241+ }232242233243 if ((c == NULL) || !(c->state & CONFIG_LOCKED)) {234244 config->Attributes = 0;···953947 pcmcia_release_irq(p_dev, &p_dev->irq);954948 if (&p_dev->win)955949 pcmcia_release_window(p_dev->win);956956-957957- p_dev->dev_node = NULL;958950}959951EXPORT_SYMBOL(pcmcia_disable_device);
···11Version 1.4222------------33Fix slow oplock break when mounted to different servers at the same time and44-the tids match and we try to find matching fid on wrong server.44+the tids match and we try to find matching fid on wrong server. Fix read55+looping when signing required by server (2.6.16 kernel only). Fix readdir66+vs. rename race which could cause each to hang. Return . and .. even77+if server does not. Allow searches to skip first three entries and88+begin at any location. Fix oops in find_writeable_file.59610Version 1.41711------------
+8
fs/cifs/README
···511511 support and want to map the uid and gid fields 512512 to values supplied at mount (rather than the 513513 actual values, then set this to zero. (default 1)514514+Experimental When set to 1 used to enable certain experimental515515+ features (currently enables multipage writes516516+ when signing is enabled, the multipage write517517+ performance enhancement was disabled when518518+ signing turned on in case buffer was modified519519+ just before it was sent, also this flag will520520+ be used to use the new experimental sessionsetup521521+ code).514522515523These experimental features and tracing can be enabled by changing flags in 516524/proc/fs/cifs (after the cifs module has been installed or built into the
···139139 cifs_sb = CIFS_SB(inode->i_sb);140140 pTcon = cifs_sb->tcon;141141142142- mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);143142 full_path = build_path_from_dentry(direntry);144144- mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);145143 if(full_path == NULL) {146144 FreeXid(xid);147145 return -ENOMEM;···314316 cifs_sb = CIFS_SB(inode->i_sb);315317 pTcon = cifs_sb->tcon;316318317317- mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);318319 full_path = build_path_from_dentry(direntry);319319- mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);320320 if(full_path == NULL)321321 rc = -ENOMEM;322322 else if (pTcon->ses->capabilities & CAP_UNIX) {···435439436440 cifs_sb = CIFS_SB(parent_dir_inode->i_sb);437441 pTcon = cifs_sb->tcon;442442+443443+ /*444444+ * Don't allow the separator character in a path component.445445+ * The VFS will not allow "/", but "\" is allowed by posix.446446+ */447447+ if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {448448+ int i;449449+ for (i = 0; i < direntry->d_name.len; i++)450450+ if (direntry->d_name.name[i] == '\\') {451451+ cFYI(1, ("Invalid file name"));452452+ FreeXid(xid);453453+ return ERR_PTR(-EINVAL);454454+ }455455+ }438456439457 /* can not grab the rename sem here since it would440458 deadlock in the cases (beginning of sys_rename itself)
···203203 }204204 }205205206206- mutex_lock(&inode->i_sb->s_vfs_rename_mutex);207206 full_path = build_path_from_dentry(file->f_dentry);208208- mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);209207 if (full_path == NULL) {210208 FreeXid(xid);211209 return -ENOMEM;···904906 if (rc != 0)905907 break;906908 }907907- /* BB FIXME We can not sign across two buffers yet */908908- if((pTcon->ses->server->secMode & 909909+ if(experimEnabled || (pTcon->ses->server->secMode & 909910 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) {910911 struct kvec iov[2];911912 unsigned int len;···920923 *poffset, &bytes_written,921924 iov, 1, long_op);922925 } else923923- /* BB FIXME fixup indentation of line below */924924- rc = CIFSSMBWrite(xid, pTcon,925925- open_file->netfid,926926- min_t(const int, cifs_sb->wsize, 927927- write_size - total_written),928928- *poffset, &bytes_written,929929- write_data + total_written, NULL, long_op);926926+ rc = CIFSSMBWrite(xid, pTcon,927927+ open_file->netfid,928928+ min_t(const int, cifs_sb->wsize,929929+ write_size - total_written),930930+ *poffset, &bytes_written,931931+ write_data + total_written,932932+ NULL, long_op);930933 }931934 if (rc || (bytes_written == 0)) {932935 if (total_written)···964967{965968 struct cifsFileInfo *open_file;966969 int rc;970970+971971+ /* Having a null inode here (because mapping->host was set to zero by972972+ the VFS or MM) should not happen but we had reports of on oops (due to973973+ it being zero) during stress testcases so we need to check for it */974974+975975+ if(cifs_inode == NULL) {976976+ cERROR(1,("Null inode passed to cifs_writeable_file"));977977+ dump_stack();978978+ return NULL;979979+ }967980968981 read_lock(&GlobalSMBSeslock);969982 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {···11001093 if (cifs_sb->wsize < PAGE_CACHE_SIZE)11011094 return generic_writepages(mapping, wbc);1102109511031103- /* BB FIXME we do not have code to sign across multiple buffers yet,11041104- so go to older writepage style write which we can sign if needed */11051096 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server))11061097 if(cifs_sb->tcon->ses->server->secMode &11071098 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))11081108- return generic_writepages(mapping, wbc);10991099+ if(!experimEnabled)11001100+ return generic_writepages(mapping, wbc);1109110111101102 /*11111103 * BB: Is this meaningful for a non-block-device file system?
···4848/* No need to check for cross device links since server will do that4949 BB note DFS case in future though (when we may have to check) */50505151- mutex_lock(&inode->i_sb->s_vfs_rename_mutex);5251 fromName = build_path_from_dentry(old_file);5352 toName = build_path_from_dentry(direntry);5454- mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);5553 if((fromName == NULL) || (toName == NULL)) {5654 rc = -ENOMEM;5755 goto cifs_hl_exit;···101103102104 xid = GetXid();103105104104- mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);105106 full_path = build_path_from_dentry(direntry);106106- mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);107107108108 if (!full_path)109109 goto out_no_free;···160164 cifs_sb = CIFS_SB(inode->i_sb);161165 pTcon = cifs_sb->tcon;162166163163- mutex_lock(&inode->i_sb->s_vfs_rename_mutex);164167 full_path = build_path_from_dentry(direntry);165165- mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);166168167169 if(full_path == NULL) {168170 FreeXid(xid);
+14
fs/cifs/ntlmssp.c
···121121 }122122123123124124+ /* copy session key */125125+126126+ /* if Unicode, align strings to two byte boundary */127127+128128+ /* copy user name */ /* BB Do we need to special case null user name? */129129+130130+ /* copy domain name */131131+132132+ /* copy Linux version */133133+134134+ /* copy network operating system name */135135+136136+ /* update bcc and smb buffer length */137137+124138/* rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buf_type, 0); */125139 /* SMB request buf freed in SendReceive2 */126140
+22-23
fs/cifs/readdir.c
···404404 if(pTcon == NULL)405405 return -EINVAL;406406407407- mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex);408407 full_path = build_path_from_dentry(file->f_dentry);409409- mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex);410408411409 if(full_path == NULL) {412410 return -ENOMEM;···590592 first_entry_in_buffer = 591593 cifsFile->srch_inf.index_of_last_entry - 592594 cifsFile->srch_inf.entries_in_buffer;595595+596596+ /* if first entry in buf is zero then is first buffer597597+ in search response data which means it is likely . and ..598598+ will be in this buffer, although some servers do not return599599+ . and .. for the root of a drive and for those we need600600+ to start two entries earlier */601601+593602/* dump_cifs_file_struct(file, "In fce ");*/594603 if(((index_to_find < cifsFile->srch_inf.index_of_last_entry) && 595604 is_dir_changed(file)) || ···639634 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + 640635 smbCalcSize((struct smb_hdr *)641636 cifsFile->srch_inf.ntwrk_buf_start);637637+638638+ current_entry = cifsFile->srch_inf.srch_entries_start;642639 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry643640 - cifsFile->srch_inf.entries_in_buffer;644641 pos_in_buf = index_to_find - first_entry_in_buffer;645642 cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); 646646- current_entry = cifsFile->srch_inf.srch_entries_start;647643 for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) {648644 /* go entry by entry figuring out which is first */649649- /* if( . or ..)650650- skip */651651- rc = cifs_entry_is_dot(current_entry,cifsFile);652652- if(rc == 1) /* is . or .. so skip */ {653653- cFYI(1,("Entry is .")); /* BB removeme BB */654654- /* continue; */655655- } else if (rc == 2 ) {656656- cFYI(1,("Entry is ..")); /* BB removeme BB */657657- /* continue; */658658- }659645 current_entry = nxt_dir_entry(current_entry,end_of_smb);660646 }661647 if((current_entry == NULL) && (i < pos_in_buf)) {···765769766770 if(file->f_dentry == NULL)767771 return -ENOENT;772772+773773+ rc = cifs_entry_is_dot(pfindEntry,pCifsF);774774+ /* skip . and .. since we added them first */775775+ if(rc != 0) 776776+ return 0;768777769778 cifs_sb = CIFS_SB(file->f_dentry->d_sb);770779···899898900899 switch ((int) file->f_pos) {901900 case 0:902902- /*if (filldir(direntry, ".", 1, file->f_pos,901901+ if (filldir(direntry, ".", 1, file->f_pos,903902 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) {904904- cERROR(1, ("Filldir for current dir failed "));903903+ cERROR(1, ("Filldir for current dir failed"));905904 rc = -ENOMEM;906905 break;907906 }908908- file->f_pos++; */907907+ file->f_pos++;909908 case 1:910910- /* if (filldir(direntry, "..", 2, file->f_pos,909909+ if (filldir(direntry, "..", 2, file->f_pos,911910 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {912911 cERROR(1, ("Filldir for parent dir failed "));913912 rc = -ENOMEM;914913 break;915914 }916916- file->f_pos++; */917917- case 2:915915+ file->f_pos++;916916+ default:918917 /* 1) If search is active, 919918 is in current search buffer? 920919 if it before then restart search···928927 return rc;929928 }930929 }931931- default:932930 if(file->private_data == NULL) {933931 rc = -EINVAL;934932 FreeXid(xid);···946946 } 947947 kfree(cifsFile->search_resume_name);948948 cifsFile->search_resume_name = NULL; */949949-950950- /* BB account for . and .. in f_pos as special case */951949952950 rc = find_cifs_entry(xid,pTcon, file,953951 ¤t_entry,&num_to_fill);···975977 num_to_fill, i));976978 break;977979 }978978-980980+ /* if buggy server returns . and .. late do981981+ we want to check for that here? */979982 rc = cifs_filldir(current_entry, file, 980983 filldir, direntry,tmp_buf);981984 file->f_pos++;
···128128 }129129}130130131131-void fuse_remove_background(struct fuse_conn *fc, struct fuse_req *req)131131+/*132132+ * Called with sbput_sem held for read (request_end) or write133133+ * (fuse_put_super). By the time fuse_put_super() is finished, all134134+ * inodes belonging to background requests must be released, so the135135+ * iputs have to be done within the locked region.136136+ */137137+void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req)132138{133133- list_del_init(&req->bg_entry);139139+ iput(req->inode);140140+ iput(req->inode2);141141+ spin_lock(&fc->lock);142142+ list_del(&req->bg_entry);134143 if (fc->num_background == FUSE_MAX_BACKGROUND) {135144 fc->blocked = 0;136145 wake_up_all(&fc->blocked_waitq);137146 }138147 fc->num_background--;148148+ spin_unlock(&fc->lock);139149}140150141151/*···175165 wake_up(&req->waitq);176166 fuse_put_request(fc, req);177167 } else {178178- struct inode *inode = req->inode;179179- struct inode *inode2 = req->inode2;180180- struct file *file = req->file;181168 void (*end) (struct fuse_conn *, struct fuse_req *) = req->end;182169 req->end = NULL;183183- req->inode = NULL;184184- req->inode2 = NULL;185185- req->file = NULL;186186- if (!list_empty(&req->bg_entry))187187- fuse_remove_background(fc, req);188170 spin_unlock(&fc->lock);171171+ down_read(&fc->sbput_sem);172172+ if (fc->mounted)173173+ fuse_release_background(fc, req);174174+ up_read(&fc->sbput_sem);175175+176176+ /* fput must go outside sbput_sem, otherwise it can deadlock */177177+ if (req->file)178178+ fput(req->file);189179190180 if (end)191181 end(fc, req);192182 else193183 fuse_put_request(fc, req);194194-195195- if (file)196196- fput(file);197197- iput(inode);198198- iput(inode2);199184 }200185}201186
+9-3
fs/fuse/fuse_i.h
···258258 /** waitq for blocked connection */259259 wait_queue_head_t blocked_waitq;260260261261+ /** RW semaphore for exclusion with fuse_put_super() */262262+ struct rw_semaphore sbput_sem;263263+261264 /** The next unique request id */262265 u64 reqctr;266266+267267+ /** Mount is active */268268+ unsigned mounted;263269264270 /** Connection established, cleared on umount, connection265271 abort and device release */···477471void request_send_background(struct fuse_conn *fc, struct fuse_req *req);478472479473/**480480- * Remove request from the the background list474474+ * Release inodes and file associated with background request481475 */482482-void fuse_remove_background(struct fuse_conn *fc, struct fuse_req *req);476476+void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req);483477484484-/** Abort all requests */478478+/* Abort all requests */485479void fuse_abort_conn(struct fuse_conn *fc);486480487481/**
+18-22
fs/fuse/inode.c
···204204{205205 struct fuse_conn *fc = get_fuse_conn_super(sb);206206207207+ down_write(&fc->sbput_sem);208208+ while (!list_empty(&fc->background))209209+ fuse_release_background(fc,210210+ list_entry(fc->background.next,211211+ struct fuse_req, bg_entry));212212+207213 spin_lock(&fc->lock);214214+ fc->mounted = 0;208215 fc->connected = 0;209209- while (!list_empty(&fc->background)) {210210- struct fuse_req *req = list_entry(fc->background.next,211211- struct fuse_req, bg_entry);212212- struct inode *inode = req->inode;213213- struct inode *inode2 = req->inode2;214214-215215- /* File would hold a reference to vfsmount */216216- BUG_ON(req->file);217217- req->inode = NULL;218218- req->inode2 = NULL;219219- fuse_remove_background(fc, req);220220-221221- spin_unlock(&fc->lock);222222- iput(inode);223223- iput(inode2);224224- spin_lock(&fc->lock);225225- }226216 spin_unlock(&fc->lock);217217+ up_write(&fc->sbput_sem);227218 /* Flush all readers on this fs */228219 kill_fasync(&fc->fasync, SIGIO, POLL_IN);229220 wake_up_all(&fc->waitq);···386395 INIT_LIST_HEAD(&fc->processing);387396 INIT_LIST_HEAD(&fc->io);388397 INIT_LIST_HEAD(&fc->background);398398+ init_rwsem(&fc->sbput_sem);389399 kobj_set_kset_s(fc, connections_subsys);390400 kobject_init(&fc->kobj);391401 atomic_set(&fc->num_waiting, 0);···500508 if (file->f_op != &fuse_dev_operations)501509 return -EINVAL;502510503503- /* Setting file->private_data can't race with other mount()504504- instances, since BKL is held for ->get_sb() */505505- if (file->private_data)506506- return -EINVAL;507507-508511 fc = new_conn();509512 if (!fc)510513 return -ENOMEM;···535548 if (err)536549 goto err_free_req;537550551551+ /* Setting file->private_data can't race with other mount()552552+ instances, since BKL is held for ->get_sb() */553553+ err = -EINVAL;554554+ if (file->private_data)555555+ goto err_kobject_del;556556+538557 sb->s_root = root_dentry;558558+ fc->mounted = 1;539559 fc->connected = 1;540560 kobject_get(&fc->kobj);541561 file->private_data = fc;···557563558564 return 0;559565566566+ err_kobject_del:567567+ kobject_del(&fc->kobj);560568 err_free_req:561569 fuse_request_free(init_req);562570 err_put_root:
+3-2
fs/reiserfs/xattr_acl.c
···408408 acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT);409409 reiserfs_read_unlock_xattrs(inode->i_sb);410410 reiserfs_read_unlock_xattr_i(inode);411411- ret = acl ? 1 : 0;412412- posix_acl_release(acl);411411+ ret = (acl && !IS_ERR(acl));412412+ if (ret)413413+ posix_acl_release(acl);413414 }414415415416 return ret;
+282-73
fs/splice.c
···2727#include <linux/buffer_head.h>2828#include <linux/module.h>2929#include <linux/syscalls.h>3030+#include <linux/uio.h>3131+3232+struct partial_page {3333+ unsigned int offset;3434+ unsigned int len;3535+};30363137/*3232- * Passed to the actors3838+ * Passed to splice_to_pipe3339 */3434-struct splice_desc {3535- unsigned int len, total_len; /* current and remaining length */4040+struct splice_pipe_desc {4141+ struct page **pages; /* page map */4242+ struct partial_page *partial; /* pages[] may not be contig */4343+ int nr_pages; /* number of pages in map */3644 unsigned int flags; /* splice flags */3737- struct file *file; /* file to read/write */3838- loff_t pos; /* file position */4545+ struct pipe_buf_operations *ops;/* ops associated with output pipe */3946};40474148/*···135128 kunmap(buf->page);136129}137130131131+static void *user_page_pipe_buf_map(struct file *file,132132+ struct pipe_inode_info *pipe,133133+ struct pipe_buffer *buf)134134+{135135+ return kmap(buf->page);136136+}137137+138138+static void user_page_pipe_buf_unmap(struct pipe_inode_info *pipe,139139+ struct pipe_buffer *buf)140140+{141141+ kunmap(buf->page);142142+}143143+138144static void page_cache_pipe_buf_get(struct pipe_inode_info *info,139145 struct pipe_buffer *buf)140146{···163143 .get = page_cache_pipe_buf_get,164144};165145146146+static int user_page_pipe_buf_steal(struct pipe_inode_info *pipe,147147+ struct pipe_buffer *buf)148148+{149149+ return 1;150150+}151151+152152+static struct pipe_buf_operations user_page_pipe_buf_ops = {153153+ .can_merge = 0,154154+ .map = user_page_pipe_buf_map,155155+ .unmap = user_page_pipe_buf_unmap,156156+ .release = page_cache_pipe_buf_release,157157+ .steal = user_page_pipe_buf_steal,158158+ .get = page_cache_pipe_buf_get,159159+};160160+166161/*167162 * Pipe output worker. This sets up our pipe format with the page cache168163 * pipe buffer operations. Otherwise very similar to the regular pipe_writev().169164 */170170-static ssize_t move_to_pipe(struct pipe_inode_info *pipe, struct page **pages,171171- int nr_pages, unsigned long len,172172- unsigned int offset, unsigned int flags)165165+static ssize_t splice_to_pipe(struct pipe_inode_info *pipe,166166+ struct splice_pipe_desc *spd)173167{174174- int ret, do_wakeup, i;168168+ int ret, do_wakeup, page_nr;175169176170 ret = 0;177171 do_wakeup = 0;178178- i = 0;172172+ page_nr = 0;179173180174 if (pipe->inode)181175 mutex_lock(&pipe->inode->i_mutex);···205171 if (pipe->nrbufs < PIPE_BUFFERS) {206172 int newbuf = (pipe->curbuf + pipe->nrbufs) & (PIPE_BUFFERS - 1);207173 struct pipe_buffer *buf = pipe->bufs + newbuf;208208- struct page *page = pages[i++];209209- unsigned long this_len;210174211211- this_len = PAGE_CACHE_SIZE - offset;212212- if (this_len > len)213213- this_len = len;214214-215215- buf->page = page;216216- buf->offset = offset;217217- buf->len = this_len;218218- buf->ops = &page_cache_pipe_buf_ops;175175+ buf->page = spd->pages[page_nr];176176+ buf->offset = spd->partial[page_nr].offset;177177+ buf->len = spd->partial[page_nr].len;178178+ buf->ops = spd->ops;219179 pipe->nrbufs++;180180+ page_nr++;181181+ ret += buf->len;182182+220183 if (pipe->inode)221184 do_wakeup = 1;222185223223- ret += this_len;224224- len -= this_len;225225- offset = 0;226226- if (!--nr_pages)227227- break;228228- if (!len)186186+ if (!--spd->nr_pages)229187 break;230188 if (pipe->nrbufs < PIPE_BUFFERS)231189 continue;···225199 break;226200 }227201228228- if (flags & SPLICE_F_NONBLOCK) {202202+ if (spd->flags & SPLICE_F_NONBLOCK) {229203 if (!ret)230204 ret = -EAGAIN;231205 break;···260234 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);261235 }262236263263- while (i < nr_pages)264264- page_cache_release(pages[i++]);237237+ while (page_nr < spd->nr_pages)238238+ page_cache_release(spd->pages[page_nr++]);265239266240 return ret;267241}···272246 unsigned int flags)273247{274248 struct address_space *mapping = in->f_mapping;275275- unsigned int loff, offset, nr_pages;249249+ unsigned int loff, nr_pages;276250 struct page *pages[PIPE_BUFFERS];251251+ struct partial_page partial[PIPE_BUFFERS];277252 struct page *page;278253 pgoff_t index, end_index;279254 loff_t isize;280280- size_t bytes;281281- int i, error;255255+ size_t total_len;256256+ int error;257257+ struct splice_pipe_desc spd = {258258+ .pages = pages,259259+ .partial = partial,260260+ .flags = flags,261261+ .ops = &page_cache_pipe_buf_ops,262262+ };282263283264 index = *ppos >> PAGE_CACHE_SHIFT;284284- loff = offset = *ppos & ~PAGE_CACHE_MASK;285285- nr_pages = (len + offset + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;265265+ loff = *ppos & ~PAGE_CACHE_MASK;266266+ nr_pages = (len + loff + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;286267287268 if (nr_pages > PIPE_BUFFERS)288269 nr_pages = PIPE_BUFFERS;···299266 * read-ahead if this is a non-zero offset (we are likely doing small300267 * chunk splice and the page is already there) for a single page.301268 */302302- if (!offset || nr_pages > 1)303303- do_page_cache_readahead(mapping, in, index, nr_pages);269269+ if (!loff || spd.nr_pages > 1)270270+ do_page_cache_readahead(mapping, in, index, spd.nr_pages);304271305272 /*306273 * Now fill in the holes:307274 */308275 error = 0;309309- bytes = 0;310310- for (i = 0; i < nr_pages; i++, index++) {276276+ total_len = 0;277277+ for (spd.nr_pages = 0; spd.nr_pages < nr_pages; spd.nr_pages++, index++) {311278 unsigned int this_len;312279313280 if (!len)···316283 /*317284 * this_len is the max we'll use from this page318285 */319319- this_len = min(len, PAGE_CACHE_SIZE - loff);286286+ this_len = min_t(unsigned long, len, PAGE_CACHE_SIZE - loff);320287find_page:321288 /*322289 * lookup the page for this index···400367 */401368 if (end_index == index) {402369 loff = PAGE_CACHE_SIZE - (isize & ~PAGE_CACHE_MASK);403403- if (bytes + loff > isize) {370370+ if (total_len + loff > isize) {404371 page_cache_release(page);405372 break;406373 }407374 /*408375 * force quit after adding this page409376 */410410- nr_pages = i;377377+ nr_pages = spd.nr_pages;411378 this_len = min(this_len, loff);379379+ loff = 0;412380 }413381 }414382fill_it:415415- pages[i] = page;416416- bytes += this_len;383383+ pages[spd.nr_pages] = page;384384+ partial[spd.nr_pages].offset = loff;385385+ partial[spd.nr_pages].len = this_len;417386 len -= this_len;387387+ total_len += this_len;418388 loff = 0;419389 }420390421421- if (i)422422- return move_to_pipe(pipe, pages, i, bytes, offset, flags);391391+ if (spd.nr_pages)392392+ return splice_to_pipe(pipe, &spd);423393424394 return error;425395}···475439476440/*477441 * Send 'sd->len' bytes to socket from 'sd->file' at position 'sd->pos'478478- * using sendpage().442442+ * using sendpage(). Return the number of bytes sent.479443 */480444static int pipe_to_sendpage(struct pipe_inode_info *info,481445 struct pipe_buffer *buf, struct splice_desc *sd)482446{483447 struct file *file = sd->file;484448 loff_t pos = sd->pos;485485- unsigned int offset;486449 ssize_t ret;487450 void *ptr;488451 int more;···496461 if (IS_ERR(ptr))497462 return PTR_ERR(ptr);498463499499- offset = pos & ~PAGE_CACHE_MASK;500464 more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;501465502502- ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,more);466466+ ret = file->f_op->sendpage(file, buf->page, buf->offset, sd->len,467467+ &pos, more);503468504469 buf->ops->unmap(info, buf);505505- if (ret == sd->len)506506- return 0;507507-508508- return -EIO;470470+ return ret;509471}510472511473/*···531499 struct file *file = sd->file;532500 struct address_space *mapping = file->f_mapping;533501 gfp_t gfp_mask = mapping_gfp_mask(mapping);534534- unsigned int offset;502502+ unsigned int offset, this_len;535503 struct page *page;536504 pgoff_t index;537505 char *src;···546514547515 index = sd->pos >> PAGE_CACHE_SHIFT;548516 offset = sd->pos & ~PAGE_CACHE_MASK;517517+518518+ this_len = sd->len;519519+ if (this_len + offset > PAGE_CACHE_SIZE)520520+ this_len = PAGE_CACHE_SIZE - offset;549521550522 /*551523 * Reuse buf page, if SPLICE_F_MOVE is set.···594558 * the full page.595559 */596560 if (!PageUptodate(page)) {597597- if (sd->len < PAGE_CACHE_SIZE) {561561+ if (this_len < PAGE_CACHE_SIZE) {598562 ret = mapping->a_ops->readpage(file, page);599563 if (unlikely(ret))600564 goto out;···618582 }619583 }620584621621- ret = mapping->a_ops->prepare_write(file, page, 0, sd->len);585585+ ret = mapping->a_ops->prepare_write(file, page, offset, offset+this_len);622586 if (ret == AOP_TRUNCATED_PAGE) {623587 page_cache_release(page);624588 goto find_page;···628592 if (!(buf->flags & PIPE_BUF_FLAG_STOLEN)) {629593 char *dst = kmap_atomic(page, KM_USER0);630594631631- memcpy(dst + offset, src + buf->offset, sd->len);595595+ memcpy(dst + offset, src + buf->offset, this_len);632596 flush_dcache_page(page);633597 kunmap_atomic(dst, KM_USER0);634598 }635599636636- ret = mapping->a_ops->commit_write(file, page, 0, sd->len);600600+ ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len);637601 if (ret == AOP_TRUNCATED_PAGE) {638602 page_cache_release(page);639603 goto find_page;640604 } else if (ret)641605 goto out;642606607607+ /*608608+ * Return the number of bytes written.609609+ */610610+ ret = this_len;643611 mark_page_accessed(page);644612 balance_dirty_pages_ratelimited(mapping);645613out:···656616 return ret;657617}658618659659-typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,660660- struct splice_desc *);661661-662619/*663620 * Pipe input worker. Most of this logic works like a regular pipe, the664621 * key here is the 'actor' worker passed in that actually moves the data665622 * to the wanted destination. See pipe_to_file/pipe_to_sendpage above.666623 */667667-static ssize_t move_from_pipe(struct pipe_inode_info *pipe, struct file *out,668668- loff_t *ppos, size_t len, unsigned int flags,669669- splice_actor *actor)624624+ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out,625625+ loff_t *ppos, size_t len, unsigned int flags,626626+ splice_actor *actor)670627{671628 int ret, do_wakeup, err;672629 struct splice_desc sd;···689652 sd.len = sd.total_len;690653691654 err = actor(pipe, buf, &sd);692692- if (err) {655655+ if (err <= 0) {693656 if (!ret && err != -ENODATA)694657 ret = err;695658696659 break;697660 }698661699699- ret += sd.len;700700- buf->offset += sd.len;701701- buf->len -= sd.len;662662+ ret += err;663663+ buf->offset += err;664664+ buf->len -= err;665665+666666+ sd.len -= err;667667+ sd.pos += err;668668+ sd.total_len -= err;669669+ if (sd.len)670670+ continue;702671703672 if (!buf->len) {704673 buf->ops = NULL;···715672 do_wakeup = 1;716673 }717674718718- sd.pos += sd.len;719719- sd.total_len -= sd.len;720675 if (!sd.total_len)721676 break;722677 }···782741 struct address_space *mapping = out->f_mapping;783742 ssize_t ret;784743785785- ret = move_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);744744+ ret = splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_file);786745 if (ret > 0) {787746 struct inode *inode = mapping->host;788747···824783ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, struct file *out,825784 loff_t *ppos, size_t len, unsigned int flags)826785{827827- return move_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage);786786+ return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_sendpage);828787}829788830789EXPORT_SYMBOL(generic_splice_sendpage);···911870912871 /*913872 * We don't have an immediate reader, but we'll read the stuff914914- * out of the pipe right after the move_to_pipe(). So set873873+ * out of the pipe right after the splice_to_pipe(). So set915874 * PIPE_READERS appropriately.916875 */917876 pipe->readers = 1;···10491008 }1050100910511010 return -EINVAL;10111011+}10121012+10131013+/*10141014+ * Map an iov into an array of pages and offset/length tupples. With the10151015+ * partial_page structure, we can map several non-contiguous ranges into10161016+ * our ones pages[] map instead of splitting that operation into pieces.10171017+ * Could easily be exported as a generic helper for other users, in which10181018+ * case one would probably want to add a 'max_nr_pages' parameter as well.10191019+ */10201020+static int get_iovec_page_array(const struct iovec __user *iov,10211021+ unsigned int nr_vecs, struct page **pages,10221022+ struct partial_page *partial)10231023+{10241024+ int buffers = 0, error = 0;10251025+10261026+ /*10271027+ * It's ok to take the mmap_sem for reading, even10281028+ * across a "get_user()".10291029+ */10301030+ down_read(¤t->mm->mmap_sem);10311031+10321032+ while (nr_vecs) {10331033+ unsigned long off, npages;10341034+ void __user *base;10351035+ size_t len;10361036+ int i;10371037+10381038+ /*10391039+ * Get user address base and length for this iovec.10401040+ */10411041+ error = get_user(base, &iov->iov_base);10421042+ if (unlikely(error))10431043+ break;10441044+ error = get_user(len, &iov->iov_len);10451045+ if (unlikely(error))10461046+ break;10471047+10481048+ /*10491049+ * Sanity check this iovec. 0 read succeeds.10501050+ */10511051+ if (unlikely(!len))10521052+ break;10531053+ error = -EFAULT;10541054+ if (unlikely(!base))10551055+ break;10561056+10571057+ /*10581058+ * Get this base offset and number of pages, then map10591059+ * in the user pages.10601060+ */10611061+ off = (unsigned long) base & ~PAGE_MASK;10621062+ npages = (off + len + PAGE_SIZE - 1) >> PAGE_SHIFT;10631063+ if (npages > PIPE_BUFFERS - buffers)10641064+ npages = PIPE_BUFFERS - buffers;10651065+10661066+ error = get_user_pages(current, current->mm,10671067+ (unsigned long) base, npages, 0, 0,10681068+ &pages[buffers], NULL);10691069+10701070+ if (unlikely(error <= 0))10711071+ break;10721072+10731073+ /*10741074+ * Fill this contiguous range into the partial page map.10751075+ */10761076+ for (i = 0; i < error; i++) {10771077+ const int plen = min_t(size_t, len, PAGE_SIZE) - off;10781078+10791079+ partial[buffers].offset = off;10801080+ partial[buffers].len = plen;10811081+10821082+ off = 0;10831083+ len -= plen;10841084+ buffers++;10851085+ }10861086+10871087+ /*10881088+ * We didn't complete this iov, stop here since it probably10891089+ * means we have to move some of this into a pipe to10901090+ * be able to continue.10911091+ */10921092+ if (len)10931093+ break;10941094+10951095+ /*10961096+ * Don't continue if we mapped fewer pages than we asked for,10971097+ * or if we mapped the max number of pages that we have10981098+ * room for.10991099+ */11001100+ if (error < npages || buffers == PIPE_BUFFERS)11011101+ break;11021102+11031103+ nr_vecs--;11041104+ iov++;11051105+ }11061106+11071107+ up_read(¤t->mm->mmap_sem);11081108+11091109+ if (buffers)11101110+ return buffers;11111111+11121112+ return error;11131113+}11141114+11151115+/*11161116+ * vmsplice splices a user address range into a pipe. It can be thought of11171117+ * as splice-from-memory, where the regular splice is splice-from-file (or11181118+ * to file). In both cases the output is a pipe, naturally.11191119+ *11201120+ * Note that vmsplice only supports splicing _from_ user memory to a pipe,11211121+ * not the other way around. Splicing from user memory is a simple operation11221122+ * that can be supported without any funky alignment restrictions or nasty11231123+ * vm tricks. We simply map in the user memory and fill them into a pipe.11241124+ * The reverse isn't quite as easy, though. There are two possible solutions11251125+ * for that:11261126+ *11271127+ * - memcpy() the data internally, at which point we might as well just11281128+ * do a regular read() on the buffer anyway.11291129+ * - Lots of nasty vm tricks, that are neither fast nor flexible (it11301130+ * has restriction limitations on both ends of the pipe).11311131+ *11321132+ * Alas, it isn't here.11331133+ *11341134+ */11351135+static long do_vmsplice(struct file *file, const struct iovec __user *iov,11361136+ unsigned long nr_segs, unsigned int flags)11371137+{11381138+ struct pipe_inode_info *pipe = file->f_dentry->d_inode->i_pipe;11391139+ struct page *pages[PIPE_BUFFERS];11401140+ struct partial_page partial[PIPE_BUFFERS];11411141+ struct splice_pipe_desc spd = {11421142+ .pages = pages,11431143+ .partial = partial,11441144+ .flags = flags,11451145+ .ops = &user_page_pipe_buf_ops,11461146+ };11471147+11481148+ if (unlikely(!pipe))11491149+ return -EBADF;11501150+ if (unlikely(nr_segs > UIO_MAXIOV))11511151+ return -EINVAL;11521152+ else if (unlikely(!nr_segs))11531153+ return 0;11541154+11551155+ spd.nr_pages = get_iovec_page_array(iov, nr_segs, pages, partial);11561156+ if (spd.nr_pages <= 0)11571157+ return spd.nr_pages;11581158+11591159+ return splice_to_pipe(pipe, &spd);11601160+}11611161+11621162+asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,11631163+ unsigned long nr_segs, unsigned int flags)11641164+{11651165+ struct file *file;11661166+ long error;11671167+ int fput;11681168+11691169+ error = -EBADF;11701170+ file = fget_light(fd, &fput);11711171+ if (file) {11721172+ if (file->f_mode & FMODE_WRITE)11731173+ error = do_vmsplice(file, iov, nr_segs, flags);11741174+11751175+ fput_light(file, fput);11761176+ }11771177+11781178+ return error;10521179}1053118010541181asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
+2-1
include/asm-i386/unistd.h
···321321#define __NR_splice 313322322#define __NR_sync_file_range 314323323#define __NR_tee 315324324+#define __NR_vmsplice 316324325325325-#define NR_syscalls 316326326+#define NR_syscalls 317326327327328/*328329 * user-visible error numbers are in the range -1 - -128: see
···126126127127extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);128128129129+/* Most machines react poorly to I/O-space being cacheable... Instead let's130130+ * define ioremap() in terms of ioremap_nocache().131131+ */129132extern inline void __iomem * ioremap(unsigned long offset, unsigned long size)130133{131131- return __ioremap(offset, size, 0);134134+ return __ioremap(offset, size, _PAGE_NO_CACHE);132135}133133-134134-/*135135- * This one maps high address device memory and turns off caching for that area.136136- * it's useful if some control registers are in such an area and write combining137137- * or read caching is not desirable:138138- */139139-extern inline void * ioremap_nocache(unsigned long offset, unsigned long size)140140-{141141- return __ioremap(offset, size, _PAGE_NO_CACHE /* _PAGE_PCD */);142142-}136136+#define ioremap_nocache(off, sz) ioremap((off), (sz))143137144138extern void iounmap(void __iomem *addr);145145-146139147140static inline unsigned char __raw_readb(const volatile void __iomem *addr)148141{
···5959#define ISTACK_SIZE 32768 /* Interrupt Stack Size */6060#define ISTACK_ORDER 361616262-/* This is the size of the initially mapped kernel memory (i.e. currently6363- * 0 to 1<<23 == 8MB */6262+/* This is the size of the initially mapped kernel memory */6463#ifdef CONFIG_64BIT6565-#define KERNEL_INITIAL_ORDER 246464+#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */6665#else6767-#define KERNEL_INITIAL_ORDER 236666+#define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */6867#endif6968#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER)70697171-#ifdef CONFIG_64BIT7070+#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)7271#define PT_NLEVELS 37372#define PGD_ORDER 1 /* Number of pages per pgd */7473#define PMD_ORDER 1 /* Number of pages per pmd */···110111#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD)111112#define MAX_ADDRESS (1UL << MAX_ADDRBITS)112113113113-#define SPACEID_SHIFT (MAX_ADDRBITS - 32)114114+#define SPACEID_SHIFT (MAX_ADDRBITS - 32)114115115116/* This calculates the number of initial pages we need for the initial116117 * page tables */117117-#define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT))118118+#if (KERNEL_INITIAL_ORDER) >= (PMD_SHIFT)119119+# define PT_INITIAL (1 << (KERNEL_INITIAL_ORDER - PMD_SHIFT))120120+#else121121+# define PT_INITIAL (1) /* all initial PTEs fit into one page */122122+#endif118123119124/*120125 * pgd entries used up by user/kernel:···163160 * to zero */164161#define PTE_SHIFT xlate_pabit(_PAGE_USER_BIT)165162163163+/* PFN_PTE_SHIFT defines the shift of a PTE value to access the PFN field */164164+#define PFN_PTE_SHIFT 12165165+166166+166167/* this is how many bits may be used by the file functions */167168#define PTE_FILE_MAX_BITS (BITS_PER_LONG - PTE_SHIFT)168169···195188/* The pgd/pmd contains a ptr (in phys addr space); since all pgds/pmds196189 * are page-aligned, we don't care about the PAGE_OFFSET bits, except197190 * for a few meta-information bits, so we shift the address to be198198- * able to effectively address 40-bits of physical address space. */191191+ * able to effectively address 40/42/44-bits of physical address space192192+ * depending on 4k/16k/64k PAGE_SIZE */199193#define _PxD_PRESENT_BIT 31200194#define _PxD_ATTACHED_BIT 30201195#define _PxD_VALID_BIT 29···206198#define PxD_FLAG_VALID (1 << xlate_pabit(_PxD_VALID_BIT))207199#define PxD_FLAG_MASK (0xf)208200#define PxD_FLAG_SHIFT (4)209209-#define PxD_VALUE_SHIFT (8)201201+#define PxD_VALUE_SHIFT (8) /* (PAGE_SHIFT-PxD_FLAG_SHIFT) */210202211203#ifndef __ASSEMBLY__212204···254246#define __S110 PAGE_RWX255247#define __S111 PAGE_RWX256248249249+257250extern pgd_t swapper_pg_dir[]; /* declared in init_task.c */258251259252/* initial page tables for 0-8MB for kernel */···281272#define pgd_flag(x) (pgd_val(x) & PxD_FLAG_MASK)282273#define pgd_address(x) ((unsigned long)(pgd_val(x) &~ PxD_FLAG_MASK) << PxD_VALUE_SHIFT)283274284284-#ifdef CONFIG_64BIT275275+#if PT_NLEVELS == 3285276/* The first entry of the permanent pmd is not there if it contains286277 * the gateway marker */287278#define pmd_none(x) (!pmd_val(x) || pmd_flag(x) == PxD_FLAG_ATTACHED)···291282#define pmd_bad(x) (!(pmd_flag(x) & PxD_FLAG_VALID))292283#define pmd_present(x) (pmd_flag(x) & PxD_FLAG_PRESENT)293284static inline void pmd_clear(pmd_t *pmd) {294294-#ifdef CONFIG_64BIT285285+#if PT_NLEVELS == 3295286 if (pmd_flag(*pmd) & PxD_FLAG_ATTACHED)296287 /* This is the entry pointing to the permanent pmd297288 * attached to the pgd; cannot clear it */···312303#define pgd_bad(x) (!(pgd_flag(x) & PxD_FLAG_VALID))313304#define pgd_present(x) (pgd_flag(x) & PxD_FLAG_PRESENT)314305static inline void pgd_clear(pgd_t *pgd) {315315-#ifdef CONFIG_64BIT306306+#if PT_NLEVELS == 3316307 if(pgd_flag(*pgd) & PxD_FLAG_ATTACHED)317308 /* This is the permanent pmd attached to the pgd; cannot318309 * free it */···360351({ \361352 pte_t __pte; \362353 \363363- pte_val(__pte) = ((addr)+pgprot_val(pgprot)); \354354+ pte_val(__pte) = ((((addr)>>PAGE_SHIFT)<<PFN_PTE_SHIFT) + pgprot_val(pgprot)); \364355 \365356 __pte; \366357})···370361static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)371362{372363 pte_t pte;373373- pte_val(pte) = (pfn << PAGE_SHIFT) | pgprot_val(pgprot);364364+ pte_val(pte) = (pfn << PFN_PTE_SHIFT) | pgprot_val(pgprot);374365 return pte;375366}376376-377377-/* This takes a physical page address that is used by the remapping functions */378378-#define mk_pte_phys(physpage, pgprot) \379379-({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })380367381368extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)382369{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }383370384371/* Permanent address of a page. On parisc we don't have highmem. */385372386386-#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)373373+#define pte_pfn(x) (pte_val(x) >> PFN_PTE_SHIFT)387374388375#define pte_page(pte) (pfn_to_page(pte_pfn(pte)))389376···503498#define pte_same(A,B) (pte_val(A) == pte_val(B))504499505500#endif /* !__ASSEMBLY__ */501501+502502+503503+/* TLB page size encoding - see table 3-1 in parisc20.pdf */504504+#define _PAGE_SIZE_ENCODING_4K 0505505+#define _PAGE_SIZE_ENCODING_16K 1506506+#define _PAGE_SIZE_ENCODING_64K 2507507+#define _PAGE_SIZE_ENCODING_256K 3508508+#define _PAGE_SIZE_ENCODING_1M 4509509+#define _PAGE_SIZE_ENCODING_4M 5510510+#define _PAGE_SIZE_ENCODING_16M 6511511+#define _PAGE_SIZE_ENCODING_64M 7512512+513513+#if defined(CONFIG_PARISC_PAGE_SIZE_4KB)514514+# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_4K515515+#elif defined(CONFIG_PARISC_PAGE_SIZE_16KB)516516+# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_16K517517+#elif defined(CONFIG_PARISC_PAGE_SIZE_64KB)518518+# define _PAGE_SIZE_ENCODING_DEFAULT _PAGE_SIZE_ENCODING_64K519519+#endif520520+506521507522#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \508523 remap_pfn_range(vma, vaddr, pfn, size, prot)
···829829 __netif_rx_schedule(dev);830830}831831832832-/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete().833833- * Do not inline this?834834- */832832+833833+static inline void __netif_rx_reschedule(struct net_device *dev, int undo)834834+{835835+ dev->quota += undo;836836+ list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);837837+ __raise_softirq_irqoff(NET_RX_SOFTIRQ);838838+}839839+840840+/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */835841static inline int netif_rx_reschedule(struct net_device *dev, int undo)836842{837843 if (netif_rx_schedule_prep(dev)) {838844 unsigned long flags;839839-840840- dev->quota += undo;841841-842845 local_irq_save(flags);843843- list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);844844- __raise_softirq_irqoff(NET_RX_SOFTIRQ);846846+ __netif_rx_reschedule(dev, undo);845847 local_irq_restore(flags);846848 return 1;847849 }
···6161 /* from/to, of course */6262#define SPLICE_F_MORE (0x04) /* expect more data */63636464+/*6565+ * Passed to the actors6666+ */6767+struct splice_desc {6868+ unsigned int len, total_len; /* current and remaining length */6969+ unsigned int flags; /* splice flags */7070+ struct file *file; /* file to read/write */7171+ loff_t pos; /* file position */7272+};7373+7474+typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,7575+ struct splice_desc *);7676+7777+extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,7878+ loff_t *, size_t, unsigned int,7979+ splice_actor *);8080+6481#endif
+3
include/linux/syscalls.h
···574574 int fd_out, loff_t __user *off_out,575575 size_t len, unsigned int flags);576576577577+asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,578578+ unsigned long nr_segs, unsigned int flags);579579+577580asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);578581579582asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
+4-1
include/net/ieee80211softmac.h
···9696 *9797 * bssvalid is true if we found a matching network9898 * and saved it's BSSID into the bssid above.9999+ *100100+ * bssfixed is used for SIOCSIWAP.99101 */100102 u8 static_essid:1,101103 associating:1,102102- bssvalid:1;104104+ bssvalid:1,105105+ bssfixed:1;103106104107 /* Scan retries remaining */105108 int scan_retry;
+2-2
kernel/hrtimer.c
···836836}837837#endif /* CONFIG_HOTPLUG_CPU */838838839839-static int __devinit hrtimer_cpu_notify(struct notifier_block *self,839839+static int hrtimer_cpu_notify(struct notifier_block *self,840840 unsigned long action, void *hcpu)841841{842842 long cpu = (long)hcpu;···860860 return NOTIFY_OK;861861}862862863863-static struct notifier_block __devinitdata hrtimers_nb = {863863+static struct notifier_block hrtimers_nb = {864864 .notifier_call = hrtimer_cpu_notify,865865};866866
+1-1
kernel/profile.c
···299299}300300301301#ifdef CONFIG_HOTPLUG_CPU302302-static int __devinit profile_cpu_callback(struct notifier_block *info,302302+static int profile_cpu_callback(struct notifier_block *info,303303 unsigned long action, void *__cpu)304304{305305 int node, cpu = (unsigned long)__cpu;
+2-2
kernel/rcupdate.c
···520520 tasklet_init(&per_cpu(rcu_tasklet, cpu), rcu_process_callbacks, 0UL);521521}522522523523-static int __devinit rcu_cpu_notify(struct notifier_block *self, 523523+static int rcu_cpu_notify(struct notifier_block *self,524524 unsigned long action, void *hcpu)525525{526526 long cpu = (long)hcpu;···537537 return NOTIFY_OK;538538}539539540540-static struct notifier_block __devinitdata rcu_nb = {540540+static struct notifier_block rcu_nb = {541541 .notifier_call = rcu_cpu_notify,542542};543543
+1-1
kernel/sched.c
···48144814/* Register at highest priority so that task migration (migrate_all_tasks)48154815 * happens before everything else.48164816 */48174817-static struct notifier_block __devinitdata migration_notifier = {48174817+static struct notifier_block migration_notifier = {48184818 .notifier_call = migration_call,48194819 .priority = 1048204820};
···104104/*105105 * Create/destroy watchdog threads as CPUs come and go:106106 */107107-static int __devinit107107+static int108108cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)109109{110110 int hotcpu = (unsigned long)hcpu;···140140 return NOTIFY_OK;141141}142142143143-static struct notifier_block __devinitdata cpu_nfb = {143143+static struct notifier_block cpu_nfb = {144144 .notifier_call = cpu_callback145145};146146
+2-2
kernel/timer.c
···13141314}13151315#endif /* CONFIG_HOTPLUG_CPU */1316131613171317-static int __devinit timer_cpu_notify(struct notifier_block *self, 13171317+static int timer_cpu_notify(struct notifier_block *self,13181318 unsigned long action, void *hcpu)13191319{13201320 long cpu = (long)hcpu;···13341334 return NOTIFY_OK;13351335}1336133613371337-static struct notifier_block __devinitdata timers_nb = {13371337+static struct notifier_block timers_nb = {13381338 .notifier_call = timer_cpu_notify,13391339};13401340
+1-1
kernel/workqueue.c
···547547}548548549549/* We're holding the cpucontrol mutex here */550550-static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,550550+static int workqueue_cpu_callback(struct notifier_block *nfb,551551 unsigned long action,552552 void *hcpu)553553{
+1-1
mm/page_alloc.c
···19621962 }19631963}1964196419651965-static int __cpuinit pageset_cpuup_callback(struct notifier_block *nfb,19651965+static int pageset_cpuup_callback(struct notifier_block *nfb,19661966 unsigned long action,19671967 void *hcpu)19681968{
···1036103610371037#endif1038103810391039-static int __devinit cpuup_callback(struct notifier_block *nfb,10391039+static int cpuup_callback(struct notifier_block *nfb,10401040 unsigned long action, void *hcpu)10411041{10421042 long cpu = (long)hcpu;
+1-1
mm/vmscan.c
···13281328 not required for correctness. So if the last cpu in a node goes13291329 away, we get changed to run anywhere: as the first one comes back,13301330 restore their cpu bindings. */13311331-static int __devinit cpu_callback(struct notifier_block *nfb,13311331+static int cpu_callback(struct notifier_block *nfb,13321332 unsigned long action, void *hcpu)13331333{13341334 pg_data_t *pgdat;
···144144 if (!we_support_all_basic_rates(mac, net->rates_ex, net->rates_ex_len))145145 return 0;146146147147+ /* assume that users know what they're doing ...148148+ * (note we don't let them select a net we're incompatible with) */149149+ if (mac->associnfo.bssfixed) {150150+ return !memcmp(mac->associnfo.bssid, net->bssid, ETH_ALEN);151151+ }152152+147153 /* if 'ANY' network requested, take any that doesn't have privacy enabled */148154 if (mac->associnfo.req_essid.len == 0 149155 && !(net->capability & WLAN_CAPABILITY_PRIVACY))···182176 ieee80211softmac_disassoc(mac, WLAN_REASON_DISASSOC_STA_HAS_LEFT);183177184178 /* try to find the requested network in our list, if we found one already */185185- if (mac->associnfo.bssvalid)179179+ if (mac->associnfo.bssvalid || mac->associnfo.bssfixed)186180 found = ieee80211softmac_get_network_by_bssid(mac, mac->associnfo.bssid); 187181188182 /* Search the ieee80211 networks for this network if we didn't find it by bssid,···247241 if (ieee80211softmac_start_scan(mac))248242 dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n");249243 return;250250- }251251- else {244244+ } else {252245 spin_lock_irqsave(&mac->lock, flags);253246 mac->associnfo.associating = 0;254247 mac->associated = 0;255248 spin_unlock_irqrestore(&mac->lock, flags);256249257250 dprintk(KERN_INFO PFX "Unable to find matching network after scan!\n");251251+ /* reset the retry counter for the next user request since we252252+ * break out and don't reschedule ourselves after this point. */253253+ mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;258254 ieee80211softmac_call_events(mac, IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND, NULL);259255 return;260256 }261257 }262262-258258+259259+ /* reset the retry counter for the next user request since we260260+ * now found a net and will try to associate to it, but not261261+ * schedule this function again. */262262+ mac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;263263 mac->associnfo.bssvalid = 1;264264 memcpy(mac->associnfo.bssid, found->bssid, ETH_ALEN);265265 /* copy the ESSID for displaying it */
+2
net/ieee80211/softmac/ieee80211softmac_module.c
···4545 softmac->ieee->handle_disassoc = ieee80211softmac_handle_disassoc;4646 softmac->scaninfo = NULL;47474848+ softmac->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;4949+4850 /* TODO: initialise all the other callbacks in the ieee struct4951 * (once they're written)5052 */
+17-10
net/ieee80211/softmac/ieee80211softmac_wx.c
···2727#include "ieee80211softmac_priv.h"28282929#include <net/iw_handler.h>3030-3030+/* for is_broadcast_ether_addr and is_zero_ether_addr */3131+#include <linux/etherdevice.h>31323233int3334ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,···8483 sm->associnfo.static_essid = 1;8584 }8685 }8787- sm->associnfo.scan_retry = IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT;88868987 /* set our requested ESSID length.9088 * If applicable, we have already copied the data in */···310310 char *extra)311311{312312 struct ieee80211softmac_device *mac = ieee80211_priv(net_dev);313313- static const unsigned char any[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};314314- static const unsigned char off[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};315313 unsigned long flags;316314317315 /* sanity check */···318320 }319321320322 spin_lock_irqsave(&mac->lock, flags);321321- if (!memcmp(any, data->ap_addr.sa_data, ETH_ALEN) ||322322- !memcmp(off, data->ap_addr.sa_data, ETH_ALEN)) {323323- schedule_work(&mac->associnfo.work);324324- goto out;323323+ if (is_broadcast_ether_addr(data->ap_addr.sa_data)) {324324+ /* the bssid we have is not to be fixed any longer,325325+ * and we should reassociate to the best AP. */326326+ mac->associnfo.bssfixed = 0;327327+ /* force reassociation */328328+ mac->associnfo.bssvalid = 0;329329+ if (mac->associated)330330+ schedule_work(&mac->associnfo.work);331331+ } else if (is_zero_ether_addr(data->ap_addr.sa_data)) {332332+ /* the bssid we have is no longer fixed */333333+ mac->associnfo.bssfixed = 0;325334 } else {326335 if (!memcmp(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN)) {327336 if (mac->associnfo.associating || mac->associated) {···338333 } else {339334 /* copy new value in data->ap_addr.sa_data to bssid */340335 memcpy(mac->associnfo.bssid, data->ap_addr.sa_data, ETH_ALEN);341341- } 336336+ }337337+ /* tell the other code that this bssid should be used no matter what */338338+ mac->associnfo.bssfixed = 1;342339 /* queue associate if new bssid or (old one again and not associated) */343340 schedule_work(&mac->associnfo.work);344341 }345342346346-out:343343+ out:347344 spin_unlock_irqrestore(&mac->lock, flags);348345 return 0;349346}
+1-1
net/ipv4/netfilter/Kconfig
···345345 To compile it as a module, choose M here. If unsure, say N.346346347347config IP_NF_TARGET_ULOG348348- tristate "ULOG target support (OBSOLETE)"348348+ tristate "ULOG target support"349349 depends on IP_NF_IPTABLES350350 ---help---351351
-13
net/ipv6/netfilter/ip6_tables.c
···288288 table_base = (void *)private->entries[smp_processor_id()];289289 e = get_entry(table_base, private->hook_entry[hook]);290290291291-#ifdef CONFIG_NETFILTER_DEBUG292292- /* Check noone else using our table */293293- if (((struct ip6t_entry *)table_base)->comefrom != 0xdead57ac294294- && ((struct ip6t_entry *)table_base)->comefrom != 0xeeeeeeec) {295295- printk("ASSERT: CPU #%u, %s comefrom(%p) = %X\n",296296- smp_processor_id(),297297- table->name,298298- &((struct ip6t_entry *)table_base)->comefrom,299299- ((struct ip6t_entry *)table_base)->comefrom);300300- }301301- ((struct ip6t_entry *)table_base)->comefrom = 0x57acc001;302302-#endif303303-304291 /* For return from builtin chain */305292 back = get_entry(table_base, private->underflow[hook]);306293
+4-11
net/netfilter/nf_conntrack_core.c
···178178 /* allocated slab cache + modules which uses this slab cache */179179 int use;180180181181- /* Initialization */182182- int (*init_conntrack)(struct nf_conn *, u_int32_t);183183-184181} nf_ct_cache[NF_CT_F_NUM];185182186183/* protect members of nf_ct_cache except of "use" */···205208206209 preempt_disable();207210 p = __nf_ct_proto_find(l3proto, protocol);208208- if (p) {209209- if (!try_module_get(p->me))210210- p = &nf_conntrack_generic_protocol;211211- }211211+ if (!try_module_get(p->me))212212+ p = &nf_conntrack_generic_protocol;212213 preempt_enable();213214214215 return p;···224229225230 preempt_disable();226231 p = __nf_ct_l3proto_find(l3proto);227227- if (p) {228228- if (!try_module_get(p->me))229229- p = &nf_conntrack_generic_l3proto;230230- }232232+ if (!try_module_get(p->me))233233+ p = &nf_conntrack_generic_l3proto;231234 preempt_enable();232235233236 return p;