/* * (C) 2011 Thomas Renninger , Novell Inc. * * Licensed under the terms of the GNU GPL License version 2. */ #include #include #include #include #include #include #include "helpers/helpers.h" #include "helpers/sysfs.h" #include "helpers/bitmask.h" static struct option set_opts[] = { {"perf-bias", required_argument, NULL, 'b'}, { }, }; static void print_wrong_arg_exit(void) { printf(_("invalid or unknown argument\n")); exit(EXIT_FAILURE); } int cmd_set(int argc, char **argv) { extern char *optarg; extern int optind, opterr, optopt; unsigned int cpu; union { struct { int perf_bias:1; }; int params; } params; int perf_bias = 0; int ret = 0; setlocale(LC_ALL, ""); textdomain(PACKAGE); params.params = 0; /* parameter parsing */ while ((ret = getopt_long(argc, argv, "b:", set_opts, NULL)) != -1) { switch (ret) { case 'b': if (params.perf_bias) print_wrong_arg_exit(); perf_bias = atoi(optarg); if (perf_bias < 0 || perf_bias > 15) { printf(_("--perf-bias param out " "of range [0-%d]\n"), 15); print_wrong_arg_exit(); } params.perf_bias = 1; break; default: print_wrong_arg_exit(); } }; if (!params.params) print_wrong_arg_exit(); /* Default is: set all CPUs */ if (bitmask_isallclear(cpus_chosen)) bitmask_setall(cpus_chosen); /* loop over CPUs */ for (cpu = bitmask_first(cpus_chosen); cpu <= bitmask_last(cpus_chosen); cpu++) { if (!bitmask_isbitset(cpus_chosen, cpu)) continue; if (sysfs_is_cpu_online(cpu) != 1){ fprintf(stderr, _("Cannot set values on CPU %d:"), cpu); fprintf(stderr, _(" *is offline\n")); continue; } if (params.perf_bias) { ret = msr_intel_set_perf_bias(cpu, perf_bias); if (ret) { fprintf(stderr, _("Error setting perf-bias " "value on CPU %d\n"), cpu); break; } } } return ret; } lass='active' href='/cgit.cgi/linux/net-next.git/commit/drivers/usb?h=nds-private-remove&id=4d191b1b63c209e37bf27938ef365244d3c41084'>commitdiff
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-01-17 14:21:56 +0000
committerBjorn Helgaas <bhelgaas@google.com>2017-01-17 08:41:51 -0600
commit4d191b1b63c209e37bf27938ef365244d3c41084 (patch)
treef2ab6cdb65ddacdf2e7c019cd55e353f0c16b400 /drivers/usb
parent51ebfc92b72b4f7dac1ab45683bf56741e454b8c (diff)
PCI/MSI: pci-xgene-msi: Fix CPU hotplug registration handling
The conversion to the new hotplug state machine introduced a regression where a successful hotplug registration would be treated as an error, effectively disabling the MSI driver forever. Fix it by doing the proper check on the return value. Fixes: 9c248f8896e6 ("PCI/xgene-msi: Convert to hotplug state machine") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Tested-by: Duc Dang <dhdang@apm.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: stable@vger.kernel.org
Diffstat (limited to 'drivers/usb')