From 43abadb1bc120a67669d888a4115c10488dfd391 Mon Sep 17 00:00:00 2001 From: Huangjie Date: Wed, 17 Apr 2024 11:18:48 +0800 Subject: [PATCH 1/5] sound: pmdk_dp: fix DAPM unknown pin error log at boot there is no HDMI/DP dapm widget in PDMKI2S sound card, is unnecessary to associate DAPM pins widget with jack Signed-off-by: Huangjie --- sound/soc/phytium/pmdk_dp.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/sound/soc/phytium/pmdk_dp.c b/sound/soc/phytium/pmdk_dp.c index ec47ee69e3a..ce56634aef2 100755 --- a/sound/soc/phytium/pmdk_dp.c +++ b/sound/soc/phytium/pmdk_dp.c @@ -31,27 +31,6 @@ static const struct snd_soc_dapm_route pmdk_dp_audio_map[] = { {"DP", NULL, "TX"}, }; -static struct snd_soc_jack_pin dp0_pins[] = { - { - .pin = "HDMI/DP,pcm=0", - .mask = SND_JACK_LINEOUT, - }, -}; - -static struct snd_soc_jack_pin dp1_pins[] = { - { - .pin = "HDMI/DP,pcm=1", - .mask = SND_JACK_LINEOUT, - }, -}; - -static struct snd_soc_jack_pin dp2_pins[] = { - { - .pin = "HDMI/DP,pcm=2", - .mask = SND_JACK_LINEOUT, - }, -}; - #define SMDK_DAI_FMT (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | \ SND_SOC_DAIFMT_CBS_CFS) @@ -63,9 +42,8 @@ static int pmdk_dp0_init(struct snd_soc_pcm_runtime *runtime) int ret; ret = snd_soc_card_jack_new(card, "HDMI/DP,pcm=0", - SND_JACK_LINEOUT, - &priv->jack0, dp0_pins, - ARRAY_SIZE(dp0_pins)); + SND_JACK_LINEOUT, &priv->jack0, NULL, 0); + if (ret) { dev_err(card->dev, "Jack creation failed %d\n", ret); return ret; @@ -82,9 +60,7 @@ static int pmdk_dp1_init(struct snd_soc_pcm_runtime *runtime) int ret; ret = snd_soc_card_jack_new(card, "HDMI/DP,pcm=1", - SND_JACK_LINEOUT, - &priv->jack1, dp1_pins, - ARRAY_SIZE(dp1_pins)); + SND_JACK_LINEOUT, &priv->jack1, NULL, 0); if (ret) { dev_err(card->dev, "Jack creation failed %d\n", ret); @@ -102,9 +78,8 @@ static int pmdk_dp2_init(struct snd_soc_pcm_runtime *runtime) int ret; ret = snd_soc_card_jack_new(card, "HDMI/DP,pcm=2", - SND_JACK_LINEOUT, - &priv->jack2, dp2_pins, - ARRAY_SIZE(dp2_pins)); + SND_JACK_LINEOUT, &priv->jack2, NULL, 0); + if (ret) { dev_err(card->dev, "Jack creation failed %d\n", ret); return ret; -- Gitee From 2b66edef0dbf33db22b9ce98cacfd4b90692db05 Mon Sep 17 00:00:00 2001 From: Huangjie Date: Thu, 18 Apr 2024 17:14:52 +0800 Subject: [PATCH 2/5] drivers: arm_scmi: add lock when wait shmem channel status sometimes it reach timeout when wait shmem channel status, beacuse of kernel preemption strategy, and print such error log [ 2619.124136] cpufreq: __target_index: Failed to change cpu frequency: -110 in this patch, we add spin lock to disable preemption when poll to wait shmem channel status Signed-off-by: Huangjie --- drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/driver.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 34b7ae7980a..70bdb9872ac 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -139,6 +139,7 @@ struct scmi_xfer { struct scmi_msg rx; struct completion done; struct completion *async_done; + spinlock_t lock; }; void scmi_xfer_put(const struct scmi_handle *h, struct scmi_xfer *xfer); diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 9b2dbd01367..5e5ab0764d9 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -359,6 +359,7 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer) struct scmi_info *info = handle_to_scmi_info(handle); struct device *dev = info->dev; struct scmi_chan_info *cinfo; + unsigned long flags; cinfo = idr_find(&info->tx_idr, xfer->hdr.protocol_id); if (unlikely(!cinfo)) @@ -379,8 +380,11 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer) } if (xfer->hdr.poll_completion) { - ktime_t stop = ktime_add_ms(ktime_get(), - info->desc->max_rx_timeout_ms); + ktime_t stop; + + spin_lock_irqsave(&xfer->lock, flags); + stop = ktime_add_ms(ktime_get(), + info->desc->max_rx_timeout_ms); spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop)); @@ -388,6 +392,7 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer) info->desc->ops->fetch_response(cinfo, xfer); else ret = -ETIMEDOUT; + spin_unlock_irqrestore(&xfer->lock, flags); } else { /* And we wait for the response. */ timeout = msecs_to_jiffies(info->desc->max_rx_timeout_ms); @@ -648,6 +653,7 @@ static int __scmi_xfer_info_init(struct scmi_info *sinfo, xfer->tx.buf = xfer->rx.buf; init_completion(&xfer->done); + spin_lock_init(&xfer->lock); } spin_lock_init(&info->xfer_lock); -- Gitee From 97a794607dd2668bf9cfc7835ee331fbc3e7e5dc Mon Sep 17 00:00:00 2001 From: Huangjie Date: Mon, 22 Apr 2024 14:34:41 +0800 Subject: [PATCH 3/5] drivers: mmc: start timeout timer before send request previously, we send request first then start timer, sometimes caused mmc interrupt triggered before mod_timer and print "request timeout" log Signed-off-by: Huangjie --- drivers/mmc/host/phytium-mci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/phytium-mci.c b/drivers/mmc/host/phytium-mci.c index ea406d548a7..cedc39cc1ab 100644 --- a/drivers/mmc/host/phytium-mci.c +++ b/drivers/mmc/host/phytium-mci.c @@ -658,6 +658,8 @@ phytium_mci_start_data(struct phytium_mci_host *host, struct mmc_request *mrq, phytium_mci_data_sg_write_2_fifo(host, data); spin_lock_irqsave(&host->lock, flags); + mod_timer(&host->timeout_timer, + jiffies + msecs_to_jiffies(MMC_REQ_TIMEOUT_MS)); sdr_set_bits(host->base + MCI_INT_MASK, cmd_ints_mask | data_ints_mask); if (host->is_use_dma && host->adtc_type == BLOCK_RW_ADTC) { sdr_set_bits(host->base + MCI_DMAC_INT_ENA, dmac_ints_mask); @@ -673,9 +675,6 @@ phytium_mci_start_data(struct phytium_mci_host *host, struct mmc_request *mrq, wmb(); /* drain writebuffer */ writel(rawcmd, host->base + MCI_CMD); spin_unlock_irqrestore(&host->lock, flags); - - mod_timer(&host->timeout_timer, - jiffies + msecs_to_jiffies(MMC_REQ_TIMEOUT_MS)); } static void phytium_mci_track_cmd_data(struct phytium_mci_host *host, @@ -797,13 +796,12 @@ static void phytium_mci_start_command(struct phytium_mci_host *host, } spin_lock_irqsave(&host->lock, flags); + mod_timer(&host->timeout_timer, + jiffies + msecs_to_jiffies(MMC_REQ_TIMEOUT_MS)); sdr_set_bits(host->base + MCI_INT_MASK, cmd_ints_mask); writel(cmd->arg, host->base + MCI_CMDARG); writel(rawcmd, host->base + MCI_CMD); spin_unlock_irqrestore(&host->lock, flags); - - mod_timer(&host->timeout_timer, - jiffies + msecs_to_jiffies(MMC_REQ_TIMEOUT_MS)); } static void -- Gitee From fbc4512f07297a7f9bc7356b21769c813d0a5bd3 Mon Sep 17 00:00:00 2001 From: zuoqian Date: Wed, 24 Apr 2024 10:30:01 +0800 Subject: [PATCH 4/5] spi: phytium: Fix phytium_spi_irq panic on boot The root cause is that irq is triggered between request_irq and spi_master_set devdata, and fts has not been initialized yet. Signed-off-by: Liu Dalin Tested-by: Peng Min --- drivers/spi/spi-phytium.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-phytium.c b/drivers/spi/spi-phytium.c index 2dfea3f9046..4fae2cd2cac 100644 --- a/drivers/spi/spi-phytium.c +++ b/drivers/spi/spi-phytium.c @@ -415,6 +415,8 @@ int phytium_spi_add_host(struct device *dev, struct phytium_spi *fts) fts->dma_addr = (dma_addr_t)(fts->paddr + DR); snprintf(fts->name, sizeof(fts->name), "phytium_spi%d", fts->bus_num); + spi_hw_init(dev, fts); + ret = request_irq(fts->irq, phytium_spi_irq, IRQF_SHARED, fts->name, master); if (ret < 0) { dev_err(dev, "can not get IRQ\n"); @@ -436,9 +438,6 @@ int phytium_spi_add_host(struct device *dev, struct phytium_spi *fts) master->flags = SPI_MASTER_GPIO_SS; master->cs_gpios = fts->cs; - spi_hw_init(dev, fts); - - if (fts->dma_ops && fts->dma_ops->dma_init) { ret = fts->dma_ops->dma_init(dev, fts); if (ret) { -- Gitee From 76d9235ae8cb86fd50363e25c3bd5f34c0123fd5 Mon Sep 17 00:00:00 2001 From: liutianyu1250 Date: Mon, 29 Apr 2024 10:16:52 +0800 Subject: [PATCH 5/5] Phytium Embedded SDK v2.1 Signed-off-by: liutianyu1250 --- arch/arm64/configs/phytium_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/configs/phytium_defconfig b/arch/arm64/configs/phytium_defconfig index e36c0fa10d0..3a3f98c3e82 100644 --- a/arch/arm64/configs/phytium_defconfig +++ b/arch/arm64/configs/phytium_defconfig @@ -1,4 +1,4 @@ -CONFIG_LOCALVERSION="-phytium-embeded-v2.0" +CONFIG_LOCALVERSION="-phytium-embedded-v2.1" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y -- Gitee