Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

Commit 99bc721

Browse files
committed
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm
Pull ARM fixes from Russell King: "Three fixes and a resulting cleanup for -rc2: - Andre Przywara reported that he was seeing a warning with the new cast inside DMA_ERROR_CODE's definition, and fixed the incorrect use. - Doug Anderson noticed that kgdb causes a "scheduling while atomic" bug. - OMAP5 folk noticed that their Thumb-2 compiled X servers crashed when enabling support to cover ARMv6 CPUs due to a kernel bug leaking some conditional context into the signal handler" * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: ARM: 8425/1: kgdb: Don't try to stop the machine when setting breakpoints ARM: 8437/1: dma-mapping: fix build warning with new DMA_ERROR_CODE definition ARM: get rid of needless #if in signal handling code ARM: fix Thumb2 signal handling when ARMv6 is enabled
2 parents 30ec568 + 7ae85dc commit 99bc721

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

arch/arm/kernel/kgdb.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,17 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
259259
if (err)
260260
return err;
261261

262-
patch_text((void *)bpt->bpt_addr,
263-
*(unsigned int *)arch_kgdb_ops.gdb_bpt_instr);
262+
/* Machine is already stopped, so we can use __patch_text() directly */
263+
__patch_text((void *)bpt->bpt_addr,
264+
*(unsigned int *)arch_kgdb_ops.gdb_bpt_instr);
264265

265266
return err;
266267
}
267268

268269
int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
269270
{
270-
patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr);
271+
/* Machine is already stopped, so we can use __patch_text() directly */
272+
__patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr);
271273

272274
return 0;
273275
}

arch/arm/kernel/signal.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
343343
*/
344344
thumb = handler & 1;
345345

346-
#if __LINUX_ARM_ARCH__ >= 7
347346
/*
348-
* Clear the If-Then Thumb-2 execution state
349-
* ARM spec requires this to be all 000s in ARM mode
350-
* Snapdragon S4/Krait misbehaves on a Thumb=>ARM
351-
* signal transition without this.
347+
* Clear the If-Then Thumb-2 execution state. ARM spec
348+
* requires this to be all 000s in ARM mode. Snapdragon
349+
* S4/Krait misbehaves on a Thumb=>ARM signal transition
350+
* without this.
351+
*
352+
* We must do this whenever we are running on a Thumb-2
353+
* capable CPU, which includes ARMv6T2. However, we elect
354+
* to always do this to simplify the code; this field is
355+
* marked UNK/SBZP for older architectures.
352356
*/
353357
cpsr &= ~PSR_IT_MASK;
354-
#endif
355358

356359
if (thumb) {
357360
cpsr |= PSR_T_BIT;

arch/arm/mm/dma-mapping.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,14 +1249,16 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size)
12491249
struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev);
12501250
unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
12511251
dma_addr_t dma_addr, iova;
1252-
int i, ret = DMA_ERROR_CODE;
1252+
int i;
12531253

12541254
dma_addr = __alloc_iova(mapping, size);
12551255
if (dma_addr == DMA_ERROR_CODE)
12561256
return dma_addr;
12571257

12581258
iova = dma_addr;
12591259
for (i = 0; i < count; ) {
1260+
int ret;
1261+
12601262
unsigned int next_pfn = page_to_pfn(pages[i]) + 1;
12611263
phys_addr_t phys = page_to_phys(pages[i]);
12621264
unsigned int len, j;

0 commit comments

Comments
 (0)