Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46da49b1 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mmc: cmdq_hci: Fix NULL pointer dereference crash"

parents 1b48a1b0 6a4646b0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ struct cmdq_host_ops {

static inline void cmdq_writel(struct cmdq_host *host, u32 val, int reg)
{
	if (unlikely(host->ops->write_l))
	if (unlikely(host->ops && host->ops->write_l))
		host->ops->write_l(host, val, reg);
	else
		writel_relaxed(val, host->mmio + reg);
@@ -223,7 +223,7 @@ static inline void cmdq_writel(struct cmdq_host *host, u32 val, int reg)

static inline u32 cmdq_readl(struct cmdq_host *host, int reg)
{
	if (unlikely(host->ops->read_l))
	if (unlikely(host->ops && host->ops->read_l))
		return host->ops->read_l(host, reg);
	else
		return readl_relaxed(host->mmio + reg);
+6 −3
Original line number Diff line number Diff line
@@ -3020,10 +3020,13 @@ static void sdhci_msm_set_uhs_signaling(struct sdhci_host *host,

#define MAX_TEST_BUS 60
#define DRV_NAME "cmdq-host"
static void sdhci_msm_cmdq_dump_debug_ram(struct sdhci_msm_host *msm_host)
static void sdhci_msm_cmdq_dump_debug_ram(struct sdhci_host *host)
{
	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
	struct sdhci_msm_host *msm_host = pltfm_host->priv;
	int i = 0;
	struct cmdq_host *cq_host = mmc_cmdq_private(msm_host->mmc);
	struct cmdq_host *cq_host = host->cq_host;

	u32 version = readl_relaxed(msm_host->core_mem + CORE_MCI_VERSION);
	u16 minor = version & CORE_VERSION_TARGET_MASK;
	/* registers offset changed starting from 4.2.0 */
@@ -3054,7 +3057,7 @@ void sdhci_msm_dump_vendor_regs(struct sdhci_host *host)

	pr_info("----------- VENDOR REGISTER DUMP -----------\n");
	if (host->cq_host)
		sdhci_msm_cmdq_dump_debug_ram(msm_host);
		sdhci_msm_cmdq_dump_debug_ram(host);

	pr_info("Data cnt: 0x%08x | Fifo cnt: 0x%08x | Int sts: 0x%08x\n",
		readl_relaxed(msm_host->core_mem + CORE_MCI_DATA_CNT),
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ retry_reset:
			return;
		}
		timeout--;
		mdelay(1);
		udelay(1);
	}

	if ((host->quirks2 & SDHCI_QUIRK2_USE_RESET_WORKAROUND) &&