Commit 9a17e972 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

s390/chsc: cleanup SEI helper functions

Cleanup the functions used to call SEI.
Also provide !CONFIG_PCI dummys for pci error handling.
Reviewed-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 5c8d0983
...@@ -160,9 +160,14 @@ void zpci_teardown_msi_irq(struct zpci_dev *, struct msi_desc *); ...@@ -160,9 +160,14 @@ void zpci_teardown_msi_irq(struct zpci_dev *, struct msi_desc *);
int zpci_msihash_init(void); int zpci_msihash_init(void);
void zpci_msihash_exit(void); void zpci_msihash_exit(void);
#ifdef CONFIG_PCI
/* Error handling and recovery */ /* Error handling and recovery */
void zpci_event_error(void *); void zpci_event_error(void *);
void zpci_event_availability(void *); void zpci_event_availability(void *);
#else /* CONFIG_PCI */
static inline void zpci_event_error(void *e) {}
static inline void zpci_event_availability(void *e) {}
#endif /* CONFIG_PCI */
/* Helpers */ /* Helpers */
struct zpci_dev *get_zdev(struct pci_dev *); struct zpci_dev *get_zdev(struct pci_dev *);
......
...@@ -435,7 +435,6 @@ static void chsc_process_sei_scm_change(struct chsc_sei_nt0_area *sei_area) ...@@ -435,7 +435,6 @@ static void chsc_process_sei_scm_change(struct chsc_sei_nt0_area *sei_area)
static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area) static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area)
{ {
#ifdef CONFIG_PCI
switch (sei_area->cc) { switch (sei_area->cc) {
case 1: case 1:
zpci_event_error(sei_area->ccdf); zpci_event_error(sei_area->ccdf);
...@@ -444,11 +443,10 @@ static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area) ...@@ -444,11 +443,10 @@ static void chsc_process_sei_nt2(struct chsc_sei_nt2_area *sei_area)
zpci_event_availability(sei_area->ccdf); zpci_event_availability(sei_area->ccdf);
break; break;
default: default:
CIO_CRW_EVENT(2, "chsc: unhandled sei content code %d\n", CIO_CRW_EVENT(2, "chsc: sei nt2 unhandled cc=%d\n",
sei_area->cc); sei_area->cc);
break; break;
} }
#endif
} }
static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area) static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area)
...@@ -471,13 +469,19 @@ static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area) ...@@ -471,13 +469,19 @@ static void chsc_process_sei_nt0(struct chsc_sei_nt0_area *sei_area)
chsc_process_sei_scm_change(sei_area); chsc_process_sei_scm_change(sei_area);
break; break;
default: /* other stuff */ default: /* other stuff */
CIO_CRW_EVENT(4, "chsc: unhandled sei content code %d\n", CIO_CRW_EVENT(2, "chsc: sei nt0 unhandled cc=%d\n",
sei_area->cc); sei_area->cc);
break; break;
} }
/* Check if we might have lost some information. */
if (sei_area->flags & 0x40) {
CIO_CRW_EVENT(2, "chsc: event overflow\n");
css_schedule_eval_all();
}
} }
static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm) static void chsc_process_event_information(struct chsc_sei *sei, u64 ntsm)
{ {
do { do {
memset(sei, 0, sizeof(*sei)); memset(sei, 0, sizeof(*sei));
...@@ -488,15 +492,13 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm) ...@@ -488,15 +492,13 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm)
if (chsc(sei)) if (chsc(sei))
break; break;
if (sei->response.code == 0x0001) { if (sei->response.code != 0x0001) {
CIO_CRW_EVENT(2, "chsc: sei successful\n"); CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x)\n",
sei->response.code);
/* Check if we might have lost some information. */ break;
if (sei->u.nt0_area.flags & 0x40) {
CIO_CRW_EVENT(2, "chsc: event overflow\n");
css_schedule_eval_all();
} }
CIO_CRW_EVENT(2, "chsc: sei successful (nt=%d)\n", sei->nt);
switch (sei->nt) { switch (sei->nt) {
case 0: case 0:
chsc_process_sei_nt0(&sei->u.nt0_area); chsc_process_sei_nt0(&sei->u.nt0_area);
...@@ -505,23 +507,22 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm) ...@@ -505,23 +507,22 @@ static int __chsc_process_crw(struct chsc_sei *sei, u64 ntsm)
chsc_process_sei_nt2(&sei->u.nt2_area); chsc_process_sei_nt2(&sei->u.nt2_area);
break; break;
default: default:
CIO_CRW_EVENT(2, "chsc: unhandled nt=%d\n", CIO_CRW_EVENT(2, "chsc: unhandled nt: %d\n", sei->nt);
sei->nt);
break;
}
} else {
CIO_CRW_EVENT(2, "chsc: sei failed (rc=%04x)\n",
sei->response.code);
break; break;
} }
} while (sei->u.nt0_area.flags & 0x80); } while (sei->u.nt0_area.flags & 0x80);
return 0;
} }
/*
* Handle channel subsystem related CRWs.
* Use store event information to find out what's going on.
*
* Note: Access to sei_page is serialized through machine check handler
* thread, so no need for locking.
*/
static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow) static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow)
{ {
struct chsc_sei *sei; struct chsc_sei *sei = sei_page;
if (overflow) { if (overflow) {
css_schedule_eval_all(); css_schedule_eval_all();
...@@ -531,14 +532,9 @@ static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow) ...@@ -531,14 +532,9 @@ static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow)
"chn=%d, rsc=%X, anc=%d, erc=%X, rsid=%X\n", "chn=%d, rsc=%X, anc=%d, erc=%X, rsid=%X\n",
crw0->slct, crw0->oflw, crw0->chn, crw0->rsc, crw0->anc, crw0->slct, crw0->oflw, crw0->chn, crw0->rsc, crw0->anc,
crw0->erc, crw0->rsid); crw0->erc, crw0->rsid);
if (!sei_page)
return;
/* Access to sei_page is serialized through machine check handler
* thread, so no need for locking. */
sei = sei_page;
CIO_TRACE_EVENT(2, "prcss"); CIO_TRACE_EVENT(2, "prcss");
__chsc_process_crw(sei, CHSC_SEI_NT0 | CHSC_SEI_NT2); chsc_process_event_information(sei, CHSC_SEI_NT0 | CHSC_SEI_NT2);
} }
void chsc_chp_online(struct chp_id chpid) void chsc_chp_online(struct chp_id chpid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment