Linux CXL
 help / color / mirror / Atom feed
From: Alejandro Lucero Palau <alucerop@amd.com>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: linux-cxl@vger.kernel.org, netdev@vger.kernel.org,
	dan.j.williams@intel.com, nifan.cxl@gmail.com
Subject: Re: [PATCHv4] cxl: avoid driver data for obtaining cxl_dev_state reference
Date: Tue, 3 Dec 2024 17:24:26 +0000	[thread overview]
Message-ID: <27ba1109-95d8-6091-5fce-bd00c68f2da1@amd.com> (raw)
In-Reply-To: <20241203171430.00000d0e@huawei.com>


On 12/3/24 17:14, Jonathan Cameron wrote:
> On Tue, 3 Dec 2024 16:21:12 +0000
> <alucerop@amd.com> wrote:
>
>> From: Alejandro Lucero <alucerop@amd.com>
>>
>> CXL Type3 pci driver uses struct device driver_data for keeping
>> cxl_dev_state reference. Type1/2 drivers are not only about CXL so this
>> field should not be used when code requires cxl_dev_state to work with
>> and such a code used for Type2 support.
>>
>> Change cxl_dvsec_rr_decode for passing cxl_dev_state as a parameter.
>>
>> Seize the change for removing the unused cxl_port param.
>>
>> Signed-off-by: Alejandro Lucero <alucerop@amd.com>
> I wondered if the other places this assumption is made about drvdata
> would cause you trouble, but they seem ok for now at least as
> error handling code you probably won't use.


I think once the Type2 support is hopefully merged soon, it will be in 
the heads of all of us for avoiding this kind of uses. For the sake of 
that support, this patch is enough, but I bet we will find similar 
issues soon.


> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


Thanks!


  reply	other threads:[~2024-12-03 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 16:21 [PATCHv4] cxl: avoid driver data for obtaining cxl_dev_state reference alucerop
2024-12-03 17:14 ` Jonathan Cameron
2024-12-03 17:24   ` Alejandro Lucero Palau [this message]
2024-12-12 21:46 ` Alison Schofield
2024-12-12 22:14   ` Dave Jiang

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=27ba1109-95d8-6091-5fce-bd00c68f2da1@amd.com \
    --to=alucerop@amd.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nifan.cxl@gmail.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