From: Lukasz Majewski <l.majewski@samsung.com> To: cw00.choi@samsung.com Cc: cwchoi00@gmail.com, Zhang Rui <rui.zhang@intel.com>, Eduardo Valentin <edubezval@gmail.com>, Kukjin Kim <kgene@kernel.org>, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>, Kyungmin Park <kyungmin.park@samsung.com>, Amit Kachhap <amit.daniel@samsung.com>, Abhilash Kesavan <a.kesavan@samsung.com>, "inki.dae@samsung.com" <inki.dae@samsung.com>, "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, linux-samsung-soc <linux-samsung-soc@vger.kernel.org>, linux-kernel <linux-kernel@vger.kernel.org> Subject: Re: [PATCH 1/3] thermal: exynos: Fix NULL pointer exception during kernel booting Date: Mon, 16 Feb 2015 17:28:02 +0100 [thread overview] Message-ID: <20150216172802.414525a9@amdc2363> (raw) In-Reply-To: <CAGTfZH3tESLb3V7PNpiy-nwi+cCVq6DHxkU6+gJU-MZhNqDBzg@mail.gmail.com> Hi Chanwoo, > Hi Lukasz, > > On Tue, Feb 17, 2015 at 12:06 AM, Lukasz Majewski > <l.majewski@samsung.com> wrote: > > Hi Chanwoo, > > > >> This patch fixes the NULL pointer exception during kernel booting. > >> The thermal_zone _of_sensor_register() registers a sensor to DT > >> thermal zone and then read the current temperature by '.get_temp' > >> callback. The callback function of exynos thermal driver is > >> exynos_get_temp() which must need the 'pdata' instance of > >> exynos_tmu _platform_data structure. > >> - exynos_get_temp() -> code_to_temp() -> Must need the 'pdata' > >> instance > >> > >> But, exynos thermal driver is executed before getting the 'pdata' > >> instance. To avoid the kernel panic, have to get the platform data > >> by executing the exynos_map_dt_data() before calling > >> thermal_zone_of_sensor_register() . > > > > I've already prepared patch for this (unfortunately it isn't yet > > applied to mainline): > > > > "[PATCH] thermal: exynos: fix: Check if data->tmu_read callback is > > present before read" > > > > http://www.spinics.net/lists/linux-samsung-soc/msg42245.html > > There is different issue between you patch and this patch. > Your patch check the whether data->tmu_read is NULL or not. > But, my patch check the pdata is NULL or not. I've tried to do the same previously. Please compare with: [PATCH 1/2] thermal: exynos: Reorder exynos_map_dt_data() function http://www.spinics.net/lists/linux-samsung-soc/msg41308.html Unfortunately, Abhilash found some issues with this code, so I've looked into different solution. However, I didn't need to move pdata = data->pdata; Hence, I wonder why it need to be reordered. Are you using Exynos3250 based device? > > > > > Does applying this patch help? > > > > BTW: How can I reproduce this error? Could you point me the SHA1 and > > repository? > > I used your patch-set of linux-soc-thermal.git (branch: next). So I > applied you patchiest on Linux 3.19 for test. > - > https://git.kernel.org/cgit/linux/kernel/git/evalenti/linux-soc-thermal.git/log/?h=next Is there any special .config? May I ask about the target platform? I will look closely on this problem tomorrow. > > Best Regards, > Chanwoo Choi -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
WARNING: multiple messages have this Message-ID (diff)
From: l.majewski@samsung.com (Lukasz Majewski) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] thermal: exynos: Fix NULL pointer exception during kernel booting Date: Mon, 16 Feb 2015 17:28:02 +0100 [thread overview] Message-ID: <20150216172802.414525a9@amdc2363> (raw) In-Reply-To: <CAGTfZH3tESLb3V7PNpiy-nwi+cCVq6DHxkU6+gJU-MZhNqDBzg@mail.gmail.com> Hi Chanwoo, > Hi Lukasz, > > On Tue, Feb 17, 2015 at 12:06 AM, Lukasz Majewski > <l.majewski@samsung.com> wrote: > > Hi Chanwoo, > > > >> This patch fixes the NULL pointer exception during kernel booting. > >> The thermal_zone _of_sensor_register() registers a sensor to DT > >> thermal zone and then read the current temperature by '.get_temp' > >> callback. The callback function of exynos thermal driver is > >> exynos_get_temp() which must need the 'pdata' instance of > >> exynos_tmu _platform_data structure. > >> - exynos_get_temp() -> code_to_temp() -> Must need the 'pdata' > >> instance > >> > >> But, exynos thermal driver is executed before getting the 'pdata' > >> instance. To avoid the kernel panic, have to get the platform data > >> by executing the exynos_map_dt_data() before calling > >> thermal_zone_of_sensor_register() . > > > > I've already prepared patch for this (unfortunately it isn't yet > > applied to mainline): > > > > "[PATCH] thermal: exynos: fix: Check if data->tmu_read callback is > > present before read" > > > > http://www.spinics.net/lists/linux-samsung-soc/msg42245.html > > There is different issue between you patch and this patch. > Your patch check the whether data->tmu_read is NULL or not. > But, my patch check the pdata is NULL or not. I've tried to do the same previously. Please compare with: [PATCH 1/2] thermal: exynos: Reorder exynos_map_dt_data() function http://www.spinics.net/lists/linux-samsung-soc/msg41308.html Unfortunately, Abhilash found some issues with this code, so I've looked into different solution. However, I didn't need to move pdata = data->pdata; Hence, I wonder why it need to be reordered. Are you using Exynos3250 based device? > > > > > Does applying this patch help? > > > > BTW: How can I reproduce this error? Could you point me the SHA1 and > > repository? > > I used your patch-set of linux-soc-thermal.git (branch: next). So I > applied you patchiest on Linux 3.19 for test. > - > https://git.kernel.org/cgit/linux/kernel/git/evalenti/linux-soc-thermal.git/log/?h=next Is there any special .config? May I ask about the target platform? I will look closely on this problem tomorrow. > > Best Regards, > Chanwoo Choi -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
next prev parent reply other threads:[~2015-02-16 16:28 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-02-16 14:20 [PATCH 0/3] thermal: exynos: Fix NULL pointer error and bug of PD_DET_EN of Exynos7 Chanwoo Choi 2015-02-16 14:20 ` Chanwoo Choi 2015-02-16 14:20 ` [PATCH 1/3] thermal: exynos: Fix NULL pointer exception during kernel booting Chanwoo Choi 2015-02-16 14:20 ` Chanwoo Choi 2015-02-16 15:06 ` Lukasz Majewski 2015-02-16 15:06 ` Lukasz Majewski 2015-02-16 16:15 ` Chanwoo Choi 2015-02-16 16:15 ` Chanwoo Choi 2015-02-16 16:28 ` Lukasz Majewski [this message] 2015-02-16 16:28 ` Lukasz Majewski 2015-02-16 17:00 ` Chanwoo Choi 2015-02-16 17:00 ` Chanwoo Choi 2015-02-16 14:20 ` [PATCH 2/3] thermal: exynos: Fix wrong control of power down detection mode for Exynos7 Chanwoo Choi 2015-02-16 14:20 ` Chanwoo Choi 2015-02-16 14:20 ` [PATCH 3/3] thermal: exynos: Clean-up code to use oneline entry for exynos compatible table Chanwoo Choi 2015-02-16 14:20 ` Chanwoo Choi 2015-02-16 15:07 ` Lukasz Majewski 2015-02-16 15:07 ` Lukasz Majewski
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=20150216172802.414525a9@amdc2363 \ --to=l.majewski@samsung.com \ --cc=a.kesavan@samsung.com \ --cc=amit.daniel@samsung.com \ --cc=b.zolnierkie@samsung.com \ --cc=cw00.choi@samsung.com \ --cc=cwchoi00@gmail.com \ --cc=edubezval@gmail.com \ --cc=inki.dae@samsung.com \ --cc=kgene@kernel.org \ --cc=kyungmin.park@samsung.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=rui.zhang@intel.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.