Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions drivers/soundwire/cadence_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,23 @@ irqreturn_t sdw_cdns_irq(int irq, void *dev_id)
}

if (int_status & CDNS_MCP_INT_SLAVE_MASK) {

u32 slv_mask;

slv_mask = cdns_readl(cdns, CDNS_MCP_INTMASK);

/* FIXME: there must be a clever way to do this in one shot */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slv_mask &= ~(int_status & CNDS_MCP_INT_SLAVE_MASK); ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if it's equivalent but I wrote this down:

slv_mask &= (~int_status & CNDS_MCP_INT_SLAVE_MASK);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not equal. Your method will only reserve the bit in range of CNDS_MCP_INT_SLAVE_MASK, for other no-slave int status will lost

if (int_status & CDNS_MCP_INT_SLAVE_RSVD)
slv_mask &= ~CDNS_MCP_INT_SLAVE_RSVD;
if (int_status & CDNS_MCP_INT_SLAVE_ALERT)
slv_mask &= ~CDNS_MCP_INT_SLAVE_ALERT;
if (int_status & CDNS_MCP_INT_SLAVE_ATTACH)
slv_mask &= ~CDNS_MCP_INT_SLAVE_ATTACH;
if (int_status & CDNS_MCP_INT_SLAVE_NATTACH)
slv_mask &= ~CDNS_MCP_INT_SLAVE_NATTACH;

/* Mask the Slave interrupt and wake thread */
cdns_updatel(cdns, CDNS_MCP_INTMASK,
CDNS_MCP_INT_SLAVE_MASK, 0);
cdns_writel(cdns, CDNS_MCP_INTMASK, slv_mask);

int_status &= ~CDNS_MCP_INT_SLAVE_MASK;

Expand Down