]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/sn/kernel/bte.c
[IA64] remove unused acpi_kbd_controller_present, acpi_legacy_devices
[linux-2.6-omap-h63xx.git] / arch / ia64 / sn / kernel / bte.c
index 7adef84190dbc922e149cf285f34b5cfa8aede78..7f73ad4408aaee3ad8977ad1ef2d1a89302cfbe5 100644 (file)
@@ -3,10 +3,9 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <asm/sn/nodepda.h>
 #include <asm/sn/addrs.h>
@@ -36,7 +35,7 @@ static struct bteinfo_s *bte_if_on_node(nasid_t nasid, int interface)
        nodepda_t *tmp_nodepda;
 
        if (nasid_to_cnodeid(nasid) == -1)
-               return (struct bteinfo_s *)NULL;;
+               return (struct bteinfo_s *)NULL;
 
        tmp_nodepda = NODEPDA(nasid_to_cnodeid(nasid));
        return &tmp_nodepda->bte_if[interface];
@@ -87,7 +86,7 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
        unsigned long irq_flags;
        unsigned long itc_end = 0;
        int nasid_to_try[MAX_NODES_TO_TRY];
-       int my_nasid = get_nasid();
+       int my_nasid = cpuid_to_nasid(raw_smp_processor_id());
        int bte_if_index, nasid_index;
        int bte_first, btes_per_node = BTES_PER_NODE;
 
@@ -105,7 +104,7 @@ bte_result_t bte_copy(u64 src, u64 dest, u64 len, u64 mode, void *notification)
        /*
         * Start with interface corresponding to cpu number
         */
-       bte_first = get_cpu() % btes_per_node;
+       bte_first = raw_smp_processor_id() % btes_per_node;
 
        if (mode & BTE_USE_DEST) {
                /* try remote then local */
@@ -137,6 +136,7 @@ retry_bteop:
                        bte = bte_if_on_node(nasid_to_try[nasid_index],bte_if_index);
 
                        if (bte == NULL) {
+                               nasid_index++;
                                continue;
                        }
 
@@ -185,18 +185,13 @@ retry_bteop:
 
        /* Initialize the notification to a known value. */
        *bte->most_rcnt_na = BTE_WORD_BUSY;
-       notif_phys_addr = TO_PHYS(ia64_tpa((unsigned long)bte->most_rcnt_na));
+       notif_phys_addr = (u64)bte->most_rcnt_na;
 
-       if (is_shub2()) {
-               src = SH2_TIO_PHYS_TO_DMA(src);
-               dest = SH2_TIO_PHYS_TO_DMA(dest);
-               notif_phys_addr = SH2_TIO_PHYS_TO_DMA(notif_phys_addr);
-       }
        /* Set the source and destination registers */
-       BTE_PRINTKV(("IBSA = 0x%lx)\n", (TO_PHYS(src))));
-       BTE_SRC_STORE(bte, TO_PHYS(src));
-       BTE_PRINTKV(("IBDA = 0x%lx)\n", (TO_PHYS(dest))));
-       BTE_DEST_STORE(bte, TO_PHYS(dest));
+       BTE_PRINTKV(("IBSA = 0x%lx)\n", src));
+       BTE_SRC_STORE(bte, src);
+       BTE_PRINTKV(("IBDA = 0x%lx)\n", dest));
+       BTE_DEST_STORE(bte, dest);
 
        /* Set the notification register */
        BTE_PRINTKV(("IBNA = 0x%lx)\n", notif_phys_addr));
@@ -215,6 +210,7 @@ retry_bteop:
        }
 
        while ((transfer_stat = *bte->most_rcnt_na) == BTE_WORD_BUSY) {
+               cpu_relax();
                if (ia64_get_itc() > itc_end) {
                        BTE_PRINTK(("BTE timeout nasid 0x%x bte%d IBLS = 0x%lx na 0x%lx\n",
                                NASID_GET(bte->bte_base_addr), bte->bte_num,
@@ -281,8 +277,7 @@ bte_result_t bte_unaligned_copy(u64 src, u64 dest, u64 len, u64 mode)
        }
 
        /* temporary buffer used during unaligned transfers */
-       bteBlock_unaligned = kmalloc(len + 3 * L1_CACHE_BYTES,
-                                    GFP_KERNEL | GFP_DMA);
+       bteBlock_unaligned = kmalloc(len + 3 * L1_CACHE_BYTES, GFP_KERNEL);
        if (bteBlock_unaligned == NULL) {
                return BTEFAIL_NOTAVAIL;
        }