Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 783462 | Differences between
and this patch

Collapse All | Expand All

(-)a/sound/hda/hdac_bus.c (-1 lines)
Lines 44-50 int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, Link Here
44
	mutex_init(&bus->cmd_mutex);
44
	mutex_init(&bus->cmd_mutex);
45
	mutex_init(&bus->lock);
45
	mutex_init(&bus->lock);
46
	INIT_LIST_HEAD(&bus->hlink_list);
46
	INIT_LIST_HEAD(&bus->hlink_list);
47
	init_waitqueue_head(&bus->rirb_wq);
48
	bus->irq = -1;
47
	bus->irq = -1;
49
48
50
	/*
49
	/*
(-)a/sound/hda/hdac_controller.c (-3 lines)
Lines 218-226 void snd_hdac_bus_update_rirb(struct hdac_bus *bus) Link Here
218
		else if (bus->rirb.cmds[addr]) {
218
		else if (bus->rirb.cmds[addr]) {
219
			bus->rirb.res[addr] = res;
219
			bus->rirb.res[addr] = res;
220
			bus->rirb.cmds[addr]--;
220
			bus->rirb.cmds[addr]--;
221
			if (!bus->rirb.cmds[addr] &&
222
			    waitqueue_active(&bus->rirb_wq))
223
				wake_up(&bus->rirb_wq);
224
		} else {
221
		} else {
225
			dev_err_ratelimited(bus->dev,
222
			dev_err_ratelimited(bus->dev,
226
				"spurious response %#x:%#x, last cmd=%#08x\n",
223
				"spurious response %#x:%#x, last cmd=%#08x\n",
(-)a/sound/pci/hda/hda_controller.c (+47 lines)
Lines 777-785 static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr, Link Here
777
{
777
{
778
	struct azx *chip = bus_to_azx(bus);
778
	struct azx *chip = bus_to_azx(bus);
779
	struct hda_bus *hbus = &chip->bus;
779
	struct hda_bus *hbus = &chip->bus;
780
	unsigned long timeout;
781
	unsigned long loopcounter;
782
	int do_poll = 0;
783
	bool warned = false;
780
	int err;
784
	int err;
781
785
782
 again:
786
 again:
787
	timeout = jiffies + msecs_to_jiffies(1000);
788
789
	for (loopcounter = 0;; loopcounter++) {
790
		spin_lock_irq(&bus->reg_lock);
791
		if (bus->polling_mode || do_poll)
792
			snd_hdac_bus_update_rirb(bus);
793
		if (!bus->rirb.cmds[addr]) {
794
			if (!do_poll)
795
				bus->poll_count = 0;
796
			if (res)
797
				*res = bus->rirb.res[addr]; /* the last value */
798
			spin_unlock_irq(&bus->reg_lock);
799
			return 0;
800
		}
801
		spin_unlock_irq(&bus->reg_lock);
802
		if (time_after(jiffies, timeout))
803
			break;
804
#define LOOP_COUNT_MAX	3000
805
		if (hbus->core.needs_damn_long_delay ||
806
		    loopcounter > LOOP_COUNT_MAX) {
807
			if (loopcounter > LOOP_COUNT_MAX && !warned) {
808
				dev_dbg_ratelimited(chip->card->dev,
809
						    "too slow response, last cmd=%#08x\n",
810
						    bus->last_cmd[addr]);
811
				warned = true;
812
			}
813
			msleep(2); /* temporary workaround */
814
		} else {
815
			udelay(10);
816
			cond_resched();
817
		}
818
	}
819
783
	err = snd_hdac_bus_get_response(bus, addr, res);
820
	err = snd_hdac_bus_get_response(bus, addr, res);
784
	if (!err)
821
	if (!err)
785
		return 0;
822
		return 0;
Lines 787-792 static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr, Link Here
787
	if (hbus->no_response_fallback)
824
	if (hbus->no_response_fallback)
788
		return -EIO;
825
		return -EIO;
789
826
827
	if (!bus->polling_mode && bus->poll_count < 2) {
828
		dev_dbg(chip->card->dev,
829
			"azx_get_response timeout, polling the codec once: last cmd=0x%08x\n",
830
			bus->last_cmd[addr]);
831
		do_poll = 1;
832
		bus->poll_count++;
833
		goto again;
834
	}
835
836
790
	if (!bus->polling_mode) {
837
	if (!bus->polling_mode) {
791
		dev_warn(chip->card->dev,
838
		dev_warn(chip->card->dev,
792
			 "azx_get_response timeout, switching to polling mode: last cmd=0x%08x\n",
839
			 "azx_get_response timeout, switching to polling mode: last cmd=0x%08x\n",

Return to bug 783462