From: Greg Kroah-Hartman Date: Thu, 6 Aug 2009 20:29:46 +0000 (-0700) Subject: more .27 patches X-Git-Tag: v2.6.30.5~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0958e44510ce5e45c94feef1e54c73e01b3e3fa7;p=thirdparty%2Fkernel%2Fstable-queue.git more .27 patches --- diff --git a/queue-2.6.27/firewire-sbp2-add-support-for-disks-2-tb.patch b/queue-2.6.27/firewire-sbp2-add-support-for-disks-2-tb.patch new file mode 100644 index 00000000000..c455e16e5bb --- /dev/null +++ b/queue-2.6.27/firewire-sbp2-add-support-for-disks-2-tb.patch @@ -0,0 +1,56 @@ +From stefanr@s5r6.in-berlin.de Thu Aug 6 13:28:15 2009 +From: Stefan Richter +Date: Wed, 29 Jul 2009 21:27:39 +0200 (CEST) +Subject: firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs) +To: stable@kernel.org +Message-ID: +Content-Disposition: INLINE + +From: Stefan Richter + +Commit af2719415a5ceae06f2a6d33e78b555e64697fc8 upstream. + +Increase the command ORB data structure to transport up to 16 bytes long +CDBs (instead of 12 bytes), and tell the SCSI mid layer about it. This +is notably necessary for READ CAPACITY(16) and friends, i.e. support of +large disks. + +Signed-off-by: Stefan Richter +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firewire/fw-sbp2.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/firewire/fw-sbp2.c ++++ b/drivers/firewire/fw-sbp2.c +@@ -188,6 +188,12 @@ struct sbp2_target { + #define SBP2_RETRY_LIMIT 0xf /* 15 retries */ + #define SBP2_CYCLE_LIMIT (0xc8 << 12) /* 200 125us cycles */ + ++/* ++ * There is no transport protocol limit to the CDB length, but we implement ++ * a fixed length only. 16 bytes is enough for disks larger than 2 TB. ++ */ ++#define SBP2_MAX_CDB_SIZE 16 ++ + /* Unit directory keys */ + #define SBP2_CSR_UNIT_CHARACTERISTICS 0x3a + #define SBP2_CSR_FIRMWARE_REVISION 0x3c +@@ -293,7 +299,7 @@ struct sbp2_command_orb { + struct sbp2_pointer next; + struct sbp2_pointer data_descriptor; + __be32 misc; +- u8 command_block[12]; ++ u8 command_block[SBP2_MAX_CDB_SIZE]; + } request; + struct scsi_cmnd *cmd; + scsi_done_fn_t done; +@@ -1159,6 +1165,8 @@ static int sbp2_probe(struct device *dev + if (fw_device_enable_phys_dma(device) < 0) + goto fail_shost_put; + ++ shost->max_cmd_len = SBP2_MAX_CDB_SIZE; ++ + if (scsi_add_host(shost, &unit->device) < 0) + goto fail_shost_put; + diff --git a/queue-2.6.27/ieee1394-sbp2-add-support-for-disks-2-tb.patch b/queue-2.6.27/ieee1394-sbp2-add-support-for-disks-2-tb.patch new file mode 100644 index 00000000000..340aa719ec0 --- /dev/null +++ b/queue-2.6.27/ieee1394-sbp2-add-support-for-disks-2-tb.patch @@ -0,0 +1,59 @@ +From stefanr@s5r6.in-berlin.de Thu Aug 6 13:28:00 2009 +From: Stefan Richter +Date: Wed, 29 Jul 2009 21:29:13 +0200 (CEST) +Subject: ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs) +To: stable@kernel.org +Message-ID: +Content-Disposition: INLINE + + +From: Stefan Richter + +Commit ebbb16bffa646f853899ef3fdc0ac7abab888703 upstream. + +Increase the command ORB data structure to transport up to 16 bytes long +CDBs (instead of 12 bytes), and tell the SCSI mid layer about it. This +is notably necessary for READ CAPACITY(16) and friends, i.e. support of +large disks. + +Signed-off-by: Stefan Richter +Signed-off-by: Greg Kroah-Hartman +--- + drivers/ieee1394/sbp2.c | 1 + + drivers/ieee1394/sbp2.h | 8 +++++++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +--- a/drivers/ieee1394/sbp2.c ++++ b/drivers/ieee1394/sbp2.c +@@ -874,6 +874,7 @@ static struct sbp2_lu *sbp2_alloc_device + } + + shost->hostdata[0] = (unsigned long)lu; ++ shost->max_cmd_len = SBP2_MAX_CDB_SIZE; + + if (!scsi_add_host(shost, &ud->device)) { + lu->shost = shost; +--- a/drivers/ieee1394/sbp2.h ++++ b/drivers/ieee1394/sbp2.h +@@ -25,6 +25,12 @@ + #define SBP2_DEVICE_NAME "sbp2" + + /* ++ * There is no transport protocol limit to the CDB length, but we implement ++ * a fixed length only. 16 bytes is enough for disks larger than 2 TB. ++ */ ++#define SBP2_MAX_CDB_SIZE 16 ++ ++/* + * SBP-2 specific definitions + */ + +@@ -51,7 +57,7 @@ struct sbp2_command_orb { + u32 data_descriptor_hi; + u32 data_descriptor_lo; + u32 misc; +- u8 cdb[12]; ++ u8 cdb[SBP2_MAX_CDB_SIZE]; + } __attribute__((packed)); + + #define SBP2_LOGIN_REQUEST 0x0 diff --git a/queue-2.6.27/parisc-ensure-broadcast-tlb-purge-runs-single-threaded.patch b/queue-2.6.27/parisc-ensure-broadcast-tlb-purge-runs-single-threaded.patch new file mode 100644 index 00000000000..dfca9c005dd --- /dev/null +++ b/queue-2.6.27/parisc-ensure-broadcast-tlb-purge-runs-single-threaded.patch @@ -0,0 +1,170 @@ +From deller@gmx.de Thu Aug 6 13:25:53 2009 +From: Helge Deller +Date: Wed, 29 Jul 2009 23:17:20 +0200 +Subject: parisc: ensure broadcast tlb purge runs single threaded +To: stable@kernel.org +Message-ID: <4A70BC60.5040103@gmx.de> + +From: Helge Deller + +commit e82a3b75127188f20c7780bec580e148beb29da7 upstream + +parisc: ensure broadcast tlb purge runs single threaded +The TLB flushing functions on hppa, which causes PxTLB broadcasts on the system +bus, needs to be protected by irq-safe spinlocks to avoid irq handlers to deadlock +the kernel. The deadlocks only happened during I/O intensive loads and triggered +pretty seldom, which is why this bug went so long unnoticed. + +Signed-off-by: Helge Deller +[edited to use spin_lock_irqsave on UP as well since we'd been locking there + all this time anyway, --kyle] +Signed-off-by: Kyle McMartin +Signed-off-by: Greg Kroah-Hartman + +--- + arch/parisc/kernel/cache.c | 23 +++++++++++++++-------- + arch/parisc/kernel/pci-dma.c | 12 ++++++++---- + include/asm-parisc/tlbflush.h | 13 ++++++------- + 3 files changed, 29 insertions(+), 19 deletions(-) + +--- a/arch/parisc/kernel/cache.c ++++ b/arch/parisc/kernel/cache.c +@@ -398,12 +398,13 @@ EXPORT_SYMBOL(flush_kernel_icache_range_ + + void clear_user_page_asm(void *page, unsigned long vaddr) + { ++ unsigned long flags; + /* This function is implemented in assembly in pacache.S */ + extern void __clear_user_page_asm(void *page, unsigned long vaddr); + +- purge_tlb_start(); ++ purge_tlb_start(flags); + __clear_user_page_asm(page, vaddr); +- purge_tlb_end(); ++ purge_tlb_end(flags); + } + + #define FLUSH_THRESHOLD 0x80000 /* 0.5MB */ +@@ -444,20 +445,24 @@ extern void clear_user_page_asm(void *pa + + void clear_user_page(void *page, unsigned long vaddr, struct page *pg) + { ++ unsigned long flags; ++ + purge_kernel_dcache_page((unsigned long)page); +- purge_tlb_start(); ++ purge_tlb_start(flags); + pdtlb_kernel(page); +- purge_tlb_end(); ++ purge_tlb_end(flags); + clear_user_page_asm(page, vaddr); + } + EXPORT_SYMBOL(clear_user_page); + + void flush_kernel_dcache_page_addr(void *addr) + { ++ unsigned long flags; ++ + flush_kernel_dcache_page_asm(addr); +- purge_tlb_start(); ++ purge_tlb_start(flags); + pdtlb_kernel(addr); +- purge_tlb_end(); ++ purge_tlb_end(flags); + } + EXPORT_SYMBOL(flush_kernel_dcache_page_addr); + +@@ -490,8 +495,10 @@ void __flush_tlb_range(unsigned long sid + if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ + flush_tlb_all(); + else { ++ unsigned long flags; ++ + mtsp(sid, 1); +- purge_tlb_start(); ++ purge_tlb_start(flags); + if (split_tlb) { + while (npages--) { + pdtlb(start); +@@ -504,7 +511,7 @@ void __flush_tlb_range(unsigned long sid + start += PAGE_SIZE; + } + } +- purge_tlb_end(); ++ purge_tlb_end(flags); + } + } + +--- a/arch/parisc/kernel/pci-dma.c ++++ b/arch/parisc/kernel/pci-dma.c +@@ -90,12 +90,14 @@ static inline int map_pte_uncached(pte_t + if (end > PMD_SIZE) + end = PMD_SIZE; + do { ++ unsigned long flags; ++ + if (!pte_none(*pte)) + printk(KERN_ERR "map_pte_uncached: page already exists\n"); + set_pte(pte, __mk_pte(*paddr_ptr, PAGE_KERNEL_UNC)); +- purge_tlb_start(); ++ purge_tlb_start(flags); + pdtlb_kernel(orig_vaddr); +- purge_tlb_end(); ++ purge_tlb_end(flags); + vaddr += PAGE_SIZE; + orig_vaddr += PAGE_SIZE; + (*paddr_ptr) += PAGE_SIZE; +@@ -168,11 +170,13 @@ static inline void unmap_uncached_pte(pm + if (end > PMD_SIZE) + end = PMD_SIZE; + do { ++ unsigned long flags; ++ + pte_t page = *pte; + pte_clear(&init_mm, vaddr, pte); +- purge_tlb_start(); ++ purge_tlb_start(flags); + pdtlb_kernel(orig_vaddr); +- purge_tlb_end(); ++ purge_tlb_end(flags); + vaddr += PAGE_SIZE; + orig_vaddr += PAGE_SIZE; + pte++; +--- a/include/asm-parisc/tlbflush.h ++++ b/include/asm-parisc/tlbflush.h +@@ -12,14 +12,12 @@ + * N class systems, only one PxTLB inter processor broadcast can be + * active at any one time on the Merced bus. This tlb purge + * synchronisation is fairly lightweight and harmless so we activate +- * it on all SMP systems not just the N class. We also need to have +- * preemption disabled on uniprocessor machines, and spin_lock does that +- * nicely. ++ * it on all systems not just the N class. + */ + extern spinlock_t pa_tlb_lock; + +-#define purge_tlb_start(x) spin_lock(&pa_tlb_lock) +-#define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) ++#define purge_tlb_start(flags) spin_lock_irqsave(&pa_tlb_lock, flags) ++#define purge_tlb_end(flags) spin_unlock_irqrestore(&pa_tlb_lock, flags) + + extern void flush_tlb_all(void); + extern void flush_tlb_all_local(void *); +@@ -63,14 +61,15 @@ static inline void flush_tlb_mm(struct m + static inline void flush_tlb_page(struct vm_area_struct *vma, + unsigned long addr) + { ++ unsigned long flags; + /* For one page, it's not worth testing the split_tlb variable */ + + mb(); + mtsp(vma->vm_mm->context,1); +- purge_tlb_start(); ++ purge_tlb_start(flags); + pdtlb(addr); + pitlb(addr); +- purge_tlb_end(); ++ purge_tlb_end(flags); + } + + void __flush_tlb_range(unsigned long sid, diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 36bd48267ca..8da0913a317 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -8,3 +8,6 @@ sysfs-fix-hardlink-count-on-device_move.patch thinkpad-acpi-disable-broken-bay-and-dock-subdrivers.patch usb-storage-raise-timeout-in-usb_stor_bulk_max_lun.patch x86-fix-assembly-constraints-in-native_save_fl.patch +parisc-ensure-broadcast-tlb-purge-runs-single-threaded.patch +ieee1394-sbp2-add-support-for-disks-2-tb.patch +firewire-sbp2-add-support-for-disks-2-tb.patch