Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8e4fae2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull arch/tile updates from Chris Metcalf:
 "The only substantive pieces in this batch are some more vDSO support,
  and removing the reference to &platform_bus in tile-srom.c.

  The rest are minor issues reported to me"

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  tile: add clock_gettime support to vDSO
  tile: switch to using seqlocks for the vDSO time code
  tile gxio: use better string copy primitive
  char: tile-srom: Add real platform bus parent
  Removed repeated word in comments
  tilegx: Enable ARCH_SUPPORTS_ATOMIC_RMW
  tile: Remove tile-specific _sinitdata and _einitdata
  tile: use ARRAY_SIZE
parents 6325e940 78410af5
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -134,6 +134,7 @@ config TILEGX
	select HAVE_KPROBES
	select HAVE_KPROBES
	select HAVE_KRETPROBES
	select HAVE_KRETPROBES
	select HAVE_ARCH_KGDB
	select HAVE_ARCH_KGDB
	select ARCH_SUPPORTS_ATOMIC_RMW


config TILEPRO
config TILEPRO
	def_bool !TILEGX
	def_bool !TILEGX
+32 −5
Original line number Original line Diff line number Diff line
@@ -29,6 +29,32 @@
/* HACK: Avoid pointless "shadow" warnings. */
/* HACK: Avoid pointless "shadow" warnings. */
#define link link_shadow
#define link link_shadow


/**
 * strscpy - Copy a C-string into a sized buffer, but only if it fits
 * @dest: Where to copy the string to
 * @src: Where to copy the string from
 * @size: size of destination buffer
 *
 * Use this routine to avoid copying too-long strings.
 * The routine returns the total number of bytes copied
 * (including the trailing NUL) or zero if the buffer wasn't
 * big enough.  To ensure that programmers pay attention
 * to the return code, the destination has a single NUL
 * written at the front (if size is non-zero) when the
 * buffer is not big enough.
 */
static size_t strscpy(char *dest, const char *src, size_t size)
{
	size_t len = strnlen(src, size) + 1;
	if (len > size) {
		if (size)
			dest[0] = '\0';
		return 0;
	}
	memcpy(dest, src, len);
	return len;
}

int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
{
{
	char file[32];
	char file[32];
@@ -511,8 +537,8 @@ int gxio_mpipe_link_instance(const char *link_name)
	if (!context)
	if (!context)
		return GXIO_ERR_NO_DEVICE;
		return GXIO_ERR_NO_DEVICE;


	strncpy(name.name, link_name, sizeof(name.name));
	if (strscpy(name.name, link_name, sizeof(name.name)) == 0)
	name.name[GXIO_MPIPE_LINK_NAME_LEN - 1] = '\0';
		return GXIO_ERR_NO_DEVICE;


	return gxio_mpipe_info_instance_aux(context, name);
	return gxio_mpipe_info_instance_aux(context, name);
}
}
@@ -529,7 +555,8 @@ int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac)


	rv = gxio_mpipe_info_enumerate_aux(context, idx, &name, &mac);
	rv = gxio_mpipe_info_enumerate_aux(context, idx, &name, &mac);
	if (rv >= 0) {
	if (rv >= 0) {
		strncpy(link_name, name.name, sizeof(name.name));
		if (strscpy(link_name, name.name, sizeof(name.name)) == 0)
			return GXIO_ERR_INVAL_MEMORY_SIZE;
		memcpy(link_mac, mac.mac, sizeof(mac.mac));
		memcpy(link_mac, mac.mac, sizeof(mac.mac));
	}
	}


@@ -545,8 +572,8 @@ int gxio_mpipe_link_open(gxio_mpipe_link_t *link,
	_gxio_mpipe_link_name_t name;
	_gxio_mpipe_link_name_t name;
	int rv;
	int rv;


	strncpy(name.name, link_name, sizeof(name.name));
	if (strscpy(name.name, link_name, sizeof(name.name)) == 0)
	name.name[GXIO_MPIPE_LINK_NAME_LEN - 1] = '\0';
		return GXIO_ERR_NO_DEVICE;


	rv = gxio_mpipe_link_open_aux(context, name, flags);
	rv = gxio_mpipe_link_open_aux(context, name, flags);
	if (rv < 0)
	if (rv < 0)
+0 −3
Original line number Original line Diff line number Diff line
@@ -19,9 +19,6 @@


#include <asm-generic/sections.h>
#include <asm-generic/sections.h>


/* Text and data are at different areas in the kernel VA space. */
extern char _sinitdata[], _einitdata[];

/* Write-once data is writable only till the end of initialization. */
/* Write-once data is writable only till the end of initialization. */
extern char __w1data_begin[], __w1data_end[];
extern char __w1data_begin[], __w1data_end[];


+13 −7
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@
#ifndef __TILE_VDSO_H__
#ifndef __TILE_VDSO_H__
#define __TILE_VDSO_H__
#define __TILE_VDSO_H__


#include <linux/seqlock.h>
#include <linux/types.h>
#include <linux/types.h>


/*
/*
@@ -26,15 +27,20 @@
 */
 */


struct vdso_data {
struct vdso_data {
	__u64 tz_update_count;  /* Timezone atomicity ctr             */
	seqcount_t tz_seq;	/* Timezone seqlock                   */
	__u64 tb_update_count;  /* Timebase atomicity ctr             */
	seqcount_t tb_seq;	/* Timebase seqlock                   */
	__u64 xtime_tod_stamp;  /* TOD clock for xtime                */
	__u64 cycle_last;       /* TOD clock for xtime                */
	__u64 xtime_clock_sec;  /* Kernel time second                 */
	__u64 mask;             /* Cycle mask                         */
	__u64 xtime_clock_nsec; /* Kernel time nanosecond             */
	__u64 wtom_clock_sec;   /* Wall to monotonic clock second     */
	__u64 wtom_clock_nsec;  /* Wall to monotonic clock nanosecond */
	__u32 mult;             /* Cycle to nanosecond multiplier     */
	__u32 mult;             /* Cycle to nanosecond multiplier     */
	__u32 shift;            /* Cycle to nanosecond divisor (power of two) */
	__u32 shift;            /* Cycle to nanosecond divisor (power of two) */
	__u64 wall_time_sec;
	__u64 wall_time_snsec;
	__u64 monotonic_time_sec;
	__u64 monotonic_time_snsec;
	__u64 wall_time_coarse_sec;
	__u64 wall_time_coarse_nsec;
	__u64 monotonic_time_coarse_sec;
	__u64 monotonic_time_coarse_nsec;
	__u32 tz_minuteswest;   /* Minutes west of Greenwich          */
	__u32 tz_minuteswest;   /* Minutes west of Greenwich          */
	__u32 tz_dsttime;       /* Type of dst correction             */
	__u32 tz_dsttime;       /* Type of dst correction             */
};
};
+5 −5
Original line number Original line Diff line number Diff line
@@ -360,19 +360,19 @@
 * @{
 * @{
 */
 */


/** Use with with SIM_PROFILER_CHIP_xxx to control the memory controllers. */
/** Use with SIM_PROFILER_CHIP_xxx to control the memory controllers. */
#define SIM_CHIP_MEMCTL        0x001
#define SIM_CHIP_MEMCTL        0x001


/** Use with with SIM_PROFILER_CHIP_xxx to control the XAUI interface. */
/** Use with SIM_PROFILER_CHIP_xxx to control the XAUI interface. */
#define SIM_CHIP_XAUI          0x002
#define SIM_CHIP_XAUI          0x002


/** Use with with SIM_PROFILER_CHIP_xxx to control the PCIe interface. */
/** Use with SIM_PROFILER_CHIP_xxx to control the PCIe interface. */
#define SIM_CHIP_PCIE          0x004
#define SIM_CHIP_PCIE          0x004


/** Use with with SIM_PROFILER_CHIP_xxx to control the MPIPE interface. */
/** Use with SIM_PROFILER_CHIP_xxx to control the MPIPE interface. */
#define SIM_CHIP_MPIPE         0x008
#define SIM_CHIP_MPIPE         0x008


/** Use with with SIM_PROFILER_CHIP_xxx to control the TRIO interface. */
/** Use with SIM_PROFILER_CHIP_xxx to control the TRIO interface. */
#define SIM_CHIP_TRIO          0x010
#define SIM_CHIP_TRIO          0x010


/** Reference all chip devices. */
/** Reference all chip devices. */
Loading