Hi Arnd,
First bad commit (maybe != root cause):
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
ixp4xx-test
head: 1b826e686b390fd1eeb347def38185fefcbd5140
commit: 7ac6c27d7ee1cdef95314be43e4c3854d8f80240 [17/23] ixp4xx_eth: enable compile
testing
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-rc1-42-g38eda53-dirty
git checkout 7ac6c27d7ee1cdef95314be43e4c3854d8f80240
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> drivers/net/ethernet/xscale/ptp_ixp46x.c:48:27: sparse: sparse:
incorrect type in argument 1 (different address spaces) @@ expected void const volatile
[noderef] <asn:2> *addr @@ got ref] <asn:2> *addr @@
> drivers/net/ethernet/xscale/ptp_ixp46x.c:48:27: sparse: expected void const
volatile [noderef] <asn:2> *addr
> drivers/net/ethernet/xscale/ptp_ixp46x.c:48:27: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:49:27: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:49:27: sparse: expected void const volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:49:27: sparse: got unsigned int *
> drivers/net/ethernet/xscale/ptp_ixp46x.c:66:27: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void volatile
[noderef] <asn:2> *addr @@ got ref] <asn:2> *addr @@
> drivers/net/ethernet/xscale/ptp_ixp46x.c:66:27: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:66:27:
sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:67:27: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:67:27: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:67:27: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:81:28: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:81:28: sparse: expected void const volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:81:28: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:86:43: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:86:43: sparse: expected void const volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:86:43: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:87:43: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:87:43: sparse: expected void const volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:87:43: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:100:43: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:100:43: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:100:43: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:101:43: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:101:43: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:101:43: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:115:36: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:115:36: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:115:36: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:144:31: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:144:31: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:144:31: sparse: got unsigned int *
> drivers/net/ethernet/xscale/ptp_ixp46x.c:302:24: sparse: sparse:
incorrect type in assignment (different address spaces) @@ expected struct
ixp46x_ts_regs *static [addressable] [toplevel] [assigned] regs @@ got ] [toplevel]
[assigned] regs @@
> drivers/net/ethernet/xscale/ptp_ixp46x.c:302:24: sparse: expected struct
ixp46x_ts_regs *static [addressable] [toplevel] [assigned] regs
> drivers/net/ethernet/xscale/ptp_ixp46x.c:302:24: sparse: got void [noderef]
<asn:2> *
drivers/net/ethernet/xscale/ptp_ixp46x.c:316:48: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void volatile
[noderef] <asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:316:48: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:316:48: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:317:35: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:317:35: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:317:35: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:318:35: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:318:35: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:318:35: sparse: got unsigned int *
drivers/net/ethernet/xscale/ptp_ixp46x.c:319:41: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ptp_ixp46x.c:319:41: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ptp_ixp46x.c:319:41: sparse: got unsigned int *
> drivers/net/ethernet/xscale/ptp_ixp46x.c:280:10: sparse: sparse:
dereference of noderef expression
--
> drivers/net/ethernet/xscale/ixp4xx_eth.c:242:27: sparse: sparse:
cast to restricted __be16
> drivers/net/ethernet/xscale/ixp4xx_eth.c:242:27: sparse: sparse: cast to restricted
__be16
> drivers/net/ethernet/xscale/ixp4xx_eth.c:242:27: sparse: sparse: cast to restricted
__be16
> drivers/net/ethernet/xscale/ixp4xx_eth.c:242:27: sparse: sparse: cast to restricted
__be16
> drivers/net/ethernet/xscale/ixp4xx_eth.c:243:27: sparse: sparse: cast to restricted
__be32
> drivers/net/ethernet/xscale/ixp4xx_eth.c:243:27: sparse: sparse: cast to restricted
__be32
> drivers/net/ethernet/xscale/ixp4xx_eth.c:243:27: sparse: sparse: cast to restricted
__be32
> drivers/net/ethernet/xscale/ixp4xx_eth.c:243:27: sparse: sparse: cast to restricted
__be32
> drivers/net/ethernet/xscale/ixp4xx_eth.c:243:27: sparse: sparse: cast to restricted
__be32
> drivers/net/ethernet/xscale/ixp4xx_eth.c:243:27: sparse: sparse: cast to restricted
__be32
drivers/net/ethernet/xscale/ixp4xx_eth.c:244:27: sparse: sparse: cast to
restricted __be16
drivers/net/ethernet/xscale/ixp4xx_eth.c:244:27: sparse: sparse: cast to restricted
__be16
drivers/net/ethernet/xscale/ixp4xx_eth.c:244:27: sparse: sparse: cast to restricted
__be16
drivers/net/ethernet/xscale/ixp4xx_eth.c:244:27: sparse: sparse: cast to restricted
__be16
> drivers/net/ethernet/xscale/ixp4xx_eth.c:260:14: sparse: sparse:
incorrect type in assignment (different address spaces) @@ expected struct
ixp46x_ts_regs *regs @@ got struct ixp46x_ts_rstruct ixp46x_ts_regs *regs @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:260:14: sparse: expected struct
ixp46x_ts_regs *regs
> drivers/net/ethernet/xscale/ixp4xx_eth.c:260:14: sparse: got struct ixp46x_ts_regs
[noderef] <asn:2> *timesync_regs
> drivers/net/ethernet/xscale/ixp4xx_eth.c:262:41: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:262:41: sparse: expected void const
volatile [noderef] <asn:2> *addr
> drivers/net/ethernet/xscale/ixp4xx_eth.c:262:41: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:267:40: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:267:40: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:267:40: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:268:40: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:268:40: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:268:40: sparse: got unsigned int *
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:33: sparse: sparse:
incorrect type in argument 2 (different base types) @@ expected unsigned short
[usertype] uid_hi @@ got resunsigned short [usertype] uid_hi @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:33: sparse: expected unsigned short
[usertype] uid_hi
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:33: sparse: got restricted __be16
[usertype]
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:45: sparse: sparse: incorrect type in
argument 3 (different base types) @@ expected unsigned int [usertype] uid_lo @@ got
restrunsigned int [usertype] uid_lo @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:45: sparse: expected unsigned int
[usertype] uid_lo
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:45: sparse: got restricted __be32
[usertype]
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:56: sparse: sparse: incorrect type in
argument 4 (different base types) @@ expected unsigned short [usertype] seqid @@ got
resunsigned short [usertype] seqid @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:273:56: sparse: expected unsigned short
[usertype] seqid
drivers/net/ethernet/xscale/ixp4xx_eth.c:273:56: sparse: got
restricted __be16 [usertype]
drivers/net/ethernet/xscale/ixp4xx_eth.c:276:40: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:276:40: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:276:40: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:277:40: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:277:40: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:277:40: sparse: got unsigned int *
> drivers/net/ethernet/xscale/ixp4xx_eth.c:286:56: sparse: sparse:
incorrect type in argument 2 (different address spaces) @@ expected void volatile
[noderef] <asn:2> *addr @@ got ref] <asn:2> *addr @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:286:56: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:286:56:
sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:305:14: sparse: sparse: incorrect type in
assignment (different address spaces) @@ expected struct ixp46x_ts_regs *regs @@ got
struct ixp46x_ts_rstruct ixp46x_ts_regs *regs @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:305:14: sparse: expected struct
ixp46x_ts_regs *regs
drivers/net/ethernet/xscale/ixp4xx_eth.c:305:14: sparse: got struct ixp46x_ts_regs
[noderef] <asn:2> *timesync_regs
drivers/net/ethernet/xscale/ixp4xx_eth.c:312:49: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:312:49: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:312:49: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:322:40: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:322:40: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:322:40: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:323:40: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected void const volatile [noderef]
<asn:2> *addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:323:40: sparse: expected void const
volatile [noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:323:40: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:332:56: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:332:56: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:332:56: sparse: got unsigned int *
> drivers/net/ethernet/xscale/ixp4xx_eth.c:349:32: sparse: sparse:
incorrect type in argument 1 (different address spaces) @@ expected struct
ixp46x_ts_regs *[noderef] <asn:2> *regs @@ got struct ixp46x_ts_regs *[noderef]
<asn:2> *regs @@
> drivers/net/ethernet/xscale/ixp4xx_eth.c:349:32: sparse: expected struct
ixp46x_ts_regs *[noderef] <asn:2> *regs
> drivers/net/ethernet/xscale/ixp4xx_eth.c:349:32: sparse: got struct ixp46x_ts_regs
[noderef] <asn:2> **
drivers/net/ethernet/xscale/ixp4xx_eth.c:354:14:
sparse: sparse: incorrect type in assignment (different address spaces) @@ expected
struct ixp46x_ts_regs *regs @@ got struct ixp46x_ts_rstruct ixp46x_ts_regs *regs @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:354:14: sparse: expected struct
ixp46x_ts_regs *regs
drivers/net/ethernet/xscale/ixp4xx_eth.c:354:14: sparse: got struct ixp46x_ts_regs
[noderef] <asn:2> *timesync_regs
drivers/net/ethernet/xscale/ixp4xx_eth.c:365:47: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:365:47: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:365:47: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:369:57: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:369:57: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:369:57: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:379:36: sparse: sparse: incorrect type in
argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2>
*addr @@ got ref] <asn:2> *addr @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:379:36: sparse: expected void volatile
[noderef] <asn:2> *addr
drivers/net/ethernet/xscale/ixp4xx_eth.c:379:36: sparse: got unsigned int *
drivers/net/ethernet/xscale/ixp4xx_eth.c:859:34: sparse: sparse: incorrect type in
argument 1 (different address spaces) @@ expected struct ixp46x_ts_regs *[noderef]
<asn:2> *regs @@ got struct ixp46x_ts_regs *[noderef] <asn:2> *regs @@
drivers/net/ethernet/xscale/ixp4xx_eth.c:859:34: sparse: expected struct
ixp46x_ts_regs *[noderef] <asn:2> *regs
drivers/net/ethernet/xscale/ixp4xx_eth.c:859:34: sparse: got struct ixp46x_ts_regs
[noderef] <asn:2> **
> drivers/net/ethernet/xscale/ixp4xx_eth.c:714:23: sparse: sparse:
non size-preserving pointer to integer cast
vim +48 drivers/net/ethernet/xscale/ptp_ixp46x.c
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 38
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 39 /*
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 40 * Register
access functions
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 41 */
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 42
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 43 static u64
ixp_systime_read(struct ixp46x_ts_regs *regs)
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 44 {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 45 u64 ns;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 46 u32 lo, hi;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 47
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 @48 lo =
__raw_readl(®s->systime_lo);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 49 hi =
__raw_readl(®s->systime_hi);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 50
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 51 ns = ((u64) hi)
<< 32;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 52 ns |= lo;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 53 ns <<=
TICKS_NS_SHIFT;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 54
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 55 return ns;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 56 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 57
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 58 static void
ixp_systime_write(struct ixp46x_ts_regs *regs, u64 ns)
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 59 {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 60 u32 hi, lo;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 61
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 62 ns >>=
TICKS_NS_SHIFT;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 63 hi = ns >>
32;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 64 lo = ns &
0xffffffff;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 65
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 @66 __raw_writel(lo,
®s->systime_lo);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 67 __raw_writel(hi,
®s->systime_hi);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 68 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 69
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 70 /*
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 71 * Interrupt
service routine
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 72 */
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 73
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 74 static
irqreturn_t isr(int irq, void *priv)
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 75 {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 76 struct ixp_clock
*ixp_clock = priv;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 77 struct
ixp46x_ts_regs *regs = ixp_clock->regs;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 78 struct
ptp_clock_event event;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 79 u32 ack = 0, lo,
hi, val;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 80
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 81 val =
__raw_readl(®s->event);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 82
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 83 if (val &
TSER_SNS) {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 84 ack |=
TSER_SNS;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 85 if
(ixp_clock->exts0_enabled) {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 86 hi =
__raw_readl(®s->asms_hi);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 87 lo =
__raw_readl(®s->asms_lo);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 88 event.type =
PTP_CLOCK_EXTTS;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 89 event.index =
0;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 90
event.timestamp = ((u64) hi) << 32;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 91
event.timestamp |= lo;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 92
event.timestamp <<= TICKS_NS_SHIFT;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 93
ptp_clock_event(ixp_clock->ptp_clock, &event);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 94 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 95 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 96
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 97 if (val &
TSER_SNM) {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 98 ack |=
TSER_SNM;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 99 if
(ixp_clock->exts1_enabled) {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 100 hi =
__raw_readl(®s->amms_hi);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 @101 lo =
__raw_readl(®s->amms_lo);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 102 event.type =
PTP_CLOCK_EXTTS;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 103 event.index =
1;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 104
event.timestamp = ((u64) hi) << 32;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 105
event.timestamp |= lo;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 106
event.timestamp <<= TICKS_NS_SHIFT;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 107
ptp_clock_event(ixp_clock->ptp_clock, &event);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 108 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 109 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 110
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 111 if (val &
TTIPEND)
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 112 ack |= TTIPEND;
/* this bit seems to be always set */
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 113
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 114 if (ack) {
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 115
__raw_writel(ack, ®s->event);
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 116 return
IRQ_HANDLED;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 117 } else
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 118 return
IRQ_NONE;
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 119 }
32bd93e8f924c2 drivers/ptp/ptp_ixp46x.c Richard Cochran 2011-04-22 120
:::::: The code at line 48 was first introduced by commit
:::::: 32bd93e8f924c23b8cc2e2a12fef0d8cc9cda0c5 ptp: Added a clock driver for the IXP46x.
:::::: TO: Richard Cochran <richardcochran(a)gmail.com>
:::::: CC: John Stultz <john.stultz(a)linaro.org>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation