thunderbolt: Fix for v6.4-rc3
This includes a single fix that fixes an error when resuming from hibernation if the driver is built into the kernel. This has been in linux-next with no reported issues. -----BEGIN PGP SIGNATURE----- iQJUBAABCgA+FiEEVTdhRGBbNzLrSUBaAP2fSd+ZWKAFAmRkdaogHG1pa2Eud2Vz dGVyYmVyZ0BsaW51eC5pbnRlbC5jb20ACgkQAP2fSd+ZWKCWAg/+NnpBJAJ3qrJQ I6jp284s83bQEmrlxeAVrnMTZaSztW3vXSrE93x1nI5oT26ye3vrc8PSfU0qfvMd CuhQQrckl/s6h3YF4GvOI35S4Mle3QgzGpuK8nQfAABXNBpn97Fs7CUf4+fBFn1g gX1K9DwPg7w91HHrUonoXqP/ZRnu7x4PLDqO+cJhrT4mJbUv4vNhv37VXiaOCVuM yT7FKhHZQXXe47vXFZv0dQpDBKTRIghBYQuZUNphtMYgT8mOgi/XvH4olRcJcrUl hoxhSgg6w4JkzxBWo8RA8OqbVocdsJhYP9YXPP0OZexiEnHxTgs6YqyLQWmBh+/r BsweLIRadTtyylZgdSP8+KMFMe1H6gFfxN5tIibmNKC/6bDZaQ8Kbm6Y+Zy/7ed/ ROZQFIFsYsyN4omKpuZv3r3pxUM7cxR7vsQFEsF4SRGpCNnKRvfIHUM5Zybd1HTD cfngretLsApCXTaScqGtsLfkyP8x+1YhNVI7jQk/sfZfv/yXmjwsA/wbNDmNXmpO rcUu8zo3U98RrJrfYMPECXkx403I/eOzJuJmmADKxs29QnqxWakFXwEaLY9ZWipE FN0JDZXPmAvhLFRUkYdFkWXt8IqwAO1CI2ERpXw/ZjZ7D8xTGhJx74/LGD1O7TZ0 VTXvF8u7elHs188KXiQV89N8CpDgMno= =BEip -----END PGP SIGNATURE----- Merge tag 'thunderbolt-for-v6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus Mika writes: thunderbolt: Fix for v6.4-rc3 This includes a single fix that fixes an error when resuming from hibernation if the driver is built into the kernel. This has been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Clear registers properly when auto clear isn't in use
This commit is contained in:
commit
1e94be78ec
|
@ -54,6 +54,21 @@ static int ring_interrupt_index(const struct tb_ring *ring)
|
|||
return bit;
|
||||
}
|
||||
|
||||
static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring)
|
||||
{
|
||||
if (nhi->quirks & QUIRK_AUTO_CLEAR_INT)
|
||||
return;
|
||||
iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
|
||||
}
|
||||
|
||||
static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring)
|
||||
{
|
||||
if (nhi->quirks & QUIRK_AUTO_CLEAR_INT)
|
||||
ioread32(nhi->iobase + REG_RING_NOTIFY_BASE + ring);
|
||||
else
|
||||
iowrite32(~0, nhi->iobase + REG_RING_INT_CLEAR + ring);
|
||||
}
|
||||
|
||||
/*
|
||||
* ring_interrupt_active() - activate/deactivate interrupts for a single ring
|
||||
*
|
||||
|
@ -61,8 +76,8 @@ static int ring_interrupt_index(const struct tb_ring *ring)
|
|||
*/
|
||||
static void ring_interrupt_active(struct tb_ring *ring, bool active)
|
||||
{
|
||||
int reg = REG_RING_INTERRUPT_BASE +
|
||||
ring_interrupt_index(ring) / 32 * 4;
|
||||
int index = ring_interrupt_index(ring) / 32 * 4;
|
||||
int reg = REG_RING_INTERRUPT_BASE + index;
|
||||
int interrupt_bit = ring_interrupt_index(ring) & 31;
|
||||
int mask = 1 << interrupt_bit;
|
||||
u32 old, new;
|
||||
|
@ -123,7 +138,11 @@ static void ring_interrupt_active(struct tb_ring *ring, bool active)
|
|||
"interrupt for %s %d is already %s\n",
|
||||
RING_TYPE(ring), ring->hop,
|
||||
active ? "enabled" : "disabled");
|
||||
iowrite32(new, ring->nhi->iobase + reg);
|
||||
|
||||
if (active)
|
||||
iowrite32(new, ring->nhi->iobase + reg);
|
||||
else
|
||||
nhi_mask_interrupt(ring->nhi, mask, index);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -136,11 +155,11 @@ static void nhi_disable_interrupts(struct tb_nhi *nhi)
|
|||
int i = 0;
|
||||
/* disable interrupts */
|
||||
for (i = 0; i < RING_INTERRUPT_REG_COUNT(nhi); i++)
|
||||
iowrite32(0, nhi->iobase + REG_RING_INTERRUPT_BASE + 4 * i);
|
||||
nhi_mask_interrupt(nhi, ~0, 4 * i);
|
||||
|
||||
/* clear interrupt status bits */
|
||||
for (i = 0; i < RING_NOTIFY_REG_COUNT(nhi); i++)
|
||||
ioread32(nhi->iobase + REG_RING_NOTIFY_BASE + 4 * i);
|
||||
nhi_clear_interrupt(nhi, 4 * i);
|
||||
}
|
||||
|
||||
/* ring helper methods */
|
||||
|
|
|
@ -93,6 +93,8 @@ struct ring_desc {
|
|||
#define REG_RING_INTERRUPT_BASE 0x38200
|
||||
#define RING_INTERRUPT_REG_COUNT(nhi) ((31 + 2 * nhi->hop_count) / 32)
|
||||
|
||||
#define REG_RING_INTERRUPT_MASK_CLEAR_BASE 0x38208
|
||||
|
||||
#define REG_INT_THROTTLING_RATE 0x38c00
|
||||
|
||||
/* Interrupt Vector Allocation */
|
||||
|
|
Loading…
Reference in New Issue