devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Lh Kuo 郭力豪" <lh.Kuo@sunplus.com>,
	"Li-hao Kuo" <lhjeff911@gmail.com>,
	"rafael@kernel.org" <rafael@kernel.org>,
	"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
	"amitk@kernel.org" <amitk@kernel.org>,
	"rui.zhang@intel.com" <rui.zhang@intel.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "Wells Lu 呂芳騰" <wells.lu@sunplus.com>
Subject: Re: [PATCH v5 1/2] thermal: Add thermal driver for Sunplus SP7021
Date: Tue, 22 Mar 2022 09:56:22 +0100	[thread overview]
Message-ID: <870f8623-8a99-09b6-56c6-0f8c010af237@kernel.org> (raw)
In-Reply-To: <4c05e7767bfe401b8c139e159855fe77@sphcmbx02.sunplus.com.tw>

On 22/03/2022 03:55, Lh Kuo 郭力豪 wrote:
>>> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> +	if (IS_ERR(res))
>>> +		return dev_err_probe(&pdev->dev, PTR_ERR(res), "resource get
>>> +fail\n");
>>> +
>>> +	sp_data->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>>> +	if (IS_ERR(sp_data->regs))
>>> +		return dev_err_probe(&pdev->dev, PTR_ERR(sp_data->regs), "mas_base
>>> +get fail\n");
>>
>> Use devm_platform_ioremap_resource() instead.
>>
> 
> Other drivers must also access these registers.
> Warning when using devm_platform_ioremap_resource
> Can I keep the original settings?

You should not map one region twice. How do you guarantee
synchronization during for example updates of specific registers? In
such case you need to use regmap and share it via syscon (although this
does not solve synchronization on higher level - avoiding conflicting
changes to same registers)


Best regards,
Krzysztof

  reply	other threads:[~2022-03-22  8:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-16  3:01 [PATCH v5 0/2] Add thermal control driver for Sunplus SP7021 SoC Li-hao Kuo
2022-03-16  3:01 ` [PATCH v5 1/2] thermal: Add thermal driver for Sunplus SP7021 Li-hao Kuo
2022-03-16 16:25   ` Krzysztof Kozlowski
2022-03-22  2:55     ` Lh Kuo 郭力豪
2022-03-22  8:56       ` Krzysztof Kozlowski [this message]
2022-03-16  3:01 ` [PATCH v5 2/2] dt-bindings:thermal: Add Sunplus SP7021 schema Li-hao Kuo
2022-03-16 16:19   ` Krzysztof Kozlowski

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=870f8623-8a99-09b6-56c6-0f8c010af237@kernel.org \
    --to=krzk@kernel.org \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lh.Kuo@sunplus.com \
    --cc=lhjeff911@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=wells.lu@sunplus.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).