From: Tomasz Figa <t.figa@samsung.com> To: Vasanth Ananthan <vasanthananthan@gmail.com> Cc: linux-samsung-soc@vger.kernel.org, linux@arm.linux.org.uk, Vasanth Ananthan <vasanth.a@samsung.com>, Tomasz Figa <tomasz.figa@gmail.com>, linux-ide@vger.kernel.org, kgene.kim@samsung.com, thomas.abraham@linaro.org, jgarzik@pobox.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 6/6] ARM: EXYNOS5: SATA PHY controller driver Date: Tue, 16 Oct 2012 12:02:14 +0200 [thread overview] Message-ID: <2178134.oExSl5aWTm@amdc1227> (raw) In-Reply-To: <CAK1UHiw8+ebzGyjV53Y9efpMFPbCL9RR_o9ZSw=NTuRw_9gRwg@mail.gmail.com> [-- Attachment #1.1: Type: text/plain, Size: 1950 bytes --] Hi Vasanth, On Tuesday 16 of October 2012 12:03:47 Vasanth Ananthan wrote: > Hi Tomasz, > > On Sat, Oct 13, 2012 at 4:20 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote: > > Hi, > > > > On Tuesday 09 of October 2012 17:18:52 Vasanth Ananthan wrote: > >> This patch adds a platform driver and I2C client driver for SATA PHY > >> controller > >> > >> Signed-off-by: Vasanth Ananthan <vasanth.a@samsung.com> > >> --- > >> > >> drivers/ata/Makefile | 2 +- > >> drivers/ata/sata_exynos_phy.c | 303 > >> > >> +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 304 > >> insertions(+), 1 deletions(-) > >> > >> create mode 100644 drivers/ata/sata_exynos_phy.c > > [ ... ] > > >> + > >> + phy->init = sataphy_init; > >> + phy->shutdown = sataphy_shutdown; > >> + phy->priv_data = (void *)sataphy; > >> + phy->dev = &pdev->dev; > >> + > >> + ret = sata_add_phy(phy, SATA_PHY_GENERATION3); > >> + if (ret < 0) > >> + goto err4; > > > > Do you have any warranties that phy callbacks won't get called before > > i2c device probes and sets i2c_client? > > > >> + > >> + ret = i2c_add_driver(&sataphy_i2c_driver); > >> + if (ret < 0) > >> + goto err5; > >> + > >> + platform_set_drvdata(pdev, phy); > > I shall register my i2c client driver before assigning the SATA PHY > call backs. Would that guarantee the calling of phy callbacks after > the i2c device probes? No. You might still not have the sata phy i2c controller registered at that time and so the i2c driver will not be probed. The only definitive solution for this would be to register both platform and i2c drivers in module init (instead of using module_platform_driver) and defer the probe of platform driver until i2c device gets registered. You can defer the probe by returning -EPROBE_DEFER after checking that i2c_client is still NULL. Best regards, -- Tomasz Figa Samsung Poland R&D Center [-- Attachment #1.2: Type: text/html, Size: 11180 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: t.figa@samsung.com (Tomasz Figa) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/6] ARM: EXYNOS5: SATA PHY controller driver Date: Tue, 16 Oct 2012 10:02:30 -0000 [thread overview] Message-ID: <2178134.oExSl5aWTm@amdc1227> (raw) In-Reply-To: <CAK1UHiw8+ebzGyjV53Y9efpMFPbCL9RR_o9ZSw=NTuRw_9gRwg@mail.gmail.com> Hi Vasanth, On Tuesday 16 of October 2012 12:03:47 Vasanth Ananthan wrote: > Hi Tomasz, > > On Sat, Oct 13, 2012 at 4:20 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote: > > Hi, > > > > On Tuesday 09 of October 2012 17:18:52 Vasanth Ananthan wrote: > >> This patch adds a platform driver and I2C client driver for SATA PHY > >> controller > >> > >> Signed-off-by: Vasanth Ananthan <vasanth.a@samsung.com> > >> --- > >> > >> drivers/ata/Makefile | 2 +- > >> drivers/ata/sata_exynos_phy.c | 303 > >> > >> +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 304 > >> insertions(+), 1 deletions(-) > >> > >> create mode 100644 drivers/ata/sata_exynos_phy.c > > [ ... ] > > >> + > >> + phy->init = sataphy_init; > >> + phy->shutdown = sataphy_shutdown; > >> + phy->priv_data = (void *)sataphy; > >> + phy->dev = &pdev->dev; > >> + > >> + ret = sata_add_phy(phy, SATA_PHY_GENERATION3); > >> + if (ret < 0) > >> + goto err4; > > > > Do you have any warranties that phy callbacks won't get called before > > i2c device probes and sets i2c_client? > > > >> + > >> + ret = i2c_add_driver(&sataphy_i2c_driver); > >> + if (ret < 0) > >> + goto err5; > >> + > >> + platform_set_drvdata(pdev, phy); > > I shall register my i2c client driver before assigning the SATA PHY > call backs. Would that guarantee the calling of phy callbacks after > the i2c device probes? No. You might still not have the sata phy i2c controller registered at that time and so the i2c driver will not be probed. The only definitive solution for this would be to register both platform and i2c drivers in module init (instead of using module_platform_driver) and defer the probe of platform driver until i2c device gets registered. You can defer the probe by returning -EPROBE_DEFER after checking that i2c_client is still NULL. Best regards, -- Tomasz Figa Samsung Poland R&D Center -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121016/36672b49/attachment-0001.html>
next prev parent reply other threads:[~2012-10-16 10:02 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-09 11:48 [PATCH 0/6] Adding support for SATA in EXYNO5 Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-09 11:48 ` [PATCH 1/6] ARM: EXYNOS5: Clock settings for SATA and SATA PHY Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-09 11:48 ` [PATCH 2/6] ARM: EXYNOS5: DT Support " Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-09 18:28 ` Olof Johansson 2012-10-09 18:28 ` Olof Johansson 2012-10-10 8:38 ` Vasanth Ananthan 2012-10-10 8:38 ` Vasanth Ananthan 2012-10-10 9:20 ` Vasanth Ananthan 2012-10-10 9:20 ` Vasanth Ananthan 2012-10-10 16:31 ` Olof Johansson 2012-10-10 16:31 ` Olof Johansson 2012-10-11 6:49 ` Vasanth Ananthan 2012-10-11 6:49 ` Vasanth Ananthan 2012-10-09 11:48 ` [PATCH 3/6] DRIVERS: ATA: SATA PHY utility framework Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-12 22:30 ` Tomasz Figa 2012-10-12 22:30 ` Tomasz Figa 2012-10-15 9:46 ` Vasanth Ananthan 2012-10-15 9:46 ` Vasanth Ananthan 2012-10-09 11:48 ` [PATCH 4/6] ARM: S3C2410: I2C driver polling mode support Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-12 22:36 ` Tomasz Figa 2012-10-12 22:36 ` Tomasz Figa 2012-10-15 8:33 ` Heiko Stübner 2012-10-15 8:33 ` Heiko Stübner 2012-10-09 11:48 ` [PATCH 5/6] ARM: EYNOS5: SATA controller driver Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-12 22:45 ` Tomasz Figa 2012-10-12 22:45 ` Tomasz Figa 2012-10-09 11:48 ` [PATCH 6/6] ARM: EXYNOS5: SATA PHY " Vasanth Ananthan 2012-10-09 11:48 ` Vasanth Ananthan 2012-10-12 22:50 ` Tomasz Figa 2012-10-12 22:50 ` Tomasz Figa 2012-10-16 6:33 ` Vasanth Ananthan 2012-10-16 6:33 ` Vasanth Ananthan 2012-10-16 10:02 ` Tomasz Figa [this message] 2012-10-16 10:02 ` Tomasz Figa 2012-10-17 15:42 ` Tomasz Figa 2012-10-17 15:42 ` Tomasz Figa
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=2178134.oExSl5aWTm@amdc1227 \ --to=t.figa@samsung.com \ --cc=jgarzik@pobox.com \ --cc=kgene.kim@samsung.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-ide@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=thomas.abraham@linaro.org \ --cc=tomasz.figa@gmail.com \ --cc=vasanth.a@samsung.com \ --cc=vasanthananthan@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: linkBe 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.