All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: qup: Add shutdown method
@ 2018-01-16 21:35 Austin Christ
  2018-01-16 21:35 ` [PATCH] i2c-qup: reduce verbosity on DMA channel not found messages Austin Christ
  2018-02-02 23:36 ` [PATCH] i2c: qup: Add shutdown method Bjorn Andersson
  0 siblings, 2 replies; 4+ messages in thread
From: Austin Christ @ 2018-01-16 21:35 UTC (permalink / raw)
  To: wsa, linux-i2c, linux-arm-msm; +Cc: Austin Christ

This shutdown method disables I2C to avoid corrupting a new kernel
started with kexec.

Signed-off-by: Austin Christ <austinwc@codeaurora.org>
---
 drivers/i2c/busses/i2c-qup.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 08f8e01..b96f01a 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1651,12 +1651,16 @@ static int qup_i2c_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static void qup_i2c_shutdown(struct platform_device *pdev)
+{
+	qup_i2c_remove(pdev);
+}
+
 #ifdef CONFIG_PM
 static int qup_i2c_pm_suspend_runtime(struct device *device)
 {
 	struct qup_i2c_dev *qup = dev_get_drvdata(device);
 
-	dev_dbg(device, "pm_runtime: suspending...\n");
 	qup_i2c_disable_clocks(qup);
 	return 0;
 }
@@ -1717,6 +1721,7 @@ static int qup_i2c_resume(struct device *device)
 static struct platform_driver qup_i2c_driver = {
 	.probe  = qup_i2c_probe,
 	.remove = qup_i2c_remove,
+	.shutdown = qup_i2c_shutdown,
 	.driver = {
 		.name = "i2c_qup",
 		.pm = &qup_i2c_qup_pm_ops,
-- 
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] i2c-qup: reduce verbosity on DMA channel not found messages
  2018-01-16 21:35 [PATCH] i2c: qup: Add shutdown method Austin Christ
@ 2018-01-16 21:35 ` Austin Christ
  2018-01-31 16:54   ` Timur Tabi
  2018-02-02 23:36 ` [PATCH] i2c: qup: Add shutdown method Bjorn Andersson
  1 sibling, 1 reply; 4+ messages in thread
From: Austin Christ @ 2018-01-16 21:35 UTC (permalink / raw)
  To: wsa, linux-i2c, linux-arm-msm; +Cc: Sinan Kaya, Austin Christ

From: Sinan Kaya <okaya@codeaurora.org>

QDF2400 product doesn't have any BAM DMA attached to the I2C channel. This
causes code to spit an unnecessary error message during boot.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Austin Christ <austinwc@codeaurora.org>
---
 drivers/i2c/busses/i2c-qup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 08f8e01..c28d267 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -666,7 +666,7 @@ static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
 		if (IS_ERR(qup->btx.dma)) {
 			err = PTR_ERR(qup->btx.dma);
 			qup->btx.dma = NULL;
-			dev_err(qup->dev, "\n tx channel not available");
+			dev_info(qup->dev, "\n tx channel not available");
 			return err;
 		}
 	}
@@ -674,7 +674,7 @@ static int qup_i2c_req_dma(struct qup_i2c_dev *qup)
 	if (!qup->brx.dma) {
 		qup->brx.dma = dma_request_slave_channel_reason(qup->dev, "rx");
 		if (IS_ERR(qup->brx.dma)) {
-			dev_err(qup->dev, "\n rx channel not available");
+			dev_info(qup->dev, "\n rx channel not available");
 			err = PTR_ERR(qup->brx.dma);
 			qup->brx.dma = NULL;
 			qup_i2c_rel_dma(qup);
-- 
1.9.1
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c-qup: reduce verbosity on DMA channel not found messages
  2018-01-16 21:35 ` [PATCH] i2c-qup: reduce verbosity on DMA channel not found messages Austin Christ
@ 2018-01-31 16:54   ` Timur Tabi
  0 siblings, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2018-01-31 16:54 UTC (permalink / raw)
  To: Austin Christ; +Cc: wsa, linux-i2c, linux-arm-msm, Sinan Kaya

On Tue, Jan 16, 2018 at 3:35 PM, Austin Christ <austinwc@codeaurora.org> wrote:
> From: Sinan Kaya <okaya@codeaurora.org>
>
> QDF2400 product doesn't have any BAM DMA attached to the I2C channel. This
> causes code to spit an unnecessary error message during boot.

If that's the case, then qup->is_dma should be false, and then this
code should never be executed.

Wouldn't it be better if qup_i2c_probe() is modified to detect a
QDF2400 and not even try to enable DMA?  There's already code like
that for device tree:

    if (of_device_is_compatible(pdev->dev.of_node, "qcom,i2c-qup-v1.1.1")) {
        qup->adap.algo = &qup_i2c_algo;
        qup->adap.quirks = &qup_i2c_quirks;
    else
    ...
        qup->adap.algo = &qup_i2c_algo_v2;
        ret = qup_i2c_req_dma(qup);

On QDF2400, you should never be calling qup_i2c_req_dma() in the first place.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: qup: Add shutdown method
  2018-01-16 21:35 [PATCH] i2c: qup: Add shutdown method Austin Christ
  2018-01-16 21:35 ` [PATCH] i2c-qup: reduce verbosity on DMA channel not found messages Austin Christ
@ 2018-02-02 23:36 ` Bjorn Andersson
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Andersson @ 2018-02-02 23:36 UTC (permalink / raw)
  To: Austin Christ; +Cc: wsa, linux-i2c, linux-arm-msm

On Tue 16 Jan 13:35 PST 2018, Austin Christ wrote:

> This shutdown method disables I2C to avoid corrupting a new kernel
> started with kexec.
> 

Can you elaborate on the issue you're seeing here? In what way is the
i2c-qup driver special, will there be similar patches for all other
drivers in the system?

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-02 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16 21:35 [PATCH] i2c: qup: Add shutdown method Austin Christ
2018-01-16 21:35 ` [PATCH] i2c-qup: reduce verbosity on DMA channel not found messages Austin Christ
2018-01-31 16:54   ` Timur Tabi
2018-02-02 23:36 ` [PATCH] i2c: qup: Add shutdown method Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.