You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (21 commits) pciehp: fix error message about getting hotplug control pci/irq: let pci_device_shutdown to call pci_msi_shutdown v2 pci/irq: restore mask_bits in msi shutdown -v3 doc: replace yet another dev with pdev for consistency in DMA-mapping.txt PCI: don't expose struct pci_vpd to userspace doc: fix an incorrect suggestion to pass NULL for PCI like buses Consistently use pdev as the variable of type struct pci_dev *. pciehp: Fix command write shpchp: fix slot name make pciehp_acpi_get_hp_hw_control_from_firmware() pciehp: Clean up pcie_init() pciehp: Mask hotplug interrupt at controller release pciehp: Remove useless hotplug interrupt enabling pciehp: Fix wrong slot capability check pciehp: Fix wrong slot control register access pciehp: Add missing memory barrier pciehp: Fix interrupt event handlig pciehp: fix slot name Update MAINTAINERS with location of PCI tree PCI: Add Intel SCH PCI IDs ...
This commit is contained in:
@@ -93,11 +93,10 @@ struct controller {
|
||||
u8 slot_device_offset;
|
||||
u32 first_slot; /* First physical slot number */ /* PCIE only has 1 slot */
|
||||
u8 slot_bus; /* Bus where the slots handled by this controller sit */
|
||||
u8 ctrlcap;
|
||||
u32 slot_cap;
|
||||
u8 cap_base;
|
||||
struct timer_list poll_timer;
|
||||
volatile int cmd_busy;
|
||||
spinlock_t lock;
|
||||
};
|
||||
|
||||
#define INT_BUTTON_IGNORE 0
|
||||
@@ -137,13 +136,13 @@ struct controller {
|
||||
#define HP_SUPR_RM_SUP 0x00000020
|
||||
#define EMI_PRSN 0x00020000
|
||||
|
||||
#define ATTN_BUTTN(cap) (cap & ATTN_BUTTN_PRSN)
|
||||
#define POWER_CTRL(cap) (cap & PWR_CTRL_PRSN)
|
||||
#define MRL_SENS(cap) (cap & MRL_SENS_PRSN)
|
||||
#define ATTN_LED(cap) (cap & ATTN_LED_PRSN)
|
||||
#define PWR_LED(cap) (cap & PWR_LED_PRSN)
|
||||
#define HP_SUPR_RM(cap) (cap & HP_SUPR_RM_SUP)
|
||||
#define EMI(cap) (cap & EMI_PRSN)
|
||||
#define ATTN_BUTTN(ctrl) ((ctrl)->slot_cap & ATTN_BUTTN_PRSN)
|
||||
#define POWER_CTRL(ctrl) ((ctrl)->slot_cap & PWR_CTRL_PRSN)
|
||||
#define MRL_SENS(ctrl) ((ctrl)->slot_cap & MRL_SENS_PRSN)
|
||||
#define ATTN_LED(ctrl) ((ctrl)->slot_cap & ATTN_LED_PRSN)
|
||||
#define PWR_LED(ctrl) ((ctrl)->slot_cap & PWR_LED_PRSN)
|
||||
#define HP_SUPR_RM(ctrl) ((ctrl)->slot_cap & HP_SUPR_RM_SUP)
|
||||
#define EMI(ctrl) ((ctrl)->slot_cap & EMI_PRSN)
|
||||
|
||||
extern int pciehp_sysfs_enable_slot(struct slot *slot);
|
||||
extern int pciehp_sysfs_disable_slot(struct slot *slot);
|
||||
|
||||
@@ -41,6 +41,7 @@ int pciehp_debug;
|
||||
int pciehp_poll_mode;
|
||||
int pciehp_poll_time;
|
||||
int pciehp_force;
|
||||
int pciehp_slot_with_bus;
|
||||
struct workqueue_struct *pciehp_wq;
|
||||
|
||||
#define DRIVER_VERSION "0.4"
|
||||
@@ -55,10 +56,12 @@ module_param(pciehp_debug, bool, 0644);
|
||||
module_param(pciehp_poll_mode, bool, 0644);
|
||||
module_param(pciehp_poll_time, int, 0644);
|
||||
module_param(pciehp_force, bool, 0644);
|
||||
module_param(pciehp_slot_with_bus, bool, 0644);
|
||||
MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not");
|
||||
MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not");
|
||||
MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");
|
||||
MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if _OSC and OSHP are missing");
|
||||
MODULE_PARM_DESC(pciehp_slot_with_bus, "Use bus number in the slot name");
|
||||
|
||||
#define PCIE_MODULE_NAME "pciehp"
|
||||
|
||||
@@ -193,8 +196,12 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
|
||||
|
||||
static void make_slot_name(struct slot *slot)
|
||||
{
|
||||
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d",
|
||||
slot->bus, slot->number);
|
||||
if (pciehp_slot_with_bus)
|
||||
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d",
|
||||
slot->bus, slot->number);
|
||||
else
|
||||
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d",
|
||||
slot->number);
|
||||
}
|
||||
|
||||
static int init_slots(struct controller *ctrl)
|
||||
@@ -251,7 +258,7 @@ static int init_slots(struct controller *ctrl)
|
||||
goto error_info;
|
||||
}
|
||||
/* create additional sysfs entries */
|
||||
if (EMI(ctrl->ctrlcap)) {
|
||||
if (EMI(ctrl)) {
|
||||
retval = sysfs_create_file(&hotplug_slot->kobj,
|
||||
&hotplug_slot_attr_lock.attr);
|
||||
if (retval) {
|
||||
@@ -284,7 +291,7 @@ static void cleanup_slots(struct controller *ctrl)
|
||||
list_for_each_safe(tmp, next, &ctrl->slot_list) {
|
||||
slot = list_entry(tmp, struct slot, slot_list);
|
||||
list_del(&slot->slot_list);
|
||||
if (EMI(ctrl->ctrlcap))
|
||||
if (EMI(ctrl))
|
||||
sysfs_remove_file(&slot->hotplug_slot->kobj,
|
||||
&hotplug_slot_attr_lock.attr);
|
||||
cancel_delayed_work(&slot->work);
|
||||
@@ -305,7 +312,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
|
||||
|
||||
hotplug_slot->info->attention_status = status;
|
||||
|
||||
if (ATTN_LED(slot->ctrl->ctrlcap))
|
||||
if (ATTN_LED(slot->ctrl))
|
||||
slot->hpc_ops->set_attention_status(slot, status);
|
||||
|
||||
return 0;
|
||||
@@ -472,7 +479,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
|
||||
if (rc) /* -ENODEV: shouldn't happen, but deal with it */
|
||||
value = 0;
|
||||
}
|
||||
if ((POWER_CTRL(ctrl->ctrlcap)) && !value) {
|
||||
if ((POWER_CTRL(ctrl)) && !value) {
|
||||
rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/
|
||||
if (rc)
|
||||
goto err_out_free_ctrl_slot;
|
||||
|
||||
@@ -178,7 +178,7 @@ u8 pciehp_handle_power_fault(u8 hp_slot, struct controller *ctrl)
|
||||
static void set_slot_off(struct controller *ctrl, struct slot * pslot)
|
||||
{
|
||||
/* turn off slot, turn on Amber LED, turn off Green LED if supported*/
|
||||
if (POWER_CTRL(ctrl->ctrlcap)) {
|
||||
if (POWER_CTRL(ctrl)) {
|
||||
if (pslot->hpc_ops->power_off_slot(pslot)) {
|
||||
err("%s: Issue of Slot Power Off command failed\n",
|
||||
__func__);
|
||||
@@ -186,10 +186,10 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
|
||||
}
|
||||
}
|
||||
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
pslot->hpc_ops->green_led_off(pslot);
|
||||
|
||||
if (ATTN_LED(ctrl->ctrlcap)) {
|
||||
if (ATTN_LED(ctrl)) {
|
||||
if (pslot->hpc_ops->set_attention_status(pslot, 1)) {
|
||||
err("%s: Issue of Set Attention Led command failed\n",
|
||||
__func__);
|
||||
@@ -214,14 +214,14 @@ static int board_added(struct slot *p_slot)
|
||||
__func__, p_slot->device,
|
||||
ctrl->slot_device_offset, p_slot->hp_slot);
|
||||
|
||||
if (POWER_CTRL(ctrl->ctrlcap)) {
|
||||
if (POWER_CTRL(ctrl)) {
|
||||
/* Power on slot */
|
||||
retval = p_slot->hpc_ops->power_on_slot(p_slot);
|
||||
if (retval)
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
p_slot->hpc_ops->green_led_blink(p_slot);
|
||||
|
||||
/* Wait for ~1 second */
|
||||
@@ -254,7 +254,7 @@ static int board_added(struct slot *p_slot)
|
||||
*/
|
||||
if (pcie_mch_quirk)
|
||||
pci_fixup_device(pci_fixup_final, ctrl->pci_dev);
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
p_slot->hpc_ops->green_led_on(p_slot);
|
||||
|
||||
return 0;
|
||||
@@ -279,7 +279,7 @@ static int remove_board(struct slot *p_slot)
|
||||
|
||||
dbg("In %s, hp_slot = %d\n", __func__, p_slot->hp_slot);
|
||||
|
||||
if (POWER_CTRL(ctrl->ctrlcap)) {
|
||||
if (POWER_CTRL(ctrl)) {
|
||||
/* power off slot */
|
||||
retval = p_slot->hpc_ops->power_off_slot(p_slot);
|
||||
if (retval) {
|
||||
@@ -289,7 +289,7 @@ static int remove_board(struct slot *p_slot)
|
||||
}
|
||||
}
|
||||
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
/* turn off Green LED */
|
||||
p_slot->hpc_ops->green_led_off(p_slot);
|
||||
|
||||
@@ -327,7 +327,7 @@ static void pciehp_power_thread(struct work_struct *work)
|
||||
case POWERON_STATE:
|
||||
mutex_unlock(&p_slot->lock);
|
||||
if (pciehp_enable_slot(p_slot) &&
|
||||
PWR_LED(p_slot->ctrl->ctrlcap))
|
||||
PWR_LED(p_slot->ctrl))
|
||||
p_slot->hpc_ops->green_led_off(p_slot);
|
||||
mutex_lock(&p_slot->lock);
|
||||
p_slot->state = STATIC_STATE;
|
||||
@@ -409,9 +409,9 @@ static void handle_button_press_event(struct slot *p_slot)
|
||||
"press.\n", p_slot->name);
|
||||
}
|
||||
/* blink green LED and turn off amber */
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
p_slot->hpc_ops->green_led_blink(p_slot);
|
||||
if (ATTN_LED(ctrl->ctrlcap))
|
||||
if (ATTN_LED(ctrl))
|
||||
p_slot->hpc_ops->set_attention_status(p_slot, 0);
|
||||
|
||||
schedule_delayed_work(&p_slot->work, 5*HZ);
|
||||
@@ -427,13 +427,13 @@ static void handle_button_press_event(struct slot *p_slot)
|
||||
dbg("%s: button cancel\n", __func__);
|
||||
cancel_delayed_work(&p_slot->work);
|
||||
if (p_slot->state == BLINKINGOFF_STATE) {
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
p_slot->hpc_ops->green_led_on(p_slot);
|
||||
} else {
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
p_slot->hpc_ops->green_led_off(p_slot);
|
||||
}
|
||||
if (ATTN_LED(ctrl->ctrlcap))
|
||||
if (ATTN_LED(ctrl))
|
||||
p_slot->hpc_ops->set_attention_status(p_slot, 0);
|
||||
info("PCI slot #%s - action canceled due to button press\n",
|
||||
p_slot->name);
|
||||
@@ -492,16 +492,16 @@ static void interrupt_event_handler(struct work_struct *work)
|
||||
handle_button_press_event(p_slot);
|
||||
break;
|
||||
case INT_POWER_FAULT:
|
||||
if (!POWER_CTRL(ctrl->ctrlcap))
|
||||
if (!POWER_CTRL(ctrl))
|
||||
break;
|
||||
if (ATTN_LED(ctrl->ctrlcap))
|
||||
if (ATTN_LED(ctrl))
|
||||
p_slot->hpc_ops->set_attention_status(p_slot, 1);
|
||||
if (PWR_LED(ctrl->ctrlcap))
|
||||
if (PWR_LED(ctrl))
|
||||
p_slot->hpc_ops->green_led_off(p_slot);
|
||||
break;
|
||||
case INT_PRESENCE_ON:
|
||||
case INT_PRESENCE_OFF:
|
||||
if (!HP_SUPR_RM(ctrl->ctrlcap))
|
||||
if (!HP_SUPR_RM(ctrl))
|
||||
break;
|
||||
dbg("Surprise Removal\n");
|
||||
update_slot_info(p_slot);
|
||||
@@ -531,7 +531,7 @@ int pciehp_enable_slot(struct slot *p_slot)
|
||||
mutex_unlock(&p_slot->ctrl->crit_sect);
|
||||
return -ENODEV;
|
||||
}
|
||||
if (MRL_SENS(p_slot->ctrl->ctrlcap)) {
|
||||
if (MRL_SENS(p_slot->ctrl)) {
|
||||
rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
|
||||
if (rc || getstatus) {
|
||||
info("%s: latch open on slot(%s)\n", __func__,
|
||||
@@ -541,7 +541,7 @@ int pciehp_enable_slot(struct slot *p_slot)
|
||||
}
|
||||
}
|
||||
|
||||
if (POWER_CTRL(p_slot->ctrl->ctrlcap)) {
|
||||
if (POWER_CTRL(p_slot->ctrl)) {
|
||||
rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
|
||||
if (rc || getstatus) {
|
||||
info("%s: already enabled on slot(%s)\n", __func__,
|
||||
@@ -576,7 +576,7 @@ int pciehp_disable_slot(struct slot *p_slot)
|
||||
/* Check to see if (latch closed, card present, power on) */
|
||||
mutex_lock(&p_slot->ctrl->crit_sect);
|
||||
|
||||
if (!HP_SUPR_RM(p_slot->ctrl->ctrlcap)) {
|
||||
if (!HP_SUPR_RM(p_slot->ctrl)) {
|
||||
ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);
|
||||
if (ret || !getstatus) {
|
||||
info("%s: no adapter on slot(%s)\n", __func__,
|
||||
@@ -586,7 +586,7 @@ int pciehp_disable_slot(struct slot *p_slot)
|
||||
}
|
||||
}
|
||||
|
||||
if (MRL_SENS(p_slot->ctrl->ctrlcap)) {
|
||||
if (MRL_SENS(p_slot->ctrl)) {
|
||||
ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);
|
||||
if (ret || getstatus) {
|
||||
info("%s: latch open on slot(%s)\n", __func__,
|
||||
@@ -596,7 +596,7 @@ int pciehp_disable_slot(struct slot *p_slot)
|
||||
}
|
||||
}
|
||||
|
||||
if (POWER_CTRL(p_slot->ctrl->ctrlcap)) {
|
||||
if (POWER_CTRL(p_slot->ctrl)) {
|
||||
ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);
|
||||
if (ret || !getstatus) {
|
||||
info("%s: already disabled slot(%s)\n", __func__,
|
||||
|
||||
+179
-394
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,7 @@
|
||||
int shpchp_debug;
|
||||
int shpchp_poll_mode;
|
||||
int shpchp_poll_time;
|
||||
int shpchp_slot_with_bus;
|
||||
struct workqueue_struct *shpchp_wq;
|
||||
|
||||
#define DRIVER_VERSION "0.4"
|
||||
@@ -52,9 +53,11 @@ MODULE_LICENSE("GPL");
|
||||
module_param(shpchp_debug, bool, 0644);
|
||||
module_param(shpchp_poll_mode, bool, 0644);
|
||||
module_param(shpchp_poll_time, int, 0644);
|
||||
module_param(shpchp_slot_with_bus, bool, 0644);
|
||||
MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
|
||||
MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
|
||||
MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
|
||||
MODULE_PARM_DESC(shpchp_slot_with_bus, "Use bus number in the slot name");
|
||||
|
||||
#define SHPC_MODULE_NAME "shpchp"
|
||||
|
||||
@@ -100,8 +103,12 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
|
||||
|
||||
static void make_slot_name(struct slot *slot)
|
||||
{
|
||||
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d",
|
||||
slot->bus, slot->number);
|
||||
if (shpchp_slot_with_bus)
|
||||
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%04d_%04d",
|
||||
slot->bus, slot->number);
|
||||
else
|
||||
snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d",
|
||||
slot->number);
|
||||
}
|
||||
|
||||
static int init_slots(struct controller *ctrl)
|
||||
|
||||
+40
-16
@@ -123,7 +123,7 @@ static void msix_flush_writes(unsigned int irq)
|
||||
}
|
||||
}
|
||||
|
||||
static void msi_set_mask_bit(unsigned int irq, int flag)
|
||||
static void msi_set_mask_bits(unsigned int irq, u32 mask, u32 flag)
|
||||
{
|
||||
struct msi_desc *entry;
|
||||
|
||||
@@ -137,8 +137,8 @@ static void msi_set_mask_bit(unsigned int irq, int flag)
|
||||
|
||||
pos = (long)entry->mask_base;
|
||||
pci_read_config_dword(entry->dev, pos, &mask_bits);
|
||||
mask_bits &= ~(1);
|
||||
mask_bits |= flag;
|
||||
mask_bits &= ~(mask);
|
||||
mask_bits |= flag & mask;
|
||||
pci_write_config_dword(entry->dev, pos, mask_bits);
|
||||
} else {
|
||||
msi_set_enable(entry->dev, !flag);
|
||||
@@ -241,13 +241,13 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg)
|
||||
|
||||
void mask_msi_irq(unsigned int irq)
|
||||
{
|
||||
msi_set_mask_bit(irq, 1);
|
||||
msi_set_mask_bits(irq, 1, 1);
|
||||
msix_flush_writes(irq);
|
||||
}
|
||||
|
||||
void unmask_msi_irq(unsigned int irq)
|
||||
{
|
||||
msi_set_mask_bit(irq, 0);
|
||||
msi_set_mask_bits(irq, 1, 0);
|
||||
msix_flush_writes(irq);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,8 @@ static void __pci_restore_msi_state(struct pci_dev *dev)
|
||||
msi_set_enable(dev, 0);
|
||||
write_msi_msg(dev->irq, &entry->msg);
|
||||
if (entry->msi_attrib.maskbit)
|
||||
msi_set_mask_bit(dev->irq, entry->msi_attrib.masked);
|
||||
msi_set_mask_bits(dev->irq, entry->msi_attrib.maskbits_mask,
|
||||
entry->msi_attrib.masked);
|
||||
|
||||
pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control);
|
||||
control &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE);
|
||||
@@ -315,7 +316,7 @@ static void __pci_restore_msix_state(struct pci_dev *dev)
|
||||
|
||||
list_for_each_entry(entry, &dev->msi_list, list) {
|
||||
write_msi_msg(entry->irq, &entry->msg);
|
||||
msi_set_mask_bit(entry->irq, entry->msi_attrib.masked);
|
||||
msi_set_mask_bits(entry->irq, 1, entry->msi_attrib.masked);
|
||||
}
|
||||
|
||||
BUG_ON(list_empty(&dev->msi_list));
|
||||
@@ -382,6 +383,7 @@ static int msi_capability_init(struct pci_dev *dev)
|
||||
pci_write_config_dword(dev,
|
||||
msi_mask_bits_reg(pos, is_64bit_address(control)),
|
||||
maskbits);
|
||||
entry->msi_attrib.maskbits_mask = temp;
|
||||
}
|
||||
list_add_tail(&entry->list, &dev->msi_list);
|
||||
|
||||
@@ -569,10 +571,9 @@ int pci_enable_msi(struct pci_dev* dev)
|
||||
}
|
||||
EXPORT_SYMBOL(pci_enable_msi);
|
||||
|
||||
void pci_disable_msi(struct pci_dev* dev)
|
||||
void pci_msi_shutdown(struct pci_dev* dev)
|
||||
{
|
||||
struct msi_desc *entry;
|
||||
int default_irq;
|
||||
|
||||
if (!pci_msi_enable || !dev || !dev->msi_enabled)
|
||||
return;
|
||||
@@ -583,15 +584,31 @@ void pci_disable_msi(struct pci_dev* dev)
|
||||
|
||||
BUG_ON(list_empty(&dev->msi_list));
|
||||
entry = list_entry(dev->msi_list.next, struct msi_desc, list);
|
||||
if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI) {
|
||||
return;
|
||||
/* Return the the pci reset with msi irqs unmasked */
|
||||
if (entry->msi_attrib.maskbit) {
|
||||
u32 mask = entry->msi_attrib.maskbits_mask;
|
||||
msi_set_mask_bits(dev->irq, mask, ~mask);
|
||||
}
|
||||
|
||||
default_irq = entry->msi_attrib.default_irq;
|
||||
msi_free_irqs(dev);
|
||||
if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI)
|
||||
return;
|
||||
|
||||
/* Restore dev->irq to its default pin-assertion irq */
|
||||
dev->irq = default_irq;
|
||||
dev->irq = entry->msi_attrib.default_irq;
|
||||
}
|
||||
void pci_disable_msi(struct pci_dev* dev)
|
||||
{
|
||||
struct msi_desc *entry;
|
||||
|
||||
if (!pci_msi_enable || !dev || !dev->msi_enabled)
|
||||
return;
|
||||
|
||||
pci_msi_shutdown(dev);
|
||||
|
||||
entry = list_entry(dev->msi_list.next, struct msi_desc, list);
|
||||
if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI)
|
||||
return;
|
||||
|
||||
msi_free_irqs(dev);
|
||||
}
|
||||
EXPORT_SYMBOL(pci_disable_msi);
|
||||
|
||||
@@ -684,7 +701,7 @@ static void msix_free_all_irqs(struct pci_dev *dev)
|
||||
msi_free_irqs(dev);
|
||||
}
|
||||
|
||||
void pci_disable_msix(struct pci_dev* dev)
|
||||
void pci_msix_shutdown(struct pci_dev* dev)
|
||||
{
|
||||
if (!pci_msi_enable || !dev || !dev->msix_enabled)
|
||||
return;
|
||||
@@ -692,6 +709,13 @@ void pci_disable_msix(struct pci_dev* dev)
|
||||
msix_set_enable(dev, 0);
|
||||
pci_intx_for_msi(dev, 1);
|
||||
dev->msix_enabled = 0;
|
||||
}
|
||||
void pci_disable_msix(struct pci_dev* dev)
|
||||
{
|
||||
if (!pci_msi_enable || !dev || !dev->msix_enabled)
|
||||
return;
|
||||
|
||||
pci_msix_shutdown(dev);
|
||||
|
||||
msix_free_all_irqs(dev);
|
||||
}
|
||||
|
||||
@@ -360,6 +360,8 @@ static void pci_device_shutdown(struct device *dev)
|
||||
|
||||
if (drv && drv->shutdown)
|
||||
drv->shutdown(pci_dev);
|
||||
pci_msi_shutdown(pci_dev);
|
||||
pci_msix_shutdown(pci_dev);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@ source "drivers/pci/pcie/aer/Kconfig"
|
||||
config PCIEASPM
|
||||
bool "PCI Express ASPM support(Experimental)"
|
||||
depends on PCI && EXPERIMENTAL && PCIEPORTBUS
|
||||
default y
|
||||
default n
|
||||
help
|
||||
This enables PCI Express ASPM (Active State Power Management) and
|
||||
Clock Power Management. ASPM supports state L0/L0s/L1.
|
||||
|
||||
Reference in New Issue
Block a user