Commit 9c555a83 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://gkernel.bkbits.net/misc-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 002ca199 e97fde15
......@@ -341,6 +341,17 @@ Here is the new interface:
If the icache does not snoop stores then this routine will need
to flush it.
void flush_icache_user_range(struct vm_area_struct *vma,
struct page *page, unsigned long addr, int len)
This is called when the kernel stores into addresses that are
part of the address space of a user process (which may be some
other process than the current process). The addr argument
gives the virtual address in that process's address space,
page is the page which is being modified, and len indicates
how many bytes have been modified. The modified region must
not cross a page boundary. Currently this is only called from
kernel/ptrace.c.
void flush_icache_page(struct vm_area_struct *vma, struct page *page)
All the functionality of flush_icache_page can be implemented in
flush_dcache_page and update_mmu_cache. In 2.5 the hope is to
......
......@@ -1061,7 +1061,8 @@ ipi_flush_icache_page(void *x)
}
void
flush_icache_page(struct vm_area_struct *vma, struct page *page)
flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
unsigned long addr, int len)
{
struct mm_struct *mm = vma->vm_mm;
......
......@@ -133,7 +133,7 @@ sd_find_target(void *host, int tgt)
if (dp->device != NULL && dp->device->host == host
&& dp->device->id == tgt)
return MKDEV_SD(i);
return 0;
return NODEV;
}
#endif
......
......@@ -1431,15 +1431,10 @@ static void hid_disconnect(struct usb_device *dev, void *ptr)
{
struct hid_device *hid = ptr;
dbg("cleanup called");
usb_unlink_urb(hid->urbin);
usb_unlink_urb(hid->urbout);
usb_unlink_urb(hid->urbctrl);
usb_free_urb(hid->urbin);
usb_free_urb(hid->urbctrl);
if (hid->urbout)
usb_free_urb(hid->urbout);
if (hid->claimed & HID_CLAIMED_INPUT)
hidinput_disconnect(hid);
......@@ -1447,6 +1442,12 @@ static void hid_disconnect(struct usb_device *dev, void *ptr)
if (hid->claimed & HID_CLAIMED_HIDDEV)
hiddev_disconnect(hid);
#endif
usb_free_urb(hid->urbin);
usb_free_urb(hid->urbctrl);
if (hid->urbout)
usb_free_urb(hid->urbout);
hid_free_device(hid);
}
......
......@@ -2322,7 +2322,8 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
int usb_set_interface(struct usb_device *dev, int interface, int alternate)
{
struct usb_interface *iface;
int ret;
struct usb_interface_descriptor *iface_as;
int i, ret;
iface = usb_ifnum_to_if(dev, interface);
if (!iface) {
......@@ -2344,8 +2345,30 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
return ret;
iface->act_altsetting = alternate;
dev->toggle[0] = 0; /* 9.1.1.5 says to do this */
dev->toggle[1] = 0;
/* 9.1.1.5: reset toggles for all endpoints affected by this iface-as
*
* Note:
* Despite EP0 is always present in all interfaces/AS, the list of
* endpoints from the descriptor does not contain EP0. Due to its
* omnipresence one might expect EP0 being considered "affected" by
* any SetInterface request and hence assume toggles need to be reset.
* However, EP0 toggles are re-synced for every individual transfer
* during the SETUP stage - hence EP0 toggles are "don't care" here.
*/
iface_as = &iface->altsetting[alternate];
for (i = 0; i < iface_as->bNumEndpoints; i++) {
u8 ep = iface_as->endpoint[i].bEndpointAddress;
usb_settoggle(dev, ep&USB_ENDPOINT_NUMBER_MASK, usb_endpoint_out(ep), 0);
}
/* usb_set_maxpacket() sets the maxpacket size for all EP in all
* interfaces but it shouldn't do any harm here: we have changed
* the AS for the requested interface only, hence for unaffected
* interfaces it's just re-application of still-valid values.
*/
usb_set_maxpacket(dev);
return 0;
}
......
......@@ -70,8 +70,7 @@ flush_tlb_other(struct mm_struct *mm)
}
/* We need to flush the userspace icache after setting breakpoints in
ptrace. I don't think it's needed in do_swap_page, or do_no_page,
but I don't know how to get rid of it either.
ptrace.
Instead of indiscriminately using imb, take advantage of the fact
that icache entries are tagged with the ASN and load a new mm context. */
......@@ -79,7 +78,8 @@ flush_tlb_other(struct mm_struct *mm)
#ifndef CONFIG_SMP
static inline void
flush_icache_page(struct vm_area_struct *vma, struct page *page)
flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
unsigned long addr, int len)
{
if (vma->vm_flags & VM_EXEC) {
struct mm_struct *mm = vma->vm_mm;
......@@ -90,9 +90,13 @@ flush_icache_page(struct vm_area_struct *vma, struct page *page)
}
}
#else
extern void flush_icache_page(struct vm_area_struct *vma, struct page *page);
extern void flush_icache_user_range(struct vm_area_struct *vma,
struct page *page, unsigned long addr, int len);
#endif
/* this is used only in do_no_page and do_swap_page */
#define flush_icache_page(vma, page) flush_icache_user_range((vma), (page), 0, 0)
/*
* Flush just one page in the current TLB set.
* We need to be very careful about the icache here, there
......
......@@ -125,6 +125,7 @@ extern void paging_init(void);
#define flush_dcache_page(page) do { } while (0)
#define flush_icache_range(start, end) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/*
* TLB flushing (implemented in arch/cris/mm/tlb.c):
......
......@@ -33,6 +33,7 @@ extern void paging_init(void);
#define flush_dcache_page(page) do { } while (0)
#define flush_icache_range(start, end) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
#define __flush_tlb() \
do { \
......
......@@ -127,6 +127,7 @@ extern inline void __flush_page_to_ram(unsigned long address)
#define flush_dcache_page(page) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/* Push n pages at kernel virtual address and clear the icache */
/* RZ: use cpush %bc instead of cpush %dc, cinv %ic */
......
......@@ -51,6 +51,8 @@ extern void (*_flush_icache_page)(struct vm_area_struct *vma,
#define flush_icache_range(start, end) _flush_icache_range(start,end)
#define flush_icache_page(vma, page) _flush_icache_page(vma, page)
#define flush_icache_user_range(vma, page, addr, len) \
_flush_icache_page((vma), (page))
/*
......
......@@ -43,6 +43,8 @@ extern void (*_flush_page_to_ram)(struct page * page);
#define flush_page_to_ram(page) _flush_page_to_ram(page)
#define flush_icache_range(start, end) _flush_cache_l1()
#define flush_icache_user_range(vma, page, addr, len) \
flush_icache_page((vma), (page))
#define flush_icache_page(vma, page) \
do { \
......@@ -66,6 +68,8 @@ extern void andes_flush_icache_page(unsigned long);
#define flush_cache_page(vma,page) do { } while(0)
#define flush_page_to_ram(page) do { } while(0)
#define flush_icache_range(start, end) _flush_cache_l1()
#define flush_icache_user_range(vma, page, addr, len) \
flush_icache_page((vma), (page))
#define flush_icache_page(vma, page) \
do { \
if ((vma)->vm_flags & VM_EXEC) \
......
......@@ -106,6 +106,9 @@ extern inline void flush_cache_mm(struct mm_struct *mm) {
#define flush_icache_range(start, end) \
__flush_icache_range(start, end - start)
#define flush_icache_user_range(vma, page, addr, len) \
flush_icache_page((vma), (page))
#define flush_icache_page(vma, page) \
__flush_icache_range(page_address(page), PAGE_SIZE)
......
......@@ -42,6 +42,7 @@ extern void paging_init(void);
#define flush_dcache_page(page) do { } while (0)
#define flush_icache_range(start, end) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/*
* The S390 doesn't have any external MMU info: the kernel page
......
......@@ -38,6 +38,7 @@ extern void paging_init(void);
#define flush_dcache_page(page) do { } while (0)
#define flush_icache_range(start, end) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/*
* The S390 doesn't have any external MMU info: the kernel page
......
......@@ -41,6 +41,7 @@ extern void paging_init(void);
#define flush_dcache_page(page) do { } while (0)
#define flush_icache_range(start, end) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
#define flush_cache_sigtramp(vaddr) do { } while (0)
#define p3_cache_init() do { } while (0)
......@@ -64,6 +65,7 @@ extern void flush_cache_sigtramp(unsigned long addr);
#define flush_page_to_ram(page) do { } while (0)
#define flush_icache_page(vma,pg) do { } while (0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/* Initialization of P3 area for copy_user_page */
extern void p3_cache_init(void);
......
......@@ -348,6 +348,7 @@ BTFIXUPDEF_CALL(pte_t *, pte_offset, pmd_t *, unsigned long)
extern unsigned int pg_iobits;
#define flush_icache_page(vma, pg) do { } while(0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/* Certain architectures need to do special things when pte's
* within a page table are directly modified. Thus, the following
......
......@@ -277,6 +277,7 @@ extern pgd_t swapper_pg_dir[1];
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t);
#define flush_icache_page(vma, pg) do { } while(0)
#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
/* Make a non-present pseudo-TTE. */
extern inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space)
......
......@@ -1156,12 +1156,12 @@ const struct usb_device_id *usb_match_id(struct usb_device *dev,
#define PIPE_DEVEP_MASK 0x0007ff00
/* The D0/D1 toggle bits */
#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> ep) & 1)
#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << ep))
#define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << ep)) | ((bit) << ep))
#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
#define usb_settoggle(dev, ep, out, bit) ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | ((bit) << (ep)))
/* Endpoint halt control/status */
#define usb_endpoint_out(ep_dir) (((ep_dir >> 7) & 1) ^ 1)
#define usb_endpoint_out(ep_dir) ((((ep_dir) >> 7) & 1) ^ 1)
#define usb_endpoint_halt(dev, ep, out) ((dev)->halted[out] |= (1 << (ep)))
#define usb_endpoint_running(dev, ep, out) ((dev)->halted[out] &= ~(1 << (ep)))
#define usb_endpoint_halted(dev, ep, out) ((dev)->halted[out] & (1 << (ep)))
......
......@@ -151,7 +151,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
if (write) {
memcpy(maddr + offset, buf, bytes);
flush_page_to_ram(page);
flush_icache_page(vma, page);
flush_icache_user_range(vma, page, addr, bytes);
} else {
memcpy(buf, maddr + offset, bytes);
flush_page_to_ram(page);
......
......@@ -689,7 +689,7 @@ function l_choice () {
# Call awk, and watch for error codes, etc.
#
function callawk () {
awk "$1" || echo "Awk died with error code $?. Giving up." || exit 1
awk "$1" || { echo "Awk died with error code $?. Giving up."; exit 1; }
}
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment