Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
98d1e317
Commit
98d1e317
authored
Feb 23, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nve0/fifo: attempt to recover engines from mmu faults
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
448a4532
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
2 deletions
+87
-2
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
+87
-2
No files found.
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
View file @
98d1e317
...
@@ -65,6 +65,10 @@ struct nve0_fifo_engn {
...
@@ -65,6 +65,10 @@ struct nve0_fifo_engn {
struct
nve0_fifo_priv
{
struct
nve0_fifo_priv
{
struct
nouveau_fifo
base
;
struct
nouveau_fifo
base
;
struct
work_struct
fault
;
u64
mask
;
struct
nve0_fifo_engn
engine
[
FIFO_ENGINE_NR
];
struct
nve0_fifo_engn
engine
[
FIFO_ENGINE_NR
];
struct
{
struct
{
struct
nouveau_gpuobj
*
mem
;
struct
nouveau_gpuobj
*
mem
;
...
@@ -393,6 +397,75 @@ nve0_fifo_cclass = {
...
@@ -393,6 +397,75 @@ nve0_fifo_cclass = {
* PFIFO engine
* PFIFO engine
******************************************************************************/
******************************************************************************/
static
inline
int
nve0_fifo_engidx
(
struct
nve0_fifo_priv
*
priv
,
u32
engn
)
{
switch
(
engn
)
{
case
NVDEV_ENGINE_GR
:
case
NVDEV_ENGINE_COPY2
:
engn
=
0
;
break
;
case
NVDEV_ENGINE_BSP
:
engn
=
1
;
break
;
case
NVDEV_ENGINE_PPP
:
engn
=
2
;
break
;
case
NVDEV_ENGINE_VP
:
engn
=
3
;
break
;
case
NVDEV_ENGINE_COPY0
:
engn
=
4
;
break
;
case
NVDEV_ENGINE_COPY1
:
engn
=
5
;
break
;
case
NVDEV_ENGINE_VENC
:
engn
=
6
;
break
;
default:
return
-
1
;
}
return
engn
;
}
static
void
nve0_fifo_recover_work
(
struct
work_struct
*
work
)
{
struct
nve0_fifo_priv
*
priv
=
container_of
(
work
,
typeof
(
*
priv
),
fault
);
struct
nouveau_object
*
engine
;
unsigned
long
flags
;
u32
engn
,
engm
=
0
;
u64
mask
,
todo
;
spin_lock_irqsave
(
&
priv
->
base
.
lock
,
flags
);
mask
=
priv
->
mask
;
priv
->
mask
=
0ULL
;
spin_unlock_irqrestore
(
&
priv
->
base
.
lock
,
flags
);
for
(
todo
=
mask
;
engn
=
__ffs64
(
todo
),
todo
;
todo
&=
~
(
1
<<
engn
))
engm
|=
1
<<
nve0_fifo_engidx
(
priv
,
engn
);
nv_mask
(
priv
,
0x002630
,
engm
,
engm
);
for
(
todo
=
mask
;
engn
=
__ffs64
(
todo
),
todo
;
todo
&=
~
(
1
<<
engn
))
{
if
((
engine
=
(
void
*
)
nouveau_engine
(
priv
,
engn
)))
{
nv_ofuncs
(
engine
)
->
fini
(
engine
,
false
);
WARN_ON
(
nv_ofuncs
(
engine
)
->
init
(
engine
));
}
nve0_fifo_runlist_update
(
priv
,
nve0_fifo_engidx
(
priv
,
engn
));
}
nv_wr32
(
priv
,
0x00262c
,
engm
);
nv_mask
(
priv
,
0x002630
,
engm
,
0x00000000
);
}
static
void
nve0_fifo_recover
(
struct
nve0_fifo_priv
*
priv
,
struct
nouveau_engine
*
engine
,
struct
nve0_fifo_chan
*
chan
)
{
struct
nouveau_object
*
engobj
=
nv_object
(
engine
);
u32
chid
=
chan
->
base
.
chid
;
unsigned
long
flags
;
nv_error
(
priv
,
"%s engine fault on channel %d, recovering...
\n
"
,
nv_subdev
(
engine
)
->
name
,
chid
);
nv_mask
(
priv
,
0x800004
+
(
chid
*
0x08
),
0x00000800
,
0x00000800
);
chan
->
state
=
KILLED
;
spin_lock_irqsave
(
&
priv
->
base
.
lock
,
flags
);
priv
->
mask
|=
1ULL
<<
nv_engidx
(
engobj
);
spin_unlock_irqrestore
(
&
priv
->
base
.
lock
,
flags
);
schedule_work
(
&
priv
->
fault
);
}
static
int
static
int
nve0_fifo_swmthd
(
struct
nve0_fifo_priv
*
priv
,
u32
chid
,
u32
mthd
,
u32
data
)
nve0_fifo_swmthd
(
struct
nve0_fifo_priv
*
priv
,
u32
chid
,
u32
mthd
,
u32
data
)
{
{
...
@@ -572,8 +645,8 @@ nve0_fifo_intr_fault(struct nve0_fifo_priv *priv, int unit)
...
@@ -572,8 +645,8 @@ nve0_fifo_intr_fault(struct nve0_fifo_priv *priv, int unit)
u32
write
=
(
stat
&
0x00000080
);
u32
write
=
(
stat
&
0x00000080
);
u32
hub
=
(
stat
&
0x00000040
);
u32
hub
=
(
stat
&
0x00000040
);
u32
reason
=
(
stat
&
0x0000000f
);
u32
reason
=
(
stat
&
0x0000000f
);
struct
nouveau_object
*
engctx
=
NULL
;
struct
nouveau_object
*
engctx
=
NULL
,
*
object
;
struct
nouveau_engine
*
engine
;
struct
nouveau_engine
*
engine
=
NULL
;
const
struct
nouveau_enum
*
er
,
*
eu
,
*
ec
;
const
struct
nouveau_enum
*
er
,
*
eu
,
*
ec
;
char
erunk
[
6
]
=
""
;
char
erunk
[
6
]
=
""
;
char
euunk
[
6
]
=
""
;
char
euunk
[
6
]
=
""
;
...
@@ -623,6 +696,16 @@ nve0_fifo_intr_fault(struct nve0_fifo_priv *priv, int unit)
...
@@ -623,6 +696,16 @@ nve0_fifo_intr_fault(struct nve0_fifo_priv *priv, int unit)
ec
?
ec
->
name
:
ecunk
,
(
u64
)
inst
<<
12
,
ec
?
ec
->
name
:
ecunk
,
(
u64
)
inst
<<
12
,
nouveau_client_name
(
engctx
));
nouveau_client_name
(
engctx
));
object
=
engctx
;
while
(
object
)
{
switch
(
nv_mclass
(
object
))
{
case
NVE0_CHANNEL_IND_CLASS
:
nve0_fifo_recover
(
priv
,
engine
,
(
void
*
)
object
);
break
;
}
object
=
object
->
parent
;
}
nouveau_engctx_put
(
engctx
);
nouveau_engctx_put
(
engctx
);
}
}
...
@@ -889,6 +972,8 @@ nve0_fifo_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
...
@@ -889,6 +972,8 @@ nve0_fifo_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
INIT_WORK
(
&
priv
->
fault
,
nve0_fifo_recover_work
);
for
(
i
=
0
;
i
<
FIFO_ENGINE_NR
;
i
++
)
{
for
(
i
=
0
;
i
<
FIFO_ENGINE_NR
;
i
++
)
{
ret
=
nouveau_gpuobj_new
(
nv_object
(
priv
),
NULL
,
0x8000
,
0x1000
,
ret
=
nouveau_gpuobj_new
(
nv_object
(
priv
),
NULL
,
0x8000
,
0x1000
,
0
,
&
priv
->
engine
[
i
].
runlist
[
0
]);
0
,
&
priv
->
engine
[
i
].
runlist
[
0
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment