linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Carlos Song <carlos.song@nxp.com>,
	Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Andi Shyti <andi.shyti@kernel.org>, Frank Li <frank.li@nxp.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"imx@lists.linux.dev" <imx@lists.linux.dev>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Clark Wang <xiaoning.wang@nxp.com>
Subject: Re: [PATCH v5] i2c: imx: support DMA defer probing
Date: Fri, 20 Dec 2024 11:51:27 +0100	[thread overview]
Message-ID: <f2690b83-b907-4ade-bb9d-daa0636c6786@pengutronix.de> (raw)
In-Reply-To: <AM0PR0402MB3937E87BBDC5CEA1C51E4E3AE8072@AM0PR0402MB3937.eurprd04.prod.outlook.com>

Hi Carlos,

On 20.12.24 11:46, Carlos Song wrote:
> 
> 
>> -----Original Message-----
>> From: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> Sent: Friday, December 20, 2024 5:32 PM
>> To: Carlos Song <carlos.song@nxp.com>; Oleksij Rempel

>> I know -110, but -12 I need to look up :) Both are cryptic to end users, which is
>> why %pe was added on top of the existing %p:
>>
>> If CONFIG_SYMBOLIC_ERRNAME is enabled %pe expands to an error string, e.g.
>> "ENOMEM" or "ETIMEDOUT". If it's disabled, you get the same error number
>> that was printed raw before.
>>
>> Cheers,
>> Ahmad
>>
> 
> Wow! Looks so cool.
> Thank you very much for your patient explanation! I agree it.
> 
> Also I will change the comment from your suggestion[1]:
> 
> "
>   /*
>    * As we can always fall back to PIO, let's ignore the error setting up
>    * DMA and see if we run into errors while setting up PIO mode.
>    */
> "
> In fact, other errors are also from DMA setting not from setting PIO mode.
> So can I comment simply like this?
> 
>         /* As we can always fall back to PIO, let's ignore the error setting up DMA. */
>         ret = i2c_imx_dma_request(i2c_imx, phy_addr);
>         if (ret) {
>                 if (ret == -EPROBE_DEFER)
>                         goto clk_notifier_unregister;
>                 else if (ret == -ENODEV)
>                         dev_dbg(&pdev->dev, "Only use PIO mode\n");
>                 else
>                         dev_err(&pdev->dev, "Failed to setup DMA (%pe), only use PIO mode\n", ERR_PTR(ret));
>         }
> 
> [1]https://lore.kernel.org/imx/89a3b1c9-2be2-4e7f-a0c6-abbf8b88957b@pengutronix.de/

Sure, looks good to me. @Oleksij?

Cheers,
Ahmad

> 
> BR
> Carlos
>>>
>>> i2c_imx_dma_request is using PTR_ERR to convert pointer to error value[1].
>>> I don't know why need to use ERR_PTR to reconvert the value to pointer:
>>>
>>> dev_err(&pdev->dev, "Failed to setup DMA (%pe), only use PIO mode\n",
>>> ERR_PTR(ret));
>>>
>>> Is there some strong reason?
>>>
>>> [1]
>>> https://lore/
>>> .kernel.org%2Fimx%2FAM0PR0402MB3937419BBB58B75FB8F8DE2DE8072%
>> 40AM0PR04
>>>
>> 02MB3937.eurprd04.prod.outlook.com%2F&data=05%7C02%7Ccarlos.song%4
>> 0nxp
>>> .com%7C13a8e6532dd7435c302008dd20d92819%7C686ea1d3bc2b4c6fa92c
>> d99c5c30
>>>
>> 1635%7C0%7C0%7C638702839227618754%7CUnknown%7CTWFpbGZsb3d8eyJ
>> FbXB0eU1h
>>>
>> cGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIj
>>>
>> oyfQ%3D%3D%7C0%7C%7C%7C&sdata=2A6qPlFEuW1SmlvOZ7OhtfO7VwqysM
>> cGhFL2G%2F
>>> ECNek%3D&reserved=0
>>>>
>>>> --
>>>> Pengutronix e.K.                           |
>>>> |
>>>> Steuerwalder Str. 21                       |
>>>> http://www/.
>>>>
>> pen%2F&data=05%7C02%7Ccarlos.song%40nxp.com%7C13a8e6532dd7435c30
>> 2008d
>>>>
>> d20d92819%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63870283
>> 922763
>>>>
>> 8077%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjA
>> uMDAw
>>>>
>> MCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&s
>> da
>>>>
>> ta=LasLtpe7GjsG5qVUKG%2FOmVro2JueGLfwUPALw7%2FB2fg%3D&reserved=
>> 0
>>>>
>> gutronix.de%2F&data=05%7C02%7Ccarlos.song%40nxp.com%7C594497db1b5
>>>>
>> 44e479a8f08dd20d1e88e%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0
>>>> %7C638702808104903131%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hc
>> Gki
>>>>
>> OnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyf
>>>>
>> Q %3D%3D%7C0%7C%7C%7C&sdata=EnhsIFlBooqjB%2FSRWF7uAqRHE3yN6rbd
>> D
>>>> 1yQueTrRus%3D&reserved=0  |
>>>> 31137 Hildesheim, Germany                  | Phone:
>> +49-5121-206917-0
>>>> |
>>>> Amtsgericht Hildesheim, HRA 2686           | Fax:
>>>> +49-5121-206917-5555 |
>>
>>
>> --
>> Pengutronix e.K.                           |
>> |
>> Steuerwalder Str. 21                       |
>> http://www.pen/
>> gutronix.de%2F&data=05%7C02%7Ccarlos.song%40nxp.com%7C13a8e6532dd
>> 7435c302008dd20d92819%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0
>> %7C638702839227652725%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGki
>> OnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ
>> %3D%3D%7C0%7C%7C%7C&sdata=Hm60QL5dJ2h3OCesOXK871ASnK7s0L4SPiY
>> bK0jtSOo%3D&reserved=0  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0
>> |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:
>> +49-5121-206917-5555 |


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


  reply	other threads:[~2024-12-20 11:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-18  4:35 [PATCH v5] i2c: imx: support DMA defer probing Carlos Song
2024-12-19  6:04 ` Oleksij Rempel
2024-12-19 12:02 ` Andi Shyti
2024-12-19 12:22   ` Oleksij Rempel
2024-12-20  2:45     ` Carlos Song
2024-12-20  5:32       ` Oleksij Rempel
2024-12-20  5:59         ` Carlos Song
2024-12-20  6:12           ` Oleksij Rempel
2024-12-20  6:58             ` Carlos Song
2024-12-20  7:06               ` Ahmad Fatoum
2024-12-20  7:35                 ` Oleksij Rempel
2024-12-20  7:38                   ` Carlos Song
2024-12-20  7:45                     ` Oleksij Rempel
2024-12-20  8:06                       ` Carlos Song
2024-12-20  8:40                         ` Ahmad Fatoum
2024-12-20  9:23                           ` Carlos Song
2024-12-20  9:31                             ` Ahmad Fatoum
2024-12-20 10:46                               ` Carlos Song
2024-12-20 10:51                                 ` Ahmad Fatoum [this message]
2024-12-20 11:46                                   ` Oleksij Rempel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2690b83-b907-4ade-bb9d-daa0636c6786@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=andi.shyti@kernel.org \
    --cc=carlos.song@nxp.com \
    --cc=festevam@gmail.com \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=xiaoning.wang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).