Re: [net PATCH v2] octeontx2-af: Move validation of ptp pointer before its usage

From: Sunil Kovvuri
Date: Fri Jun 30 2023 - 02:47:20 EST


On Fri, Jun 30, 2023 at 11:16 AM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> On Fri, Jun 30, 2023 at 05:19:27AM +0000, Sai Krishna Gajula wrote:
> >
> > > -----Original Message-----

> >
> > As suggested, we will return error in ptp_probe in case of any
> > failure conditions. In this case AF driver continues without PTP support.
>
> I'm concerned about the "AF driver continues without PTP support".
>

Yes, it doesn't make sense to proceed with AF driver if PTP driver
probe has failed.
PTP driver probe will fail upon memory alloc or ioremap failures, such failures
will most likely be encountered by AF driver as well. So better not
continue with AF driver probe.

> > When the AF driver is probed before PTP driver , we will defer the AF
> > probe. Hope these changes are inline with your view.
> > I will send a v3 patch with these changes.
> >
>
> I don't really understand the situation. You have two drivers.
> Normally, the relationship is very simple where you have to load one
> before you can load the other. But here it sounds like the relationships
> are very complicated and you are loading one in a degraded state for
> some reason...
>

No, the relationship is simple. Idea is to defer AF driver probe until
PTP driver is loaded.
Once the above is fixed there won't be any degraded state.

Thanks,
Sunil.