diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/devfsadm/devfsadm.c | 25 | ||||
-rw-r--r-- | usr/src/cmd/devfsadm/devfsadm_impl.h | 2 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_proc.c | 33 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_statd.c | 20 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_statd.h | 16 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_svc.c | 64 | ||||
-rw-r--r-- | usr/src/pkg/manifests/developer-opensolaris-osnet.mf | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/pciex/pcie.c | 63 | ||||
-rw-r--r-- | usr/src/uts/common/io/pciex/pcie_fault.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/pciex/pcieb.c | 2 |
10 files changed, 153 insertions, 79 deletions
diff --git a/usr/src/cmd/devfsadm/devfsadm.c b/usr/src/cmd/devfsadm/devfsadm.c index 7cfcd09a81..79082ace48 100644 --- a/usr/src/cmd/devfsadm/devfsadm.c +++ b/usr/src/cmd/devfsadm/devfsadm.c @@ -390,8 +390,7 @@ main(int argc, char *argv[]) /* start the minor_fini_thread */ (void) mutex_init(&minor_fini_mutex, USYNC_THREAD, 0); (void) cond_init(&minor_fini_cv, USYNC_THREAD, 0); - if (thr_create(NULL, 0, - (void *(*)(void *))minor_fini_thread, + if (thr_create(NULL, 0, minor_fini_thread, NULL, THR_DETACHED, NULL)) { err_print(CANT_CREATE_THREAD, "minor_fini", strerror(errno)); @@ -2409,9 +2408,8 @@ load_module(char *mname, char *cdir) * within 'timeout' secs the minor_fini_thread needs to do a SYNC_STATE * so that we still call the minor_fini routines. */ -/*ARGSUSED*/ -static void -minor_fini_thread(void *arg) +static void * +minor_fini_thread(void *arg __unused) { timestruc_t abstime; @@ -2444,6 +2442,7 @@ minor_fini_thread(void *arg) (void) mutex_lock(&minor_fini_mutex); } + return (NULL); } @@ -4319,11 +4318,11 @@ hot_cleanup(char *node_path, char *minor_name, char *ev_subclass, (void) snprintf(rmlink, sizeof (rmlink), "%s", link->devlink); if (rm->remove->flags & RM_NOINTERPOSE) { - ((void (*)(char *)) - (rm->remove->callback_fcn))(rmlink); + (void) + (rm->remove->callback_fcn)(rmlink); } else { - ret = ((int (*)(char *)) - (rm->remove->callback_fcn))(rmlink); + ret = + (rm->remove->callback_fcn)(rmlink); if (ret == DEVFSADM_TERMINATE) nfphash_insert(rmlink); } @@ -4463,11 +4462,11 @@ matching_dev(char *devpath, void *data) vprint(RECURSEDEV_MID, "%scalling callback %s\n", fcn, devpath); if (cleanup_data->rm->remove->flags & RM_NOINTERPOSE) - ((void (*)(char *)) - (cleanup_data->rm->remove->callback_fcn))(devpath); + (void) + (cleanup_data->rm->remove->callback_fcn)(devpath); else { - ret = ((int (*)(char *)) - (cleanup_data->rm->remove->callback_fcn))(devpath); + ret = + (cleanup_data->rm->remove->callback_fcn)(devpath); if (ret == DEVFSADM_TERMINATE) { /* * We want no further remove processing for diff --git a/usr/src/cmd/devfsadm/devfsadm_impl.h b/usr/src/cmd/devfsadm/devfsadm_impl.h index b33caa1a4d..5e68e9236d 100644 --- a/usr/src/cmd/devfsadm/devfsadm_impl.h +++ b/usr/src/cmd/devfsadm/devfsadm_impl.h @@ -423,7 +423,7 @@ static int create_link_common(char *devlink, char *contents, int *exists); static char *dequote(char *src); static void parse_args(int argc, char *argv[]); static void process_devinfo_tree(void); -static void minor_fini_thread(void *arg); +static void *minor_fini_thread(void *arg); static void *s_realloc(void *ptr, const size_t size); static void read_devlinktab_file(void); static selector_list_t *create_selector_list(char *selector); diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c index cf662c97f8..f3e050df8c 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c +++ b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c @@ -96,8 +96,10 @@ extern struct lifconf *getmyaddrs(void); /* ARGSUSED */ void -sm_stat_svc(sm_name *namep, sm_stat_res *resp) +sm_stat_svc(void *arg1, void *arg2) { + sm_name *namep = arg1; + sm_stat_res *resp = arg2; if (debug) (void) printf("proc sm_stat: mon_name = %s\n", @@ -109,8 +111,10 @@ sm_stat_svc(sm_name *namep, sm_stat_res *resp) /* ARGSUSED */ void -sm_mon_svc(mon *monp, sm_stat_res *resp) +sm_mon_svc(void *arg1, void *arg2) { + mon *monp = arg1; + sm_stat_res *resp = arg2; mon_id *monidp; monidp = &monp->mon_id; @@ -135,8 +139,11 @@ sm_mon_svc(mon *monp, sm_stat_res *resp) /* ARGSUSED */ void -sm_unmon_svc(mon_id *monidp, sm_stat *resp) +sm_unmon_svc(void *arg1, void *arg2) { + mon_id *monidp = arg1; + sm_stat *resp = arg2; + rw_rdlock(&thr_rwlock); if (debug) { (void) printf( @@ -155,8 +162,11 @@ sm_unmon_svc(mon_id *monidp, sm_stat *resp) /* ARGSUSED */ void -sm_unmon_all_svc(my_id *myidp, sm_stat *resp) +sm_unmon_all_svc(void *arg1, void *arg2) { + my_id *myidp = arg1; + sm_stat *resp = arg2; + rw_rdlock(&thr_rwlock); if (debug) (void) printf("proc sm_unmon_all: [%s, %d, %d, %d]\n", @@ -173,8 +183,10 @@ sm_unmon_all_svc(my_id *myidp, sm_stat *resp) * Notifies lockd specified by name that state has changed for this server. */ void -sm_notify_svc(stat_chge *ntfp) +sm_notify_svc(void *arg, void *arg1 __unused) { + stat_chge *ntfp = arg; + rw_rdlock(&thr_rwlock); if (debug) (void) printf("sm_notify: %s state =%d\n", @@ -185,7 +197,7 @@ sm_notify_svc(stat_chge *ntfp) /* ARGSUSED */ void -sm_simu_crash_svc(void *myidp) +sm_simu_crash_svc(void *myidp, void *arg __unused) { int i; struct mon_entry *monitor_q; @@ -235,8 +247,10 @@ sm_simu_crash_svc(void *myidp) /* ARGSUSED */ void -nsmaddrproc1_reg(reg1args *regargs, reg1res *regresp) +nsmaddrproc1_reg(void *arg1, void *arg2) { + reg1args *regargs = arg1; + reg1res *regresp = arg2; nsm_addr_res status; name_addr_entry_t *entry; char *tmp_n_bytes; @@ -1174,7 +1188,8 @@ in_host_array(char *host) * nothing and leaves host_name the way it was previous to the call. */ static void -add_to_host_array(char *host) { +add_to_host_array(char *host) +{ void *new_block = NULL; @@ -1182,7 +1197,7 @@ add_to_host_array(char *host) { if (addrix >= host_name_count) { host_name_count += HOST_NAME_INCR; new_block = realloc((void *)host_name, - host_name_count*sizeof (char *)); + host_name_count * sizeof (char *)); if (new_block != NULL) host_name = new_block; else { diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_statd.c b/usr/src/cmd/fs.d/nfs/statd/sm_statd.c index e7805e7747..b8d97b7571 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_statd.c +++ b/usr/src/cmd/fs.d/nfs/statd/sm_statd.c @@ -29,7 +29,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -91,8 +91,8 @@ static void delete_name(name_entry **namepp, char *name); static void remove_name(char *name, int op, int startup); static int statd_call_statd(char *name); static void pr_name(char *name, int flag); -static void *thr_statd_init(void); -static void *sm_try(void); +static void *thr_statd_init(void *); +static void *sm_try(void *); static void *thr_call_statd(void *); static void remove_single_name(char *name, char *dir1, char *dir2); static int move_file(char *fromdir, char *file, char *todir); @@ -238,8 +238,7 @@ statd_init(void) (void) closedir(dp); /* Contact hosts' statd */ - if (thr_create(NULL, 0, (void *(*)(void *))thr_statd_init, NULL, - THR_DETACHED, NULL)) { + if (thr_create(NULL, 0, thr_statd_init, NULL, THR_DETACHED, NULL)) { syslog(LOG_ERR, "statd: unable to create thread for thr_statd_init\n"); exit(1); @@ -250,10 +249,10 @@ statd_init(void) * Work thread which contacts hosts' statd. */ static void * -thr_statd_init(void) +thr_statd_init(void *arg __unused) { struct dirent *dirp; - DIR *dp; + DIR *dp; int num_threads; int num_join; int i; @@ -435,11 +434,10 @@ thr_statd_init(void) (void) printf("Creating thread for sm_try\n"); /* Continue to notify statd on hosts that were unreachable. */ - if (thr_create(NULL, 0, (void *(*)(void *))sm_try, NULL, THR_DETACHED, - NULL)) + if (thr_create(NULL, 0, sm_try, NULL, THR_DETACHED, NULL)) syslog(LOG_ERR, "statd: unable to create thread for sm_try().\n"); - thr_exit((void *) 0); + thr_exit(NULL); #ifdef lint return (0); #endif @@ -640,7 +638,7 @@ statd_call_statd(char *name) * variable will signal it. */ void * -sm_try(void) +sm_try(void *arg __unused) { name_entry *nl, *next; timestruc_t wtime; diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_statd.h b/usr/src/cmd/fs.d/nfs/statd/sm_statd.h index aa1368b461..112a091d07 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_statd.h +++ b/usr/src/cmd/fs.d/nfs/statd/sm_statd.h @@ -30,7 +30,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -203,13 +203,13 @@ extern char *xmalloc(unsigned); * RPC service functions, slightly different here than the * generated ones in sm_inter.h */ -extern void nsmaddrproc1_reg(reg1args *, reg1res *); -extern void sm_stat_svc(sm_name *namep, sm_stat_res *resp); -extern void sm_mon_svc(mon *monp, sm_stat_res *resp); -extern void sm_unmon_svc(mon_id *monidp, sm_stat *resp); -extern void sm_unmon_all_svc(my_id *myidp, sm_stat *resp); -extern void sm_simu_crash_svc(void *myidp); -extern void sm_notify_svc(stat_chge *ntfp); +extern void nsmaddrproc1_reg(void *, void *); +extern void sm_stat_svc(void *, void *); +extern void sm_mon_svc(void *, void *); +extern void sm_unmon_svc(void *, void *); +extern void sm_unmon_all_svc(void *, void *); +extern void sm_simu_crash_svc(void *, void *); +extern void sm_notify_svc(void *, void *); extern void sm_inithash(void); extern void copydir_from_to(char *from_dir, char *to_dir); diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_svc.c b/usr/src/cmd/fs.d/nfs/statd/sm_svc.c index 8f19764116..ad000db8b3 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_svc.c +++ b/usr/src/cmd/fs.d/nfs/statd/sm_svc.c @@ -26,7 +26,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -142,41 +142,41 @@ static int nftw_owner(const char *, const struct stat *, int, struct FTW *); /* * statd protocol - * commands: - * SM_STAT - * returns stat_fail to caller - * SM_MON - * adds an entry to the monitor_q and the record_q. + * commands: + * SM_STAT + * returns stat_fail to caller + * SM_MON + * adds an entry to the monitor_q and the record_q. * This message is sent by the server lockd to the server * statd, to indicate that a new client is to be monitored. * It is also sent by the server lockd to the client statd * to indicate that a new server is to be monitored. - * SM_UNMON - * removes an entry from the monitor_q and the record_q - * SM_UNMON_ALL - * removes all entries from a particular host from the - * monitor_q and the record_q. Our statd has this - * disabled. - * SM_SIMU_CRASH - * simulate a crash. Removes everything from the - * record_q and the recovery_q, then calls statd_init() - * to restart things. This message is sent by the server + * SM_UNMON + * removes an entry from the monitor_q and the record_q + * SM_UNMON_ALL + * removes all entries from a particular host from the + * monitor_q and the record_q. Our statd has this + * disabled. + * SM_SIMU_CRASH + * simulate a crash. Removes everything from the + * record_q and the recovery_q, then calls statd_init() + * to restart things. This message is sent by the server * lockd to the server statd to have all clients notified * that they should reclaim locks. - * SM_NOTIFY + * SM_NOTIFY * Sent by statd on server to statd on client during * crash recovery. The client statd passes the info * to its lockd so it can attempt to reclaim the locks * held on the server. * * There are three main hash tables used to keep track of things. - * mon_table - * table that keeps track hosts statd must watch. If one of - * these hosts crashes, then any locks held by that host must - * be released. - * record_table - * used to keep track of all the hostname files stored in - * the directory /var/statmon/sm. These are client hosts who + * mon_table + * table that keeps track hosts statd must watch. If one of + * these hosts crashes, then any locks held by that host must + * be released. + * record_table + * used to keep track of all the hostname files stored in + * the directory /var/statmon/sm. These are client hosts who * are holding or have held a lock at some point. Needed * to determine if a file needs to be created for host in * /var/statmon/sm. @@ -210,7 +210,7 @@ sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) } result; bool_t (*xdr_argument)(), (*xdr_result)(); - char *(*local)(); + void (*local)(void *, void *); /* * Dispatch according to which protocol is being used: @@ -227,7 +227,7 @@ sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) case NSMADDRPROC1_REG: xdr_argument = xdr_reg1args; xdr_result = xdr_reg1res; - local = (char *(*)()) nsmaddrproc1_reg; + local = nsmaddrproc1_reg; break; case NSMADDRPROC1_UNREG: /* Not impl. */ @@ -245,37 +245,37 @@ sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) case SM_STAT: xdr_argument = xdr_sm_name; xdr_result = xdr_sm_stat_res; - local = (char *(*)()) sm_stat_svc; + local = sm_stat_svc; break; case SM_MON: xdr_argument = xdr_mon; xdr_result = xdr_sm_stat_res; - local = (char *(*)()) sm_mon_svc; + local = sm_mon_svc; break; case SM_UNMON: xdr_argument = xdr_mon_id; xdr_result = xdr_sm_stat; - local = (char *(*)()) sm_unmon_svc; + local = sm_unmon_svc; break; case SM_UNMON_ALL: xdr_argument = xdr_my_id; xdr_result = xdr_sm_stat; - local = (char *(*)()) sm_unmon_all_svc; + local = sm_unmon_all_svc; break; case SM_SIMU_CRASH: xdr_argument = xdr_void; xdr_result = xdr_void; - local = (char *(*)()) sm_simu_crash_svc; + local = sm_simu_crash_svc; break; case SM_NOTIFY: xdr_argument = xdr_stat_chge; xdr_result = xdr_void; - local = (char *(*)()) sm_notify_svc; + local = sm_notify_svc; break; default: diff --git a/usr/src/pkg/manifests/developer-opensolaris-osnet.mf b/usr/src/pkg/manifests/developer-opensolaris-osnet.mf index ca27aff134..26a3b6c9d8 100644 --- a/usr/src/pkg/manifests/developer-opensolaris-osnet.mf +++ b/usr/src/pkg/manifests/developer-opensolaris-osnet.mf @@ -53,7 +53,6 @@ depend fmri=print/filter/ghostscript@8.64-0.133 type=require depend fmri=runtime/perl$(PERL_PKGVERS)@5.10.0-0.133 type=require depend fmri=system/header@0.5.11-0.133 type=require depend fmri=system/library/dbus@0.5.11-0.133 type=require -depend fmri=system/library/install@0.5.11-0.133 type=require depend fmri=system/library/libdbus-glib@0.5.11-0.133 type=require depend fmri=system/library/libdbus@0.5.11-0.133 type=require depend fmri=system/library/mozilla-nss/header-nss@0.5.11-0.133 type=require diff --git a/usr/src/uts/common/io/pciex/pcie.c b/usr/src/uts/common/io/pciex/pcie.c index 3be7aeac6e..35a0190be7 100644 --- a/usr/src/uts/common/io/pciex/pcie.c +++ b/usr/src/uts/common/io/pciex/pcie.c @@ -145,6 +145,13 @@ int pcie_max_mps = PCIE_DEVCTL_MAX_PAYLOAD_4096 >> 5; int pcie_disable_ari = 0; /* + * On some platforms, such as the AMD B450 chipset, we've seen an odd + * relationship between enabling link bandwidth notifications and AERs about + * ECRC errors. This provides a mechanism to disable it. + */ +int pcie_disable_lbw = 0; + +/* * Amount of time to wait for an in-progress retraining. The default is to try * 500 times in 10ms chunks, thus a total of 5s. */ @@ -559,6 +566,56 @@ pcie_determine_serial(dev_info_t *dip) serial, sizeof (serial)); } +static void +pcie_determine_aspm(dev_info_t *dip) +{ + pcie_bus_t *bus_p = PCIE_DIP2BUS(dip); + uint32_t linkcap; + uint16_t linkctl; + + if (!PCIE_IS_PCIE(bus_p)) + return; + + linkcap = PCIE_CAP_GET(32, bus_p, PCIE_LINKCAP); + linkctl = PCIE_CAP_GET(16, bus_p, PCIE_LINKCTL); + + switch (linkcap & PCIE_LINKCAP_ASPM_SUP_MASK) { + case PCIE_LINKCAP_ASPM_SUP_L0S: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-support", "l0s"); + break; + case PCIE_LINKCAP_ASPM_SUP_L1: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-support", "l1"); + break; + case PCIE_LINKCAP_ASPM_SUP_L0S_L1: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-support", "l0s,l1"); + break; + default: + return; + } + + switch (linkctl & PCIE_LINKCTL_ASPM_CTL_MASK) { + case PCIE_LINKCTL_ASPM_CTL_DIS: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-state", "disabled"); + break; + case PCIE_LINKCTL_ASPM_CTL_L0S: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-state", "l0s"); + break; + case PCIE_LINKCTL_ASPM_CTL_L1: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-state", "l1"); + break; + case PCIE_LINKCTL_ASPM_CTL_L0S_L1: + (void) ndi_prop_update_string(DDI_DEV_T_NONE, dip, + "pcie-aspm-state", "l0s,l1"); + break; + } +} + /* * PCI-Express child device initialization. * This function enables generic pci-express interrupts and error @@ -704,6 +761,8 @@ pcie_initchild(dev_info_t *cdip) pcie_determine_serial(cdip); + pcie_determine_aspm(cdip); + pcie_capture_speeds(cdip); } @@ -2859,6 +2918,10 @@ pcie_link_bw_enable(dev_info_t *dip) uint16_t linkctl; pcie_bus_t *bus_p = PCIE_DIP2BUS(dip); + if (pcie_disable_lbw != 0) { + return (DDI_FAILURE); + } + if (!pcie_link_bw_supported(dip)) { return (DDI_FAILURE); } diff --git a/usr/src/uts/common/io/pciex/pcie_fault.c b/usr/src/uts/common/io/pciex/pcie_fault.c index 3f14041e80..de558a9fc6 100644 --- a/usr/src/uts/common/io/pciex/pcie_fault.c +++ b/usr/src/uts/common/io/pciex/pcie_fault.c @@ -1236,7 +1236,7 @@ const pf_fab_err_tbl_t pcie_pcie_tbl[] = { {PCIE_AER_UCE_MTLP, pf_panic, PF_AFFECTED_PARENT, 0}, - {PCIE_AER_UCE_ECRC, pf_panic, + {PCIE_AER_UCE_ECRC, pf_no_panic, PF_AFFECTED_SELF, 0}, {PCIE_AER_UCE_UR, pf_analyse_ca_ur, @@ -1277,7 +1277,7 @@ const pf_fab_err_tbl_t pcie_rp_tbl[] = { PF_AFFECTED_SELF | PF_AFFECTED_AER, PF_AFFECTED_SELF | PF_AFFECTED_CHILDREN}, - {PCIE_AER_UCE_ECRC, pf_panic, + {PCIE_AER_UCE_ECRC, pf_no_panic, PF_AFFECTED_AER, PF_AFFECTED_CHILDREN}, {PCIE_AER_UCE_UR, pf_no_panic, @@ -1318,7 +1318,7 @@ const pf_fab_err_tbl_t pcie_sw_tbl[] = { PF_AFFECTED_SELF | PF_AFFECTED_AER, PF_AFFECTED_SELF | PF_AFFECTED_CHILDREN}, - {PCIE_AER_UCE_ECRC, pf_panic, + {PCIE_AER_UCE_ECRC, pf_no_panic, PF_AFFECTED_AER, PF_AFFECTED_SELF | PF_AFFECTED_CHILDREN}, {PCIE_AER_UCE_UR, pf_analyse_ca_ur, diff --git a/usr/src/uts/common/io/pciex/pcieb.c b/usr/src/uts/common/io/pciex/pcieb.c index c9d65748bb..d81a12b6c0 100644 --- a/usr/src/uts/common/io/pciex/pcieb.c +++ b/usr/src/uts/common/io/pciex/pcieb.c @@ -122,7 +122,7 @@ * changes to the negotiated link bandwidth. These events are managed by * enabling support for the interrupts in the PCI Express Capability Structure. * This is all taken care of by the pcie driver through functions like - * pcie_link_bw_enabled(). + * pcie_link_bw_enable(). * * The second aspect of link management the pcieb driver enables is the ability * to retrain the link and optionally limit the speed. This is enabled through a |