All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Patel, Utkarsh H" <utkarsh.h.patel@intel.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"Mani, Rajmohan" <rajmohan.mani@intel.com>
Subject: RE: [PATCH] usb: typec: intel_pmc_mux: Add new ACPI ID for Meteor Lake IOM device
Date: Wed, 3 Aug 2022 23:51:56 +0000	[thread overview]
Message-ID: <MWHPR11MB00484EFF0A94ABEFC0885F3EA99C9@MWHPR11MB0048.namprd11.prod.outlook.com> (raw)
In-Reply-To: <YujndMdpS+4L0AiL@kuha.fi.intel.com>

Hi Heikki,

Thank you for the review and feedback. 

> >  drivers/usb/typec/mux/intel_pmc_mux.c | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c
> > b/drivers/usb/typec/mux/intel_pmc_mux.c
> > index 47b733f78fb0..a8e273fe204a 100644
> > --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> > @@ -571,9 +571,11 @@ static int pmc_usb_register_port(struct pmc_usb
> > *pmc, int index,
> >
> >  static int is_memory(struct acpi_resource *res, void *data)  {
> > -	struct resource r;
> > +	struct resource_win win = {};
> > +	struct resource *r = &win.res;
> >
> > -	return !acpi_dev_resource_memory(res, &r);
> > +	return !(acpi_dev_resource_memory(res, r) ||
> > +		 acpi_dev_resource_address_space(res, &win));
> >  }
> 
> I realised that now that is_memory() function is basically just a copy of the
> is_memory() function that's in drivers/acpi/resources.c, so I think we need to
> handle this a bit differently. There are a few places in kernel that have that
> same check.
> 
> One way would be to just export the is_memory() function that's in
> drivers/acpi/resources.c, but since we have already a wrapper function
> acpi_dev_get_dma_resources() for DMA resouces, I think we could have a
> similar wrapper for common memory resources.
> 
> I'll prepare a patch(s) where I'll propose a new wrapper function
> acpi_dev_get_memory_resources() that will take care of the is_memory()
> check, and then convert the users (including this driver). After that, this patch
> only needs to add the ID.

I will wait for your changes then. 

Sincerely,
Utkarsh Patel. 


      reply	other threads:[~2022-08-03 23:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29  0:30 [PATCH] usb: typec: intel_pmc_mux: Add new ACPI ID for Meteor Lake IOM device Utkarsh Patel
2022-07-29  7:39 ` Greg KH
2022-08-02  8:59 ` Heikki Krogerus
2022-08-03 23:51   ` Patel, Utkarsh H [this message]

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=MWHPR11MB00484EFF0A94ABEFC0885F3EA99C9@MWHPR11MB0048.namprd11.prod.outlook.com \
    --to=utkarsh.h.patel@intel.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rajmohan.mani@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 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.