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
2abb6c50
Commit
2abb6c50
authored
Oct 03, 2002
by
Martin Schwidefsky
Committed by
Linus Torvalds
Oct 03, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] s390 update (23/27): channel paths.
Check if defined chpids are available. Some code simplification.
parent
09212816
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
96 deletions
+74
-96
drivers/s390/cio/chsc.c
drivers/s390/cio/chsc.c
+63
-63
drivers/s390/cio/chsc.h
drivers/s390/cio/chsc.h
+2
-0
drivers/s390/cio/cio.c
drivers/s390/cio/cio.c
+3
-2
drivers/s390/cio/s390io.c
drivers/s390/cio/s390io.c
+6
-31
No files found.
drivers/s390/cio/chsc.c
View file @
2abb6c50
/*
* drivers/s390/cio/chsc.c
* S/390 common I/O routines -- channel subsystem call
* $Revision: 1.
9
$
* $Revision: 1.
12
$
*
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
...
...
@@ -52,6 +52,49 @@ chsc_chpid_logical (int irq, int chp)
return
test_bit
(
ioinfo
[
irq
]
->
schib
.
pmcw
.
chpid
[
chp
],
&
chpids_logical
);
}
static
inline
void
chsc_clear_chpid
(
int
irq
,
int
chp
)
{
clear_bit
(
ioinfo
[
irq
]
->
schib
.
pmcw
.
chpid
[
chp
],
&
chpids
);
}
void
chsc_validate_chpids
(
int
irq
)
{
int
mask
,
chp
;
if
(
ioinfo
[
irq
]
->
opm
)
{
for
(
chp
=
0
;
chp
<=
7
;
chp
++
)
{
mask
=
0x80
>>
chp
;
if
(
ioinfo
[
irq
]
->
opm
&
mask
)
{
if
(
!
chsc_chpid_logical
(
irq
,
chp
))
/* disable using this path */
ioinfo
[
irq
]
->
opm
&=
~
mask
;
}
else
{
/* This chpid is not
* available to us */
chsc_clear_chpid
(
irq
,
chp
);
}
}
}
}
void
switch_off_chpids
(
int
irq
,
__u8
mask
)
{
int
i
;
pmcw_t
*
pmcw
=
&
ioinfo
[
irq
]
->
schib
.
pmcw
;
for
(
i
=
0
;
i
<
8
;
i
++
)
if
((
0x80
>>
i
)
&
mask
&
pmcw
->
pim
&
pmcw
->
pam
&
pmcw
->
pom
)
clear_bit
(
pmcw
->
chpid
[
i
],
&
chpids
);
}
/* FIXME: this is _always_ called for every subchannel. shouldn't we
* process more than one at a time?*/
static
int
...
...
@@ -213,11 +256,9 @@ s390_do_chpid_processing( __u8 chpid)
{
int
irq
;
int
j
;
int
mask
;
char
dbf_txt
[
15
];
int
ccode
;
int
was_oper
;
int
chp
=
0
;
int
mask2
;
sprintf
(
dbf_txt
,
"chpr%x"
,
chpid
);
...
...
@@ -266,21 +307,7 @@ s390_do_chpid_processing( __u8 chpid)
ioinfo
[
irq
]
->
schib
.
pmcw
.
pam
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pom
;
if
(
ioinfo
[
irq
]
->
opm
)
{
for
(
chp
=
0
;
chp
<=
7
;
chp
++
)
{
mask2
=
0x80
>>
chp
;
if
(
ioinfo
[
irq
]
->
opm
&
mask2
)
{
if
(
!
test_bit
(
ioinfo
[
irq
]
->
schib
.
pmcw
.
chpid
[
chp
],
&
chpids_logical
))
{
/* disable using this path */
ioinfo
[
irq
]
->
opm
&=
~
mask2
;
}
}
}
}
chsc_validate_chpids
(
irq
);
if
(
!
ioinfo
[
irq
]
->
opm
)
{
/*
...
...
@@ -307,19 +334,6 @@ s390_do_chpid_processing( __u8 chpid)
nopfunc
(
irq
,
DEVSTAT_DEVICE_GONE
);
}
}
else
if
(
ioinfo
[
irq
]
->
ui
.
flags
.
ready
)
{
/*
* Re-do path verification for the chpid in question
* FIXME: is this neccessary?
*/
mask
=
0x80
>>
j
;
if
(
!
s390_DevicePathVerification
(
irq
,
mask
))
{
CHSC_DEBUG
(
KERN_DEBUG
,
CRW
,
2
,
"DevicePathVerification "
"successful for Subchannel %x, "
"chpid %x
\n
"
,
irq
,
chpid
);
}
}
s390irq_spin_unlock
(
irq
);
...
...
@@ -432,18 +446,7 @@ s390_process_res_acc_chpid (u8 chpid)
ioinfo
[
irq
]
->
schib
.
pmcw
.
pam
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pom
;
if
(
ioinfo
[
irq
]
->
opm
)
{
for
(
chp
=
0
;
chp
<=
7
;
chp
++
)
{
mask
=
0x80
>>
chp
;
if
((
ioinfo
[
irq
]
->
opm
&
mask
)
&&
!
test_bit
(
ioinfo
[
irq
]
->
schib
.
pmcw
.
chpid
[
chp
],
&
chpids_logical
))
{
/* disable using this path */
ioinfo
[
irq
]
->
opm
&=
~
mask
;
}
}
}
chsc_validate_chpids
(
irq
);
if
((
ioinfo
[
irq
]
->
ui
.
flags
.
ready
)
&&
(
chpid
&
ioinfo
[
irq
]
->
opm
))
s390_DevicePathVerification
(
irq
,
chpid
);
...
...
@@ -456,8 +459,7 @@ s390_process_res_acc_linkaddr ( __u8 chpid, __u16 fla, u32 fla_mask)
char
dbf_txt
[
15
];
int
irq
=
0
;
int
ccode
;
int
chp
;
int
mask
,
mask2
;
int
mask2
;
int
ret
;
int
j
;
...
...
@@ -517,18 +519,7 @@ s390_process_res_acc_linkaddr ( __u8 chpid, __u16 fla, u32 fla_mask)
ioinfo
[
irq
]
->
schib
.
pmcw
.
pam
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pom
;
if
(
ioinfo
[
irq
]
->
opm
)
{
for
(
chp
=
0
;
chp
<=
7
;
chp
++
)
{
mask
=
0x80
>>
chp
;
if
((
ioinfo
[
irq
]
->
opm
&
mask
)
&&
(
!
test_bit
(
ioinfo
[
irq
]
->
schib
.
pmcw
.
chpid
[
chp
],
&
chpids_logical
)))
{
/* disable using this path */
ioinfo
[
irq
]
->
opm
&=
~
mask
;
}
}
}
chsc_validate_chpids
(
irq
);
if
(
ioinfo
[
irq
]
->
ui
.
flags
.
ready
)
s390_DevicePathVerification
(
irq
,
chpid
);
...
...
@@ -782,11 +773,20 @@ cio_chpids_read (char *page, char **start, off_t off,
}
while
(
chp
<
NR_CHPIDS
&&
len
+
entry_size
<
count
)
{
if
((
test_bit
(
chp
,
&
chpids
))
&&
test_bit
(
chp
,
&
chpids_logical
))
len
+=
sprintf
(
page
+
len
,
"0x%02X online
\n
"
,
chp
);
else
if
(
test_bit
(
chp
,
&
chpids_known
))
len
+=
sprintf
(
page
+
len
,
"0x%02X logically offline
\n
"
,
if
(
test_bit
(
chp
,
&
chpids_known
))
{
if
(
!
test_bit
(
chp
,
&
chpids
))
len
+=
sprintf
(
page
+
len
,
"0x%02X n/a
\n
"
,
chp
);
else
if
(
test_bit
(
chp
,
&
chpids_logical
))
len
+=
sprintf
(
page
+
len
,
"0x%02X online
\n
"
,
chp
);
else
len
+=
sprintf
(
page
+
len
,
"0x%02X logically offline
\n
"
,
chp
);
}
chp
++
;
}
...
...
drivers/s390/cio/chsc.h
View file @
2abb6c50
...
...
@@ -3,4 +3,6 @@
extern
void
s390_process_css
(
void
);
extern
int
chsc_chpid_logical
(
int
irq
,
int
chp
);
extern
void
chsc_validate_chpids
(
int
irq
);
extern
void
switch_off_chpids
(
int
irq
,
__u8
mask
);
#endif
drivers/s390/cio/cio.c
View file @
2abb6c50
/*
* drivers/s390/cio/cio.c
* S/390 common I/O routines -- low level i/o calls
* $Revision: 1.2
5
$
* $Revision: 1.2
6
$
*
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
...
...
@@ -342,6 +342,7 @@ s390_start_IO_handle_notoper(int irq,
if
(
valid_lpm
)
{
ioinfo
[
irq
]
->
opm
&=
~
lpm
;
switch_off_chpids
(
irq
,
lpm
);
}
else
{
ioinfo
[
irq
]
->
opm
=
0
;
...
...
@@ -1386,7 +1387,7 @@ s390_process_IRQ_notoper(unsigned int irq)
ioinfo
[
irq
]
->
devstat
.
intparm
=
0
;
if
(
!
ioinfo
[
irq
]
->
ui
.
flags
.
s_pend
)
if
(
!
(
ioinfo
[
irq
]
->
ui
.
flags
.
s_pend
||
ioinfo
[
irq
]
->
ui
.
flags
.
repnone
))
ioinfo
[
irq
]
->
irq_desc
.
handler
(
irq
,
udp
,
NULL
);
return
1
;
...
...
drivers/s390/cio/s390io.c
View file @
2abb6c50
...
...
@@ -991,9 +991,6 @@ s390_validate_subchannel (int irq, int enable)
int
ccode2
;
/* condition code for other I/O routines */
schib_t
*
p_schib
;
int
ret
;
int
chp
=
0
;
int
mask
;
char
dbf_txt
[
15
];
sprintf
(
dbf_txt
,
"valsch%x"
,
irq
);
...
...
@@ -1115,17 +1112,7 @@ s390_validate_subchannel (int irq, int enable)
ioinfo
[
irq
]
->
opm
=
ioinfo
[
irq
]
->
schib
.
pmcw
.
pim
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pam
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pom
;
if
(
ioinfo
[
irq
]
->
opm
)
{
for
(
chp
=
0
;
chp
<=
7
;
chp
++
)
{
mask
=
0x80
>>
chp
;
if
(
ioinfo
[
irq
]
->
opm
&
mask
)
{
if
(
!
chsc_chpid_logical
(
irq
,
chp
))
{
/* disable using this path */
ioinfo
[
irq
]
->
opm
&=
~
mask
;
}
}
}
}
chsc_validate_chpids
(
irq
);
CIO_DEBUG_IFMSG
(
KERN_INFO
,
0
,
"Detected device %04X "
...
...
@@ -1690,8 +1677,6 @@ s390_DevicePathVerification (int irq, __u8 usermask)
int
ccode
;
__u8
pathmask
;
__u8
domask
;
int
chp
;
int
mask
;
int
old_opm
=
0
;
int
ret
=
0
;
...
...
@@ -1772,17 +1757,7 @@ s390_DevicePathVerification (int irq, __u8 usermask)
ioinfo
[
irq
]
->
opm
=
ioinfo
[
irq
]
->
schib
.
pmcw
.
pim
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pam
&
ioinfo
[
irq
]
->
schib
.
pmcw
.
pom
;
if
(
ioinfo
[
irq
]
->
opm
)
{
for
(
chp
=
0
;
chp
<=
7
;
chp
++
)
{
mask
=
0x80
>>
chp
;
if
(
ioinfo
[
irq
]
->
opm
&
mask
)
{
if
(
!
chsc_chpid_logical
(
irq
,
chp
))
{
/* disable using this path */
ioinfo
[
irq
]
->
opm
&=
~
mask
;
}
}
}
}
chsc_validate_chpids
(
irq
);
if
((
ioinfo
[
irq
]
->
opm
==
0
)
&&
(
old_opm
))
{
not_oper_handler_func_t
nopfunc
=
ioinfo
[
irq
]
->
nopfunc
;
...
...
@@ -1815,7 +1790,7 @@ s390_DevicePathVerification (int irq, __u8 usermask)
}
if
(
ioinfo
[
irq
]
->
ui
.
flags
.
pgid_supp
==
0
)
return
(
0
)
;
/* just exit ... */
return
0
;
/* just exit ... */
if
(
usermask
)
{
dev_path
=
usermask
;
...
...
@@ -2229,8 +2204,8 @@ s390_SensePGID (int irq, __u8 lpm, pgid_t * pgid)
* Sense Path Group ID command
* further retries wouldn't help ...
*/
if
(
pdevstat
->
ii
.
sense
.
data
[
0
]
&
SNS0_CMD_REJECT
)
{
if
(
pdevstat
->
ii
.
sense
.
data
[
0
]
&
(
SNS0_CMD_REJECT
|
SNS0_INTERVENTION_REQ
)
)
{
retry
=
0
;
irq_ret
=
-
EOPNOTSUPP
;
}
else
{
...
...
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