mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Dan Williams <dan.j.williams@intel.com>,
	Ira Weiny <ira.weiny@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dave Jiang <dave.jiang@intel.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,
	quic_zijuhu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH v4 1/2] cxl/region: Find free cxl decoder by device_for_each_child()
Date: Thu, 10 Oct 2024 21:47:21 +0800	[thread overview]
Message-ID: <75e2b3a5-e8ed-47f2-8f7d-89c6f9481026@icloud.com> (raw)
In-Reply-To: <66e08f9beb6a2_326462945d@dwillia2-xfh.jf.intel.com.notmuch>

On 2024/9/11 02:27, Dan Williams wrote:
> Dan Williams wrote:
> [..]
>> So, while regionB would be the next decoder to allocate after regionC is
>> torn down, it is not a free decoder while decoderC and regionC have not been
>> reclaimed.
> 
> The "simple" conversion is bug compatible with the current
> implementation, but here's a path to both constify the
> device_find_child() argument, *and* prevent unwanted allocations by
> allocating decoders precisely by id.  Something like this, it passes a
> quick unit test run:
> 

I submitted changes suggested by Dan as shown by below link:
https://patchwork.kernel.org/project/cxl/patch/20240917-const_dfc_prepare-v5-1-0e20f673ee0c@quicinc.com/

I also made a little modification based on that Dan suggested.
welcome to code review again (^^).

Sorry for this noise (^^).

> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index 1d5007e3795a..749a281819b4 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -1750,7 +1750,8 @@ static int cxl_decoder_init(struct cxl_port *port, struct cxl_decoder *cxld)
>  	struct device *dev;
>  	int rc;
>  
[snip]

  parent reply	other threads:[~2024-10-10 13:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05  0:36 [PATCH v4 0/2] driver core: Prevent device_find_child() from modifying caller's match data Zijun Hu
2024-09-05  0:36 ` [PATCH v4 1/2] cxl/region: Find free cxl decoder by device_for_each_child() Zijun Hu
2024-09-05  5:32   ` Greg Kroah-Hartman
2024-09-05  8:48     ` quic_zijuhu
2024-09-05 11:18     ` Zijun Hu
2024-09-09 19:56     ` Ira Weiny
2024-09-10  0:45       ` Dan Williams
2024-09-10  3:17         ` quic_zijuhu
2024-09-10  4:15           ` Dan Williams
2024-09-10  4:20             ` Dan Williams
2024-09-10 11:46             ` Zijun Hu
2024-09-10 16:01               ` Dan Williams
2024-09-10 18:27                 ` Dan Williams
2024-09-11 12:14                   ` Zijun Hu
2024-10-10 13:47                   ` Zijun Hu [this message]
2024-09-11 11:52                 ` Zijun Hu
2024-09-05  0:36 ` [PATCH v4 2/2] net: qcom/emac: Find sgmii_ops " Zijun Hu
2024-09-05  5:29   ` Greg Kroah-Hartman
2024-09-05  5:33     ` Greg Kroah-Hartman
2024-09-05  9:09       ` quic_zijuhu
2024-09-06  0:29       ` Zijun Hu
2024-09-05  8:29     ` quic_zijuhu

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=75e2b3a5-e8ed-47f2-8f7d-89c6f9481026@icloud.com \
    --to=zijun_hu@icloud.com \
    --cc=alison.schofield@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=vishal.l.verma@intel.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

all inboxes | Powered by JetHome®