Skip to content

Commit d08c318

Browse files
committed
Merge tag 'powerpc-4.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - TCE table memory calculation fix from Alexey - Build fix for ans-lcd from Luis - Unbalanced IRQ warning fix from Alistair * tag 'powerpc-4.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/eeh-powernv: Fix unbalanced IRQ warning macintosh/ans-lcd: fix build failure after module_init/exit relocation powerpc/powernv/ioda2: Fix calculation for memory allocated for TCE table
2 parents 27667f4 + b8d65e9 commit d08c318

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

arch/powerpc/platforms/powernv/eeh-powernv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ static int pnv_eeh_next_error(struct eeh_pe **pe)
14781478
}
14791479

14801480
/* Unmask the event */
1481-
if (eeh_enabled())
1481+
if (ret == EEH_NEXT_ERR_NONE && eeh_enabled())
14821482
enable_irq(eeh_event_irq);
14831483

14841484
return ret;

arch/powerpc/platforms/powernv/pci-ioda.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,7 +2220,7 @@ static void pnv_pci_ioda_setup_opal_tce_kill(struct pnv_phb *phb)
22202220

22212221
static __be64 *pnv_pci_ioda2_table_do_alloc_pages(int nid, unsigned shift,
22222222
unsigned levels, unsigned long limit,
2223-
unsigned long *current_offset)
2223+
unsigned long *current_offset, unsigned long *total_allocated)
22242224
{
22252225
struct page *tce_mem = NULL;
22262226
__be64 *addr, *tmp;
@@ -2236,6 +2236,7 @@ static __be64 *pnv_pci_ioda2_table_do_alloc_pages(int nid, unsigned shift,
22362236
}
22372237
addr = page_address(tce_mem);
22382238
memset(addr, 0, allocated);
2239+
*total_allocated += allocated;
22392240

22402241
--levels;
22412242
if (!levels) {
@@ -2245,7 +2246,7 @@ static __be64 *pnv_pci_ioda2_table_do_alloc_pages(int nid, unsigned shift,
22452246

22462247
for (i = 0; i < entries; ++i) {
22472248
tmp = pnv_pci_ioda2_table_do_alloc_pages(nid, shift,
2248-
levels, limit, current_offset);
2249+
levels, limit, current_offset, total_allocated);
22492250
if (!tmp)
22502251
break;
22512252

@@ -2267,7 +2268,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
22672268
struct iommu_table *tbl)
22682269
{
22692270
void *addr;
2270-
unsigned long offset = 0, level_shift;
2271+
unsigned long offset = 0, level_shift, total_allocated = 0;
22712272
const unsigned window_shift = ilog2(window_size);
22722273
unsigned entries_shift = window_shift - page_shift;
22732274
unsigned table_shift = max_t(unsigned, entries_shift + 3, PAGE_SHIFT);
@@ -2286,7 +2287,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
22862287

22872288
/* Allocate TCE table */
22882289
addr = pnv_pci_ioda2_table_do_alloc_pages(nid, level_shift,
2289-
levels, tce_table_size, &offset);
2290+
levels, tce_table_size, &offset, &total_allocated);
22902291

22912292
/* addr==NULL means that the first level allocation failed */
22922293
if (!addr)
@@ -2308,7 +2309,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
23082309
page_shift);
23092310
tbl->it_level_size = 1ULL << (level_shift - 3);
23102311
tbl->it_indirect_levels = levels - 1;
2311-
tbl->it_allocated_size = offset;
2312+
tbl->it_allocated_size = total_allocated;
23122313

23132314
pr_devel("Created TCE table: ws=%08llx ts=%lx @%08llx\n",
23142315
window_size, tce_table_size, bus_offset);

drivers/macintosh/ans-lcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <linux/kernel.h>
88
#include <linux/miscdevice.h>
99
#include <linux/fcntl.h>
10-
#include <linux/init.h>
10+
#include <linux/module.h>
1111
#include <linux/delay.h>
1212
#include <linux/fs.h>
1313

0 commit comments

Comments
 (0)