Linux-ide Archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <cassel@kernel.org>
To: "Pandey, Radhey Shyam" <radhey.shyam.pandey@amd.com>
Cc: Markus Elfring <Markus.Elfring@web.de>,
	Damien Le Moal <dlemoal@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	"Simek, Michal" <michal.simek@amd.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"git (AMD-Xilinx)" <git@amd.com>
Subject: Re: [PATCH v3] ata: ahci_ceva: fix error handling for Xilinx GT PHY support
Date: Mon, 19 Feb 2024 20:14:47 +0100	[thread overview]
Message-ID: <ZdOop9IHRxtIY+Ds@x1-carbon> (raw)
In-Reply-To: <MN0PR12MB59537A9F0EAEAC9E844C8DCDB7512@MN0PR12MB5953.namprd12.prod.outlook.com>

Hello Radhey, Markus,

On Mon, Feb 19, 2024 at 06:42:49PM +0000, Pandey, Radhey Shyam wrote:
> > -----Original Message-----
> > From: Markus Elfring <Markus.Elfring@web.de>
> > Sent: Monday, February 19, 2024 9:27 PM
> > To: Niklas Cassel <cassel@kernel.org>; Pandey, Radhey Shyam
> > <radhey.shyam.pandey@amd.com>; Damien Le Moal
> > <dlemoal@kernel.org>; Jens Axboe <axboe@kernel.dk>; Simek, Michal
> > <michal.simek@amd.com>; Philipp Zabel <p.zabel@pengutronix.de>; linux-
> > ide@vger.kernel.org; kernel-janitors@vger.kernel.org
> > Cc: LKML <linux-kernel@vger.kernel.org>; git (AMD-Xilinx) <git@amd.com>
> > Subject: Re: [PATCH v3] ata: ahci_ceva: fix error handling for Xilinx GT PHY
> > support
> > 
> > > > Platform clock and phy error resources are not cleaned up in Xilinx GT
> > PHY
> > > > error path.
> > > >
> > > > To fix introduce the function ceva_ahci_platform_enable_resources()
> > …
> > > Applied:
> > >
> > https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/log/?h=for-
> > 6.8-fixes
> > 
> > The error code “-EINVAL” was set before the statement “goto
> > disable_resources”
> > multiple times in the adjusted implementation of the function
> > “ceva_ahci_probe”.
> > I suggest to add a jump target so that a bit of exception handling
> > can be better reused at the end of this function.
> > 
> > 
> > How do you think about to apply the following script for the semantic
> > patch language (Coccinelle software) accordingly?
> > 
> > 
> > @replacement1@
> > identifier rc;
> > @@
> >  <+...
> >  if (...)
> >  {
> >     ... when != rc
> > -   rc = -EINVAL;
> >     goto
> > -        disable_resources
> > +        e_inval
> >     ;
> >  }
> >  ...+>
> >  return 0;
> > +
> > +e_inval:
> > +rc = -EINVAL;
> >  disable_resources:
> >  ahci_platform_disable_resources(hpriv);
> > 
> > @replacement2 disable neg_if, drop_else@
> > identifier replacement1.rc;
> > statement is;
> > @@
> >  if (...)
> >     is
> >  else
> >  {
> >     ... when != rc
> > -   rc = -EINVAL;
> >     goto
> > -        disable_resources
> > +        e_inval
> >     ;
> >  }
> > 
> > 
> Thanks for the suggestion. However, taking a look at the existing implementation
> i think we should return error code *as is * from of_property_read() APIs.
> and get rid of rc=-EINVAL reassignment itself. 
> 
> If it sounds ok, I can add it to my to-do list and send out a patch.

Sounds good to me.


Kind regards,
Niklas

      reply	other threads:[~2024-02-19 19:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 18:14 [PATCH v3] ata: ahci_ceva: fix error handling for Xilinx GT PHY support Radhey Shyam Pandey
2024-02-19 10:14 ` Niklas Cassel
2024-02-19 15:57   ` Markus Elfring
2024-02-19 18:42     ` Pandey, Radhey Shyam
2024-02-19 19:14       ` Niklas Cassel [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=ZdOop9IHRxtIY+Ds@x1-carbon \
    --to=cassel@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=axboe@kernel.dk \
    --cc=dlemoal@kernel.org \
    --cc=git@amd.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=p.zabel@pengutronix.de \
    --cc=radhey.shyam.pandey@amd.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 read-only IMAP folder(s) and NNTP newsgroup(s).