All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Patrik Gfeller <patrik.gfeller@gmail.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: atomisp kernel driver(s)
Date: Wed, 20 May 2020 10:04:54 +0200	[thread overview]
Message-ID: <20200520100454.087168db@coco.lan> (raw)
In-Reply-To: <CAHp75VcSCd5PGhdchK+Yn_7HVvr7pJPK_9pORzwBhPzd2=MGFw@mail.gmail.com>

Em Tue, 12 May 2020 19:01:22 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> escreveu:

> On Tue, May 12, 2020 at 5:56 PM Mauro Carvalho Chehab
> <mchehab@kernel.org> wrote:
> > Em Tue, 12 May 2020 14:21:49 +0300
> > Andy Shevchenko <andy.shevchenko@gmail.com> escreveu:  
> > > On Tue, May 12, 2020 at 2:12 PM Andy Shevchenko
> > > <andy.shevchenko@gmail.com> wrote:  
> > > > On Tue, May 12, 2020 at 1:21 PM Mauro Carvalho Chehab
> > > > <mchehab@kernel.org> wrote:  
> > > > > Em Sat, 2 May 2020 20:33:14 +0300
> > > > > Andy Shevchenko <andy.shevchenko@gmail.com> escreveu:  
> > > > > > On Sat, May 2, 2020 at 8:04 PM Mauro Carvalho Chehab <mchehab@kernel.org> wrote:  
> > > > > > > Em Sat, 2 May 2020 19:08:36 +0300
> > > > > > > Andy Shevchenko <andy.shevchenko@gmail.com> escreveu:  
> > >
> > > ...
> > >  
> > > > Btw, https://git.linuxtv.org/mchehab/experimental.git/commit/?h=atomisp_v2.1&id=65608aa8d34ea274600ab2cf6f0cf54ee86d8fd1
> > > > is incorrect approach. Look closer what PCI does in case when
> > > > pcim_enable_device() has been called.  
> > >
> > > This has resource leaks
> > > https://git.linuxtv.org/mchehab/experimental.git/commit/?h=atomisp_v2.1&id=88b03de5d705f5f46a896dbd21ef9472030bb8d3
> > >
> > > Easier just to acpi_handle_info(ACPI_HANDLE(...), ...);
> > >
> > > We don't enumerate them w/o ACPI IIRC.  
> >
> > Well, at least while in staging, it would be good to know more details
> > about the probing issues on different hardware that people might be
> > testing it.
> >
> > avoiding to use a get_device() here is not possible, because the
> > prints will use the adev to return some info we may need:
> >
> >         ov2680 i2c-OVTI2680:00: ov2680_probe: ACPI detected it on bus ID=CAM1, HID=OVTI2680  
> 
> Why do you need get_device()? Are you expecting device may have gone?
> acpi_handle_*() / dev_*() are not enough?

Sorry for not answering this earlier. Got sidetracked by other things.

That's my miss-understanding: when I saw the name acpi_bus_get_device()
and looked at the code, where there is a function called
acpi_bus_put_acpi_device() that it is just a wrapper for 
put_device(&adev->dev), I just assumed that this function would be
internally calling get_device.

So, calling "put_device(&adev->dev)" or calling acpi_dev_put() would
get rid of any memory leaks.

After checking it better, that doesn't seem the case.

Anyway, for now, I'll just keep a call for acpi_bus_get_device() there,
as this is really helpful for debugging purposes. I'll add a notice
about potential memory leaks there, for us to address if/when porting
them to be generic I2C drivers.

If you have some suggestions about how to avoid memory leaks when
using it, feel free to suggest (or send us a patch).

There's zero chance of those sensor drivers to leave staging as-is.

A *major* re-work would be needed - and some drivers will just be
replaced by the upstream ones (like ov2680).

They have several stuff there with are specific to atomisp, including
the entire ACPI binding. We'll need to work on a different way to
do that outside staging.

> > This, together with the DMI product ID on this message:
> >
> >         atomisp-isp2 0000:00:03.0: Detected Cherrytrail version 54 (ISP2401) on T101HA
> >
> > may help to avoid users to run acpixtract/iasl/dmidecode when adding
> > new entries to the dmi match tables. Not 100%, since BIOSes may
> > still use different names for the sensor data.  
> 
> > Trying to open a video devnode returns error and produce those logs:
> >
> >         [ 3262.961623] atomisp-isp2 0000:00:03.0: open device ATOMISP ISP CAPTURE output
> >         [ 3262.971350] sh_css_hrt_system_is_idle() 44: warning: SP not idle
> >         [ 3262.971364] sh_css_hrt_system_is_idle() 49: warning: ISP not idle
> >         [ 3262.971712] sh_css_hrt_system_is_idle() 56: warning: FIFO channel 12 is not empty
> >         [ 3262.972079] sh_css_hrt_system_is_idle() 56: warning: FIFO channel 26 is not empty
> >         [ 3262.972188] atomisp-isp2 0000:00:03.0: css init failed --- bad firmware?
> >         [ 3262.974982] atomisp-isp2 0000:00:03.0: atomisp_mrfld_pre_power_down: error in iunit interrupt. status reg=0xffffffff  
> 
> In my case when I tried with 2015-04 / 2015-05 firmware for ISP2400 I
> got to no crashes, but no IRQs, presumably due to absence of PMIC
> integration.

Yeah, maybe. With the current version, I'm getting IRQs telling
that the frames are ready:

	[ 3635.285469] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.285494] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 97, asd 0
	[ 3635.285600] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.285625] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 98, asd 0
	[ 3635.285734] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.285750] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 99, asd 0
	[ 3635.285861] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.285879] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 100, asd 0
	[ 3635.285990] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.286005] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 101, asd 0
	[ 3635.286120] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.286135] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 102, asd 0
	[ 3635.286251] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.286265] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 103, asd 0
	[ 3635.286384] atomisp-isp2 0000:00:03.0: irq:0x200000
	[ 3635.286401] atomisp-isp2 0000:00:03.0: atomisp_isr EOF exp_id 104, asd 0

What is funny is that those events are producing v4l2 events, instead of
being written to the dqbuf directly.

I suspect that the userspace code should do something with such
events, before the driver release the buffers to userspace via DQBUF.

Btw, if you still have your isp2400 hardware, it would be worth if you
could check if the current driver produces some result there.

Thanks,
Mauro

  parent reply	other threads:[~2020-05-20  8:05 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 14:39 atomisp kernel driver(s) Patrik Gfeller
2020-04-18 15:25 ` Mauro Carvalho Chehab
2020-04-18 15:26   ` Mauro Carvalho Chehab
2020-04-18 15:37     ` Patrik Gfeller
2020-04-19 23:31       ` Mauro Carvalho Chehab
2020-04-20 17:48         ` Patrik Gfeller
2020-04-20 18:27           ` Patrik Gfeller
2020-04-20 20:47             ` Mauro Carvalho Chehab
2020-04-22 17:56               ` Patrik Gfeller
2020-04-22 19:13                 ` Mauro Carvalho Chehab
2020-04-24  8:52                   ` Patrik Gfeller
2020-04-24  9:10                     ` Patrik Gfeller
2020-04-24 10:07                       ` Patrik Gfeller
2020-04-24 13:58                         ` Patrik Gfeller
2020-04-25 11:22                         ` Mauro Carvalho Chehab
2020-04-26 11:38                           ` Patrik Gfeller
2020-04-26 16:50                             ` Mauro Carvalho Chehab
2020-04-27 18:31                               ` Patrik Gfeller
2020-04-27 21:50                                 ` Mauro Carvalho Chehab
2020-04-28 17:59                                   ` Patrik Gfeller
2020-04-28 23:13                                     ` Mauro Carvalho Chehab
2020-04-29 17:56                                       ` Patrik Gfeller
2020-04-29 18:17                                         ` Mauro Carvalho Chehab
2020-04-30  7:56                                           ` Patrik Gfeller
2020-04-30 10:55                                             ` Mauro Carvalho Chehab
2020-04-30 15:09                                               ` Patrik Gfeller
2020-04-30 22:25                                                 ` Mauro Carvalho Chehab
2020-05-01  8:54                                                   ` Patrik Gfeller
2020-05-01  9:38                                                     ` Mauro Carvalho Chehab
2020-05-01 17:31                                                       ` Patrik Gfeller
2020-05-01 19:30                                                         ` Mauro Carvalho Chehab
2020-05-02  8:15                                                           ` Patrik Gfeller
2020-05-02  9:20                                                             ` Patrik Gfeller
2020-05-02 10:00                                                               ` Mauro Carvalho Chehab
2020-05-02  9:34                                                             ` Mauro Carvalho Chehab
2020-05-02 14:29                                                               ` Patrik Gfeller
2020-05-02 16:28                                                                 ` Mauro Carvalho Chehab
2020-05-02 18:23                                                                   ` Patrik Gfeller
2020-05-02 14:50                                                               ` Patrik Gfeller
2020-05-01 20:56                                                         ` [PATCH] media: atomisp: use add_qos_request instead of update Mauro Carvalho Chehab
2020-04-18 15:29   ` atomisp kernel driver(s) Patrik Gfeller
2020-04-25  2:39 ` Laurent Pinchart
2020-04-25 10:36   ` Patrik Gfeller
2020-04-25 12:19     ` Mauro Carvalho Chehab
2020-04-26 19:07       ` Laurent Pinchart
2020-04-26 20:51         ` Mauro Carvalho Chehab
2020-04-26 19:33     ` Laurent Pinchart
2020-04-28 18:13       ` Patrik Gfeller
2020-04-26  7:44   ` Patrik Gfeller
2020-04-26 19:17     ` Laurent Pinchart
2020-04-29 17:59       ` Patrik Gfeller
2020-04-29 18:19         ` Laurent Pinchart
2020-04-30 15:28           ` Patrik Gfeller
2020-05-02 16:08 ` Andy Shevchenko
2020-05-02 17:04   ` Mauro Carvalho Chehab
2020-05-02 17:33     ` Andy Shevchenko
2020-05-03 10:18       ` Mauro Carvalho Chehab
2020-05-12 10:20       ` Mauro Carvalho Chehab
2020-05-12 11:12         ` Andy Shevchenko
2020-05-12 11:21           ` Andy Shevchenko
2020-05-12 14:56             ` Mauro Carvalho Chehab
2020-05-12 16:01               ` Andy Shevchenko
2020-05-13 18:36                 ` Patrik Gfeller
2020-05-20  8:04                 ` Mauro Carvalho Chehab [this message]
2020-05-13  9:56               ` Mauro Carvalho Chehab
2020-05-03  8:46   ` Patrik Gfeller
2020-05-03 10:23     ` Mauro Carvalho Chehab
2020-05-03 12:31       ` Patrik Gfeller
2020-05-03 13:36         ` Patrik Gfeller
2020-05-03 14:43         ` Mauro Carvalho Chehab

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=20200520100454.087168db@coco.lan \
    --to=mchehab@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=patrik.gfeller@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 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.