]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
FLR - intermediate checkin 5 3/26 - fixed logging a bit.
authorRoss Philipson <ross.philipson@citrix.com>
Thu, 26 Mar 2009 15:35:11 +0000 (11:35 -0400)
committerRoss Philipson <ross.philipson@citrix.com>
Thu, 26 Mar 2009 15:35:11 +0000 (11:35 -0400)
 Changes to be committed:
modified:   drivers/xen/pciback/pci_stub.c
modified:   drivers/xen/pciback/pciback_ops.c

drivers/xen/pciback/pci_stub.c
drivers/xen/pciback/pciback_ops.c

index 06496666b009fbe3ba58138d1dd7a781e836ddaa..ae0a97711ed673faae15e2e3e9561d6fdc525bd1 100644 (file)
@@ -725,11 +725,10 @@ static int pcistub_device_do_flr(int domain, int bus, int slot, int func)
         * reload config
         */
        if (!disable_all_flr) {
-               dev_info(&dev->dev, "FLR invoked for device\n");
                pciback_flr_device(dev);
        }
        else
-               dev_info(&dev->dev, "FLR disabled for all devices\n");
+               dev_dbg(&dev->dev, "FLR disabled for all devices\n");
 
 out:
        return err;
@@ -976,7 +975,7 @@ static ssize_t pcistub_resets(struct device_driver *drv, const char *buf,
        }
 
        /* check special wildcard noflr */
-       if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "*", 1)) {
+       if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "(*)", 3)) {
                disable_all_flr = 1;
                goto out;
        }
@@ -1043,7 +1042,7 @@ static int __init pcistub_init(void)
        if (err)
                goto out;
 
-       if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "*", 1))
+       if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "(*)", 3))
                disable_all_flr = 1; /* check special wildcard noflr */
        else
                err = pciback_parse_device_params(pci_devs_no_flr, PCIBACK_ID_TYPE_NOFLR, pcistub_device_id_add);
index 15b0e0a0c5ba358fb86ae20eee421dd138088ea5..a9ba6c774a270d8b2ddded4d8d787412391e9ea4 100644 (file)
@@ -80,11 +80,11 @@ static void pciback_do_pcie_flr(struct pci_dev *dev, int exp_pos)
        msleep(100);
        pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
        if (status & PCI_EXP_DEVSTA_TRPND) {
-               dev_info(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
+               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
                ssleep(1);
                pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
                if (status & PCI_EXP_DEVSTA_TRPND)
-                       dev_info(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
+                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
        }
 
        pci_write_config_word(dev, exp_pos + PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
@@ -281,6 +281,7 @@ void pciback_flr_device(struct pci_dev *dev)
                dev_dbg(&dev->dev, "FLR disabled for device\n");
                return;
        }
+       dev_dbg(&dev->dev, "FLR invoked for device\n");
 
        do {
                /* First, always try to do an FLR */
@@ -302,7 +303,7 @@ void pciback_flr_device(struct pci_dev *dev)
                                err = pciback_do_dstate_transition_reset(dev);
                        if (err)
                                dev_warn(&dev->dev, "FLR functionality not supported; "
-                                               "attempts to use vendor FLR or D-states failed\n");
+                                               "attempts to use vendor FLR or D-states unsuccessful\n");
                        break;
                }
 
@@ -311,7 +312,7 @@ void pciback_flr_device(struct pci_dev *dev)
                        err = pciback_do_secondary_bus_reset(dev);
                        if (err)
                                dev_warn(&dev->dev, "FLR functionality not supported; "
-                                               "attempts to use secondary bus reset failed;\n");
+                                               "attempts to use secondary bus reset unsuccessful;\n");
                        break;
                }
 
@@ -377,6 +378,8 @@ static int pciback_find_pci_flr_caps(struct pci_dev *dev)
        /* Next look for the unchained AF capabilities for FLR using specific logic */
        /* TODO */
 
+       /* TODO DEPENDING ON LOGIC - MAYBE MERGE W/ ABOVE */
+
        /* Else not found */
        return 0;
 }
@@ -441,7 +444,8 @@ static inline void test_and_schedule_op(struct pciback_device *pdev)
 /* Performing the configuration space reads/writes must not be done in atomic
  * context because some of the pci_* functions can sleep (mostly due to ACPI
  * use of semaphores). This function is intended to be called from a work
- * queue in process context taking a struct pciback_device as a parameter */
+ * queue in process context taking a struct pciback_device as a parameter
+ */
 void pciback_do_op(void *data)
 {
        struct pciback_device *pdev = data;
@@ -507,7 +511,14 @@ irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs)
        return IRQ_HANDLED;
 }
 
-int pciback_parse_device_params(const char *device_args, int type, int (*add_func) (int domain, int bus, int slot, int func, int type))
+/* Helper routine used to parse command line parameters passed to the 
+ * pciback module from the boot loader. These params all have the form
+ * of a list of one or more devices, e.g.:
+ * (XXXX:XX:XX.X)(XXXX:XX:XX.X)
+ * Which is: (domain/segment:bus:dev.func)
+ */
+int pciback_parse_device_params(const char *device_args, int type, 
+                       int (*add_func) (int domain, int bus, int slot, int func, int type))
 {
        int pos = 0;
        int err = 0;