All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Frank Li <frank.li@nxp.com>
Cc: "Shunsuke Mie" <mie@igel.co.jp>, "Jon Mason" <jdmason@kudzu.us>,
	"Dave Jiang" <dave.jiang@intel.com>,
	"Allen Hubbe" <allenbh@gmail.com>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"ntb@lists.linux.dev" <ntb@lists.linux.dev>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXT] Re: [PATCH v2] PCI: endpoint: pci-epf-{,v}ntb: fix a check for no epc alignment constraint
Date: Thu, 27 Oct 2022 20:42:20 +0530	[thread overview]
Message-ID: <20221027151220.GC76627@thinkpad> (raw)
In-Reply-To: <HE1PR0401MB23319EE329D62420919740C688339@HE1PR0401MB2331.eurprd04.prod.outlook.com>

On Thu, Oct 27, 2022 at 02:35:56PM +0000, Frank Li wrote:
> 
> 
> > -----Original Message-----
> > From: Shunsuke Mie <mie@igel.co.jp>
> > Sent: Wednesday, October 26, 2022 8:43 PM
> > To: Frank Li <frank.li@nxp.com>
> > Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>; Jon
> > Mason <jdmason@kudzu.us>; Dave Jiang <dave.jiang@intel.com>; Allen
> > Hubbe <allenbh@gmail.com>; Kishon Vijay Abraham I <kishon@ti.com>;
> > Lorenzo Pieralisi <lpieralisi@kernel.org>; Krzysztof Wilczyński
> > <kw@linux.com>; Bjorn Helgaas <bhelgaas@google.com>;
> > ntb@lists.linux.dev; linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: Re: [EXT] Re: [PATCH v2] PCI: endpoint: pci-epf-{,v}ntb: fix a check for
> > no epc alignment constraint
> > 
> > Caution: EXT Email
> > 
> > Hi Frank,
> > 
> > 2022年10月26日(水) 1:07 Frank Li <frank.li@nxp.com>:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > > Sent: Tuesday, October 25, 2022 9:22 AM
> > > > To: Shunsuke Mie <mie@igel.co.jp>
> > > > Cc: Jon Mason <jdmason@kudzu.us>; Dave Jiang <dave.jiang@intel.com>;
> > > > Allen Hubbe <allenbh@gmail.com>; Kishon Vijay Abraham I
> > > > <kishon@ti.com>; Lorenzo Pieralisi <lpieralisi@kernel.org>; Krzysztof
> > > > Wilczyński <kw@linux.com>; Bjorn Helgaas <bhelgaas@google.com>;
> > > > ntb@lists.linux.dev; linux-pci@vger.kernel.org; linux-
> > kernel@vger.kernel.org
> > > > Subject: [EXT] Re: [PATCH v2] PCI: endpoint: pci-epf-{,v}ntb: fix a check for
> > no
> > > > epc alignment constraint
> > > >
> > > > Caution: EXT Email
> > > >
> > > > On Thu, Sep 22, 2022 at 06:23:57PM +0900, Shunsuke Mie wrote:
> > > > > Some PCI endpoint controllers have no alignment constraints, and the
> > > > > epc_features->align becomes 0. In this case, IS_ALIGNED() in
> > >
> > > [Frank Li] why not set epc_features->align 1
> > > no alignment constraints should mean align to byte.
> > It is one of the solutions too I think. But in that case,  we need to
> > write epc_features->align = 1 to all epc drivers, dwc, qcom, rcar,
> > tegra, and etc.
> > 
> > I think that my change is better.
> 
> I think it should be based on what original term defined. 
> It should be fixed at where make mistake. 
> 

1byte is the default alignment that drivers can assume, why do you want drivers
to set them explicitly when they do not want any special alignment?

I think this patch is fine.

Thanks,
Mani

> Are there other place use align == 0 means no alignment in kernel? 
> 
> > 
> > > > > epf_ntb_config_spad_bar_alloc() doesn't work well. Check for this
> > before
> > > > > IS_ALIGNED().
> > > > >
> > > > > Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> > > >
> > > > Reviewed-by: Manivannan Sadhasivam
> > > > <manivannan.sadhasivam@linaro.org>
> > > >
> > > > Thanks,
> > > > Mani
> > > >
> > > > > ---
> > > > > Changes in v2:
> > > > > * Fix the commit message in phrasings and words.
> > > > > ---
> > > > > ---
> > > > >  drivers/pci/endpoint/functions/pci-epf-ntb.c  | 2 +-
> > > > >  drivers/pci/endpoint/functions/pci-epf-vntb.c | 2 +-
> > > > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/drivers/pci/endpoint/functions/pci-epf-ntb.c
> > > > b/drivers/pci/endpoint/functions/pci-epf-ntb.c
> > > > > index 9a00448c7e61..f74155ee8d72 100644
> > > > > --- a/drivers/pci/endpoint/functions/pci-epf-ntb.c
> > > > > +++ b/drivers/pci/endpoint/functions/pci-epf-ntb.c
> > > > > @@ -1021,7 +1021,7 @@ static int
> > epf_ntb_config_spad_bar_alloc(struct
> > > > epf_ntb *ntb,
> > > > >       peer_size = peer_epc_features->bar_fixed_size[peer_barno];
> > > > >
> > > > >       /* Check if epc_features is populated incorrectly */
> > > > > -     if ((!IS_ALIGNED(size, align)))
> > > > > +     if (align && (!IS_ALIGNED(size, align)))
> > > > >               return -EINVAL;
> > > > >
> > > > >       spad_count = ntb->spad_count;
> > > > > diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> > > > b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> > > > > index 0ea85e1d292e..5e346c0a0f05 100644
> > > > > --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> > > > > +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> > > > > @@ -418,7 +418,7 @@ static int epf_ntb_config_spad_bar_alloc(struct
> > > > epf_ntb *ntb)
> > > > >       size = epc_features->bar_fixed_size[barno];
> > > > >       align = epc_features->align;
> > > > >
> > > > > -     if ((!IS_ALIGNED(size, align)))
> > > > > +     if (align && !IS_ALIGNED(size, align))
> > > > >               return -EINVAL;
> > > > >
> > > > >       spad_count = ntb->spad_count;
> > > > > --
> > > > > 2.17.1
> > > > >
> > > >
> > > > --
> > > > மணிவண்ணன் சதாசிவம்
> > 
> > Best,
> > Shunsuke

-- 
மணிவண்ணன் சதாசிவம்

  reply	other threads:[~2022-10-27 15:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22  9:23 [PATCH v2] PCI: endpoint: pci-epf-{,v}ntb: fix a check for no epc alignment constraint Shunsuke Mie
2022-10-25 14:21 ` Manivannan Sadhasivam
2022-10-25 16:07   ` [EXT] " Frank Li
2022-10-27  1:43     ` Shunsuke Mie
2022-10-27 14:35       ` Frank Li
2022-10-27 15:12         ` Manivannan Sadhasivam [this message]
2022-10-27 15:34           ` Frank Li
2022-10-27 16:09             ` Manivannan Sadhasivam
2022-10-27 16:25               ` Frank Li
2022-10-28 10:56                 ` Shunsuke Mie

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=20221027151220.GC76627@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=allenbh@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=dave.jiang@intel.com \
    --cc=frank.li@nxp.com \
    --cc=jdmason@kudzu.us \
    --cc=kishon@ti.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mie@igel.co.jp \
    --cc=ntb@lists.linux.dev \
    /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.