Skip to content

Commit

Permalink
Merge tag 'v4.4.276' into android-msm-wahoo-4.4
Browse files Browse the repository at this point in the history
This is the 4.4.276 stable release

# gpg: Signature made Tue Jul 20 17:23:10 2021 EEST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Good signature from "Greg Kroah-Hartman <[email protected]>" [full]
# gpg: [email protected]: Verified 26 signatures in the past 2 hours.  Encrypted
#      0 messages.

# By Zhen Lei (10) and others
# Via Greg Kroah-Hartman
* tag 'v4.4.276':
  Linux 4.4.276
  seq_file: disallow extremely large seq buffer allocations
  MIPS: vdso: Invalid GIC access through VDSO
  mips: disable branch profiling in boot/decompress.o
  scsi: be2iscsi: Fix an error handling path in beiscsi_dev_probe()
  memory: fsl_ifc: fix leak of private memory on probe failure
  memory: fsl_ifc: fix leak of IO mapping on probe failure
  rtc: fix snprintf() checking in is_rtc_hctosys()
  ARM: dts: exynos: fix PWM LED max brightness on Odroid XU4
  hexagon: use common DISCARDS macro
  ALSA: isa: Fix error return code in snd_cmi8330_probe()
  nfs: fix acl memory leak of posix_acl_create()
  um: fix error return code in winch_tramp()
  um: fix error return code in slip_open()
  PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun
  virtio_console: Assure used length from device is limited
  virtio-blk: Fix memory leak among suspend/resume procedure
  power: supply: ab8500: add missing MODULE_DEVICE_TABLE
  power: supply: charger-manager: add missing MODULE_DEVICE_TABLE
  ceph: remove bogus checks and WARN_ONs from ceph_set_page_dirty
  watchdog: Fix possible use-after-free by calling del_timer_sync()
  watchdog: sc520_wdt: Fix possible use-after-free in wdt_turnoff()
  watchdog: Fix possible use-after-free in wdt_startup()
  ARM: 9087/1: kprobes: test-thumb: fix for LLVM_IAS=1
  power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE
  power: supply: ab8500: Avoid NULL pointers
  pwm: spear: Don't modify HW state in .remove callback
  lib/decompress_unlz4.c: correctly handle zero-padding around initrds.
  ALSA: hda: Add IRQ check for platform_get_irq()
  backlight: lm3630a: Fix return code of .update_status() callback
  powerpc/boot: Fixup device-tree on little endian
  usb: gadget: hid: fix error return code in hid_bind()
  usb: gadget: f_hid: fix endianness issue with descriptors
  ALSA: bebob: add support for ToneWeal FW66
  ASoC: soc-core: Fix the error return code in snd_soc_of_parse_audio_routing()
  selftests/powerpc: Fix "no_handler" EBB selftest
  ALSA: ppc: fix error return code in snd_pmac_probe()
  gpio: zynq: Check return value of pm_runtime_get_sync
  powerpc/ps3: Add dma_mask to ps3_dma_region
  ALSA: sb: Fix potential double-free of CSP mixer elements
  mfd: da9052/stmpe: Add and modify MODULE_DEVICE_TABLE
  scsi: iscsi: Add iscsi_cls_conn refcount helpers
  fs/jfs: Fix missing error code in lmLogInit()
  tty: serial: 8250: serial_cs: Fix a memory leak in error handling path
  scsi: lpfc: Fix "Unexpected timeout" error in direct attach topology
  Revert "ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro"
  misc/libmasm/module: Fix two use after free in ibmasm_init_one
  tty: serial: fsl_lpuart: fix the potential risk of division or modulo by zero
  KVM: X86: Disable hardware breakpoints unconditionally before kvm_x86->run()
  KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled
  jfs: fix GPF in diFree
  media: uvcvideo: Fix pixel format change for Elgato Cam Link 4K
  media: gspca/sunplus: fix zero-length control requests
  media: gspca/sq905: fix control-request direction
  media: zr364xx: fix memory leak in zr364xx_start_readpipe
  dm btree remove: assign new_root only when removal succeeds
  ipack/carriers/tpci200: Fix a double free in tpci200_pci_probe
  seq_buf: Fix overflow in seq_buf_putmem_hex()
  power: supply: ab8500: Fix an old bug
  ipmi/watchdog: Stop watchdog timer when the current action is 'none'
  ASoC: tegra: Set driver_name=tegra for all machine drivers
  ata: ahci_sunxi: Disable DIPM
  mmc: sdhci: Fix warning message when accessing RPMB in HS400 mode
  powerpc/barrier: Avoid collision with clang's __lwsync macro
  mac80211: fix memory corruption in EAPOL handling
  can: bcm: delay release of struct bcm_op after synchronize_rcu()
  can: gw: synchronize rcu operations before removing gw job entry
  fuse: reject internal errno
  sctp: add size validation when walking chunks
  Bluetooth: btusb: fix bt fiwmare downloading failure issue for qca btsoc.
  Bluetooth: Shutdown controller after workqueues are flushed or cancelled
  Bluetooth: Fix the HCI to MGMT status conversion table
  RDMA/cma: Fix rdma_resolve_route() memory leak
  wireless: wext-spy: Fix out-of-bounds warning
  sfc: error code if SRIOV cannot be disabled
  sfc: avoid double pci_remove of VFs
  atm: nicstar: register the interrupt handler in the right place
  atm: nicstar: use 'dma_free_coherent' instead of 'kfree'
  cw1200: add missing MODULE_DEVICE_TABLE
  wl1251: Fix possible buffer overflow in wl1251_cmd_scan
  wlcore/wl12xx: Fix wl12xx get_mac error if device is in ELP
  xfrm: Fix error reporting in xfrm_state_construct.
  selinux: use __GFP_NOWARN with GFP_NOWAIT in the AVC
  net: micrel: check return value after calling platform_get_resource()
  dm space maps: don't reset space map allocation cursor when committing
  RDMA/cxgb4: Fix missing error code in create_qp()
  ipv6: use prandom_u32() for ID generation
  e100: handle eeprom as little endian
  udf: Fix NULL pointer dereference in udf_symlink function
  drm/virtio: Fix double free on probe failure
  reiserfs: add check for invalid 1st journal block
  net: Treat __napi_schedule_irqoff() as __napi_schedule() on PREEMPT_RT
  atm: nicstar: Fix possible use-after-free in nicstar_cleanup()
  mISDN: fix possible use-after-free in HFC_cleanup()
  atm: iphase: fix possible use-after-free in ia_module_exit()
  hugetlb: clear huge pte during flush function on mips platform
  net: pch_gbe: Use proper accessors to BE data in pch_ptp_match()
  scsi: core: Retry I/O for Notify (Enable Spinup) Required error
  mmc: vub3000: fix control-request direction
  extcon: max8997: Add missing modalias string
  extcon: sm5502: Drop invalid register write in sm5502_reg_data
  phy: ti: dm816x: Fix the error handling path in 'dm816x_usb_phy_probe()
  scsi: mpt3sas: Fix error return value in _scsih_expander_add()
  staging: gdm724x: check for overflow in gdm_lte_netif_rx()
  staging: gdm724x: check for buffer overflow in gdm_lte_multi_sdu_pkt()
  s390: appldata depends on PROC_SYSCTL
  scsi: FlashPoint: Rename si_flags field
  tty: nozomi: Fix the error handling path of 'nozomi_card_init()'
  char: pcmcia: error out if 'num_bytes_read' is greater than 4 in set_protocol()
  Input: hil_kbd - fix error return code in hil_dev_connect()
  iio: accel: stk8ba50: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: accel: stk8312: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: accel: bma180: Fix buffer alignment in iio_push_to_buffers_with_timestamp()
  iio: adis_buffer: do not return ints in irq handlers
  tty: nozomi: Fix a resource leak in an error handling function
  writeback: fix obtain a reference to a freeing memcg css
  i40e: Fix error handling in i40e_vsi_open
  vxlan: add missing rcu_read_lock() in neigh_reduce()
  net: ethernet: ezchip: fix error handling
  net: ethernet: ezchip: fix UAF in nps_enet_remove
  net: ethernet: aeroflex: fix UAF in greth_of_remove
  netfilter: nft_exthdr: check for IPv6 packet before further processing
  netlabel: Fix memory leak in netlbl_mgmt_add_common
  ath10k: Fix an error code in ath10k_add_interface()
  brcmsmac: mac80211_if: Fix a resource leak in an error handling path
  wireless: carl9170: fix LEDS build errors & warnings
  drm: qxl: ensure surf.data is ininitialized
  ehea: fix error return code in ehea_restart_qps()
  net: pch_gbe: Propagate error from devm_gpio_request_one()
  ACPI: sysfs: Fix a buffer overrun problem with description_show()
  crypto: nx - Fix RCU warning in nx842_OF_upd_status
  spi: spi-sun6i: Fix chipselect/clock bug
  media: s5p-g2d: Fix a memory leak on ctx->fh.m2m_ctx
  mmc: usdhi6rol0: fix error return code in usdhi6_probe()
  media: siano: Fix out-of-bounds warnings in smscore_load_firmware_family2()
  media: tc358743: Fix error return code in tc358743_probe_of()
  pata_ep93xx: fix deferred probing
  pata_octeon_cf: avoid WARN_ON() in ata_host_activate()
  media: I2C: change 'RST' to "RSET" to fix multiple build errors
  pata_rb532_cf: fix deferred probing
  sata_highbank: fix deferred probing
  crypto: ux500 - Fix error return code in hash_hw_final()
  crypto: ixp4xx - dma_unmap the correct address
  ia64: mca_drv: fix incorrect array size calculation
  platform/x86: toshiba_acpi: Fix missing error code in toshiba_acpi_setup_keyboard()
  ACPI: bus: Call kobject_put() in acpi_init() error path
  random32: Fix implicit truncation warning in prandom_seed_state()
  fs: dlm: cancel work sync othercon
  block_dump: remove block_dump feature in mark_inode_dirty()
  ACPI: processor idle: Fix up C-state latency if not ordered
  regulator: da9052: Ensure enough delay time for .set_voltage_time_sel
  btrfs: disable build on platforms having page size 256K
  media: dvb_net: avoid speculation from net slot
  crypto: shash - avoid comparing pointers to exported functions under CFI
  mmc: via-sdmmc: add a check against NULL pointer dereference
  media: bt8xx: Fix a missing check bug in bt878_probe
  media: v4l2-core: Avoid the dangling pointer in v4l2_fh_release
  crypto: qat - remove unused macro in FW loader
  crypto: qat - check return code of qat_hal_rd_rel_reg()
  media: pvrusb2: fix warning in pvr2_i2c_core_done
  media: cpia2: fix memory leak in cpia2_usb_probe
  crypto: nx - add missing MODULE_DEVICE_TABLE
  spi: omap-100k: Fix the length judgment problem
  spi: spi-topcliff-pch: Fix potential double free in pch_spi_process_messages()
  fuse: check connected before queueing on fpq->io
  seq_buf: Make trace_seq_putmem_hex() support data longer than 8
  ssb: sdio: Don't overwrite const buffer if block_write fails
  ath9k: Fix kernel NULL pointer dereference during ath_reset_internal()
  serial_cs: Add Option International GSM-Ready 56K/ISDN modem
  iio: ltr501: ltr501_read_ps(): add missing endianness conversion
  iio: ltr501: ltr559: fix initialization of LTR501_ALS_CONTR
  iio: ltr501: mark register holding upper 8 bits of ALS_DATA{0,1} and PS_DATA as volatile, too
  s390/cio: dont call css_wait_for_slow_path() inside a lock
  SUNRPC: Should wake up the privileged task firstly.
  SUNRPC: Fix the batch tasks count wraparound.
  ext4: fix avefreec in find_group_orlov
  ext4: remove check for zero nr_to_scan in ext4_es_scan()
  ext4: correct the cache_nr in tracepoint ext4_es_shrink_exit
  ext4: fix kernel infoleak via ext4_extent_header
  btrfs: clear defrag status of a root if starting transaction fails
  ARM: dts: at91: sama5d4: fix pinctrl muxing
  Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl
  iov_iter_fault_in_readable() should do nothing in xarray case
  ntfs: fix validity check for file name attribute
  USB: cdc-acm: blacklist Heimann USB Appset device
  usb: gadget: eem: fix echo command packet response issue
  net: can: ems_usb: fix use-after-free in ems_usb_disconnect()
  Input: usbtouchscreen - fix control-request directions
  media: dvb-usb: fix wrong definition
  ALSA: usb-audio: fix rate on Ozone Z90 USB headset

 Conflicts:
	fs/fs-writeback.c

Change-Id: I0289ec1f34d8d56baf317d7360b17b3fbd1ad164
  • Loading branch information
mikeNG committed Jul 24, 2021
2 parents 6ddb471 + eaf05d4 commit d8f10da
Show file tree
Hide file tree
Showing 199 changed files with 894 additions and 452 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 4
SUBLEVEL = 275
SUBLEVEL = 276
EXTRAVERSION =
NAME = Blurry Fish Butt

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/exynos5422-odroidxu4.dts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
label = "blue:heartbeat";
pwms = <&pwm 2 2000000 0>;
pwm-names = "pwm2";
max_brightness = <255>;
max-brightness = <255>;
linux,default-trigger = "heartbeat";
};
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/sama5d4.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@
0xffffffff 0x3ffcfe7c 0x1c010101 /* pioA */
0x7fffffff 0xfffccc3a 0x3f00cc3a /* pioB */
0xffffffff 0x3ff83fff 0xff00ffff /* pioC */
0x0003ff00 0x8002a800 0x00000000 /* pioD */
0xb003ff00 0x8002a800 0x00000000 /* pioD */
0xffffffff 0x7fffffff 0x76fff1bf /* pioE */
>;

Expand Down
10 changes: 5 additions & 5 deletions arch/arm/probes/kprobes/test-thumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,21 @@ void kprobe_thumb32_test_cases(void)
"3: mvn r0, r0 \n\t"
"2: nop \n\t")

TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,"]",
TEST_RX("tbh [pc, r",7, (9f-(1f+4))>>1,", lsl #1]",
"9: \n\t"
".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t"
"3: mvn r0, r0 \n\t"
"2: nop \n\t")

TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,"]",
TEST_RX("tbh [pc, r",12, ((9f-(1f+4))>>1)+1,", lsl #1]",
"9: \n\t"
".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t"
"3: mvn r0, r0 \n\t"
"2: nop \n\t")

TEST_RRX("tbh [r",1,9f, ", r",14,1,"]",
TEST_RRX("tbh [r",1,9f, ", r",14,1,", lsl #1]",
"9: \n\t"
".short (2f-1b-4)>>1 \n\t"
".short (3f-1b-4)>>1 \n\t"
Expand All @@ -471,10 +471,10 @@ void kprobe_thumb32_test_cases(void)

TEST_UNSUPPORTED("strexb r0, r1, [r2]")
TEST_UNSUPPORTED("strexh r0, r1, [r2]")
TEST_UNSUPPORTED("strexd r0, r1, [r2]")
TEST_UNSUPPORTED("strexd r0, r1, r2, [r2]")
TEST_UNSUPPORTED("ldrexb r0, [r1]")
TEST_UNSUPPORTED("ldrexh r0, [r1]")
TEST_UNSUPPORTED("ldrexd r0, [r1]")
TEST_UNSUPPORTED("ldrexd r0, r1, [r1]")

TEST_GROUP("Data-processing (shifted register) and (modified immediate)")

Expand Down
7 changes: 1 addition & 6 deletions arch/hexagon/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,8 @@ SECTIONS

_end = .;

/DISCARD/ : {
EXIT_TEXT
EXIT_DATA
EXIT_CALL
}

STABS_DEBUG
DWARF_DEBUG

DISCARDS
}
2 changes: 1 addition & 1 deletion arch/ia64/kernel/mca_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ init_record_index_pools(void)

/* - 2 - */
sect_min_size = sal_log_sect_min_sizes[0];
for (i = 1; i < sizeof sal_log_sect_min_sizes/sizeof(size_t); i++)
for (i = 1; i < ARRAY_SIZE(sal_log_sect_min_sizes); i++)
if (sect_min_size > sal_log_sect_min_sizes[i])
sect_min_size = sal_log_sect_min_sizes[i];

Expand Down
2 changes: 2 additions & 0 deletions arch/mips/boot/compressed/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* option) any later version.
*/

#define DISABLE_BRANCH_PROFILING

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
Expand Down
8 changes: 7 additions & 1 deletion arch/mips/include/asm/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep)
{
flush_tlb_page(vma, addr & huge_page_mask(hstate_vma(vma)));
/*
* clear the huge pte entry firstly, so that the other smp threads will
* not get old pte entry after finishing flush_tlb_page and before
* setting new huge pte entry
*/
huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
flush_tlb_page(vma, addr);
}

static inline int huge_pte_none(pte_t pte)
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/vdso/vdso.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static inline const union mips_vdso_data *get_vdso_data(void)

static inline void __iomem *get_gic(const union mips_vdso_data *data)
{
return (void __iomem *)data - PAGE_SIZE;
return (void __iomem *)((unsigned long)data & PAGE_MASK) - PAGE_SIZE;
}

#endif /* CONFIG_CLKSRC_MIPS_GIC */
Expand Down
59 changes: 34 additions & 25 deletions arch/powerpc/boot/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "string.h"
#include "stdio.h"
#include "ops.h"
#include "of.h"

void dt_fixup_memory(u64 start, u64 size)
{
Expand All @@ -27,31 +28,35 @@ void dt_fixup_memory(u64 start, u64 size)
root = finddevice("/");
if (getprop(root, "#address-cells", &naddr, sizeof(naddr)) < 0)
naddr = 2;
else
naddr = be32_to_cpu(naddr);
if (naddr < 1 || naddr > 2)
fatal("Can't cope with #address-cells == %d in /\n\r", naddr);

if (getprop(root, "#size-cells", &nsize, sizeof(nsize)) < 0)
nsize = 1;
else
nsize = be32_to_cpu(nsize);
if (nsize < 1 || nsize > 2)
fatal("Can't cope with #size-cells == %d in /\n\r", nsize);

i = 0;
if (naddr == 2)
memreg[i++] = start >> 32;
memreg[i++] = start & 0xffffffff;
memreg[i++] = cpu_to_be32(start >> 32);
memreg[i++] = cpu_to_be32(start & 0xffffffff);
if (nsize == 2)
memreg[i++] = size >> 32;
memreg[i++] = size & 0xffffffff;
memreg[i++] = cpu_to_be32(size >> 32);
memreg[i++] = cpu_to_be32(size & 0xffffffff);

memory = finddevice("/memory");
if (! memory) {
memory = create_node(NULL, "memory");
setprop_str(memory, "device_type", "memory");
}

printf("Memory <- <0x%x", memreg[0]);
printf("Memory <- <0x%x", be32_to_cpu(memreg[0]));
for (i = 1; i < (naddr + nsize); i++)
printf(" 0x%x", memreg[i]);
printf(" 0x%x", be32_to_cpu(memreg[i]));
printf("> (%ldMB)\n\r", (unsigned long)(size >> 20));

setprop(memory, "reg", memreg, (naddr + nsize)*sizeof(u32));
Expand All @@ -69,10 +74,10 @@ void dt_fixup_cpu_clocks(u32 cpu, u32 tb, u32 bus)
printf("CPU bus-frequency <- 0x%x (%dMHz)\n\r", bus, MHZ(bus));

while ((devp = find_node_by_devtype(devp, "cpu"))) {
setprop_val(devp, "clock-frequency", cpu);
setprop_val(devp, "timebase-frequency", tb);
setprop_val(devp, "clock-frequency", cpu_to_be32(cpu));
setprop_val(devp, "timebase-frequency", cpu_to_be32(tb));
if (bus > 0)
setprop_val(devp, "bus-frequency", bus);
setprop_val(devp, "bus-frequency", cpu_to_be32(bus));
}

timebase_period_ns = 1000000000 / tb;
Expand All @@ -84,7 +89,7 @@ void dt_fixup_clock(const char *path, u32 freq)

if (devp) {
printf("%s: clock-frequency <- %x (%dMHz)\n\r", path, freq, MHZ(freq));
setprop_val(devp, "clock-frequency", freq);
setprop_val(devp, "clock-frequency", cpu_to_be32(freq));
}
}

Expand Down Expand Up @@ -137,8 +142,12 @@ void dt_get_reg_format(void *node, u32 *naddr, u32 *nsize)
{
if (getprop(node, "#address-cells", naddr, 4) != 4)
*naddr = 2;
else
*naddr = be32_to_cpu(*naddr);
if (getprop(node, "#size-cells", nsize, 4) != 4)
*nsize = 1;
else
*nsize = be32_to_cpu(*nsize);
}

static void copy_val(u32 *dest, u32 *src, int naddr)
Expand Down Expand Up @@ -167,9 +176,9 @@ static int add_reg(u32 *reg, u32 *add, int naddr)
int i, carry = 0;

for (i = MAX_ADDR_CELLS - 1; i >= MAX_ADDR_CELLS - naddr; i--) {
u64 tmp = (u64)reg[i] + add[i] + carry;
u64 tmp = (u64)be32_to_cpu(reg[i]) + be32_to_cpu(add[i]) + carry;
carry = tmp >> 32;
reg[i] = (u32)tmp;
reg[i] = cpu_to_be32((u32)tmp);
}

return !carry;
Expand All @@ -184,18 +193,18 @@ static int compare_reg(u32 *reg, u32 *range, u32 *rangesize)
u32 end;

for (i = 0; i < MAX_ADDR_CELLS; i++) {
if (reg[i] < range[i])
if (be32_to_cpu(reg[i]) < be32_to_cpu(range[i]))
return 0;
if (reg[i] > range[i])
if (be32_to_cpu(reg[i]) > be32_to_cpu(range[i]))
break;
}

for (i = 0; i < MAX_ADDR_CELLS; i++) {
end = range[i] + rangesize[i];
end = be32_to_cpu(range[i]) + be32_to_cpu(rangesize[i]);

if (reg[i] < end)
if (be32_to_cpu(reg[i]) < end)
break;
if (reg[i] > end)
if (be32_to_cpu(reg[i]) > end)
return 0;
}

Expand Down Expand Up @@ -244,7 +253,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
return 0;

dt_get_reg_format(parent, &naddr, &nsize);

if (nsize > 2)
return 0;

Expand All @@ -256,10 +264,10 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,

copy_val(last_addr, prop_buf + offset, naddr);

ret_size = prop_buf[offset + naddr];
ret_size = be32_to_cpu(prop_buf[offset + naddr]);
if (nsize == 2) {
ret_size <<= 32;
ret_size |= prop_buf[offset + naddr + 1];
ret_size |= be32_to_cpu(prop_buf[offset + naddr + 1]);
}

for (;;) {
Expand All @@ -282,7 +290,6 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,

offset = find_range(last_addr, prop_buf, prev_naddr,
naddr, prev_nsize, buflen / 4);

if (offset < 0)
return 0;

Expand All @@ -300,8 +307,7 @@ static int dt_xlate(void *node, int res, int reglen, unsigned long *addr,
if (naddr > 2)
return 0;

ret_addr = ((u64)last_addr[2] << 32) | last_addr[3];

ret_addr = ((u64)be32_to_cpu(last_addr[2]) << 32) | be32_to_cpu(last_addr[3]);
if (sizeof(void *) == 4 &&
(ret_addr >= 0x100000000ULL || ret_size > 0x100000000ULL ||
ret_addr + ret_size > 0x100000000ULL))
Expand Down Expand Up @@ -354,11 +360,14 @@ int dt_is_compatible(void *node, const char *compat)
int dt_get_virtual_reg(void *node, void **addr, int nres)
{
unsigned long xaddr;
int n;
int n, i;

n = getprop(node, "virtual-reg", addr, nres * 4);
if (n > 0)
if (n > 0) {
for (i = 0; i < n/4; i ++)
((u32 *)addr)[i] = be32_to_cpu(((u32 *)addr)[i]);
return n / 4;
}

for (n = 0; n < nres; n++) {
if (!dt_xlate_reg(node, n, &xaddr, NULL))
Expand Down
9 changes: 7 additions & 2 deletions arch/powerpc/boot/ns16550.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "stdio.h"
#include "io.h"
#include "ops.h"
#include "of.h"

#define UART_DLL 0 /* Out: Divisor Latch Low */
#define UART_DLM 1 /* Out: Divisor Latch High */
Expand Down Expand Up @@ -57,16 +58,20 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp)
int n;
u32 reg_offset;

if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1)
if (dt_get_virtual_reg(devp, (void **)&reg_base, 1) < 1) {
printf("virt reg parse fail...\r\n");
return -1;
}

n = getprop(devp, "reg-offset", &reg_offset, sizeof(reg_offset));
if (n == sizeof(reg_offset))
reg_base += reg_offset;
reg_base += be32_to_cpu(reg_offset);

n = getprop(devp, "reg-shift", &reg_shift, sizeof(reg_shift));
if (n != sizeof(reg_shift))
reg_shift = 0;
else
reg_shift = be32_to_cpu(reg_shift);

scdp->open = ns16550_open;
scdp->putc = ns16550_putc;
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
# define SMPWMB eieio
#endif

/* clang defines this macro for a builtin, which will not work with runtime patching */
#undef __lwsync
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
#define dma_rmb() __lwsync()
#define dma_wmb() __asm__ __volatile__ (stringify_in_c(SMPWMB) : : :"memory")
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/include/asm/ps3.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct ps3_dma_region_ops;
* @bus_addr: The 'translated' bus address of the region.
* @len: The length in bytes of the region.
* @offset: The offset from the start of memory of the region.
* @dma_mask: Device dma_mask.
* @ioid: The IOID of the device who owns this region
* @chunk_list: Opaque variable used by the ioc page manager.
* @region_ops: struct ps3_dma_region_ops - dma region operations
Expand All @@ -97,6 +98,7 @@ struct ps3_dma_region {
enum ps3_dma_region_type region_type;
unsigned long len;
unsigned long offset;
u64 dma_mask;

/* driver variables (set by ps3_dma_region_create) */
unsigned long bus_addr;
Expand Down
12 changes: 12 additions & 0 deletions arch/powerpc/platforms/ps3/mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/memblock.h>
Expand Down Expand Up @@ -1132,6 +1133,7 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev,
enum ps3_dma_region_type region_type, void *addr, unsigned long len)
{
unsigned long lpar_addr;
int result;

lpar_addr = addr ? ps3_mm_phys_to_lpar(__pa(addr)) : 0;

Expand All @@ -1143,6 +1145,16 @@ int ps3_dma_region_init(struct ps3_system_bus_device *dev,
r->offset -= map.r1.offset;
r->len = len ? len : _ALIGN_UP(map.total, 1 << r->page_size);

dev->core.dma_mask = &r->dma_mask;

result = dma_set_mask_and_coherent(&dev->core, DMA_BIT_MASK(32));

if (result < 0) {
dev_err(&dev->core, "%s:%d: dma_set_mask_and_coherent failed: %d\n",
__func__, __LINE__, result);
return result;
}

switch (dev->dev_type) {
case PS3_DEVICE_TYPE_SB:
r->region_ops = (USE_DYNAMIC_DMA)
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ config CMM_IUCV
config APPLDATA_BASE
def_bool n
prompt "Linux - VM Monitor Stream, base infrastructure"
depends on PROC_FS
depends on PROC_SYSCTL
help
This provides a kernel interface for creating and updating z/VM APPLDATA
monitor records. The monitor records are updated at certain time
Expand Down
Loading

0 comments on commit d8f10da

Please sign in to comment.