diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-11-25 06:54:16 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-28 02:47:29 -0500 |
commit | 7c7320157a37ed459b59e2f6b53b73780b12ad80 (patch) | |
tree | 0c818fb95279b19b1954c408858536a384bffcd7 | |
parent | 37e661ee10c6d0d1310c62b3d29ae9a63073ac5d (diff) |
ALSA: hda - Allow forcibly enabling/disabling snoop
User can pass snoop option to enable/disable the snoop behavior, but
currently azx_check_snoop_available() always turns it off for some
devices. For better debuggability, change the parameter as bint, and
allow user to enable/disable forcibly the snoop when specified via the
module option.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_intel.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 633020de9bd2..728663d6746f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -196,8 +196,8 @@ MODULE_PARM_DESC(align_buffer_size, | |||
196 | "Force buffer and period sizes to be multiple of 128 bytes."); | 196 | "Force buffer and period sizes to be multiple of 128 bytes."); |
197 | 197 | ||
198 | #ifdef CONFIG_X86 | 198 | #ifdef CONFIG_X86 |
199 | static bool hda_snoop = true; | 199 | static int hda_snoop = -1; |
200 | module_param_named(snoop, hda_snoop, bool, 0444); | 200 | module_param_named(snoop, hda_snoop, bint, 0444); |
201 | MODULE_PARM_DESC(snoop, "Enable/disable snooping"); | 201 | MODULE_PARM_DESC(snoop, "Enable/disable snooping"); |
202 | #else | 202 | #else |
203 | #define hda_snoop true | 203 | #define hda_snoop true |
@@ -1370,29 +1370,33 @@ static void check_msi(struct azx *chip) | |||
1370 | /* check the snoop mode availability */ | 1370 | /* check the snoop mode availability */ |
1371 | static void azx_check_snoop_available(struct azx *chip) | 1371 | static void azx_check_snoop_available(struct azx *chip) |
1372 | { | 1372 | { |
1373 | bool snoop = chip->snoop; | 1373 | int snoop = hda_snoop; |
1374 | 1374 | ||
1375 | if (snoop >= 0) { | ||
1376 | dev_info(chip->card->dev, "Force to %s mode by module option\n", | ||
1377 | snoop ? "snoop" : "non-snoop"); | ||
1378 | chip->snoop = snoop; | ||
1379 | return; | ||
1380 | } | ||
1381 | |||
1382 | snoop = true; | ||
1375 | if (azx_get_snoop_type(chip) == AZX_SNOOP_TYPE_NONE && | 1383 | if (azx_get_snoop_type(chip) == AZX_SNOOP_TYPE_NONE && |
1376 | chip->driver_type == AZX_DRIVER_VIA) { | 1384 | chip->driver_type == AZX_DRIVER_VIA) { |
1377 | /* force to non-snoop mode for a new VIA controller | 1385 | /* force to non-snoop mode for a new VIA controller |
1378 | * when BIOS is set | 1386 | * when BIOS is set |
1379 | */ | 1387 | */ |
1380 | if (snoop) { | 1388 | u8 val; |
1381 | u8 val; | 1389 | pci_read_config_byte(chip->pci, 0x42, &val); |
1382 | pci_read_config_byte(chip->pci, 0x42, &val); | 1390 | if (!(val & 0x80) && chip->pci->revision == 0x30) |
1383 | if (!(val & 0x80) && chip->pci->revision == 0x30) | 1391 | snoop = false; |
1384 | snoop = false; | ||
1385 | } | ||
1386 | } | 1392 | } |
1387 | 1393 | ||
1388 | if (chip->driver_caps & AZX_DCAPS_SNOOP_OFF) | 1394 | if (chip->driver_caps & AZX_DCAPS_SNOOP_OFF) |
1389 | snoop = false; | 1395 | snoop = false; |
1390 | 1396 | ||
1391 | if (snoop != chip->snoop) { | 1397 | chip->snoop = snoop; |
1392 | dev_info(chip->card->dev, "Force to %s mode\n", | 1398 | if (!snoop) |
1393 | snoop ? "snoop" : "non-snoop"); | 1399 | dev_info(chip->card->dev, "Force to non-snoop mode\n"); |
1394 | chip->snoop = snoop; | ||
1395 | } | ||
1396 | } | 1400 | } |
1397 | 1401 | ||
1398 | static void azx_probe_work(struct work_struct *work) | 1402 | static void azx_probe_work(struct work_struct *work) |
@@ -1452,7 +1456,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, | |||
1452 | check_probe_mask(chip, dev); | 1456 | check_probe_mask(chip, dev); |
1453 | 1457 | ||
1454 | chip->single_cmd = single_cmd; | 1458 | chip->single_cmd = single_cmd; |
1455 | chip->snoop = hda_snoop; | ||
1456 | azx_check_snoop_available(chip); | 1459 | azx_check_snoop_available(chip); |
1457 | 1460 | ||
1458 | if (bdl_pos_adj[dev] < 0) { | 1461 | if (bdl_pos_adj[dev] < 0) { |