Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753586Ab3IWI0s (ORCPT ); Mon, 23 Sep 2013 04:26:48 -0400 Received: from eu1sys200aog111.obsmtp.com ([207.126.144.131]:47605 "EHLO eu1sys200aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753171Ab3IWI0q (ORCPT ); Mon, 23 Sep 2013 04:26:46 -0400 Message-ID: <523FFB2C.1090400@st.com> Date: Mon, 23 Sep 2013 13:56:20 +0530 From: Ajit Pal Singh Reply-To: Organization: STMicroelectronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Eduardo Valentin Cc: "rui.zhang@intel.com" , "linux-pm@vger.kernel.org" , "grant.likely@linaro.org" , "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rob@landley.net" , Stephen GALLIMORE , Srinivas KANDAGATLA Subject: Re: [PATCH] thermal: st: Add support for STiH41x thermal sensors References: <1379497103-5657-1-git-send-email-ajitpal.singh@st.com> <523A06EE.9090801@ti.com> In-Reply-To: <523A06EE.9090801@ti.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2297 Lines: 72 On Thursday 19 September 2013 01:32 AM, Eduardo Valentin wrote: > On 18-09-2013 05:38, Ajit Pal Singh wrote: >> Adds support for thermal sensors on STiH41x series SOCs. >> Single trip point 'THERMAL_TRIP_CRITICAL' is supported. >> STIH416 MPE sensor supports interrupt reporting when a preset >> threshold temperature is crossed. >> For rest of the thermal sensors a polling delay of 10000ms is >> set. >> >> CC: Stephen Gallimore >> CC: Srinivas Kandagatla >> Signed-off-by: Ajit Pal Singh [snip] >> +static irqreturn_t st_thermal_thresh_int(int irq, void *data) >> +{ >> + struct st_thermal_sensor *sensor = data; >> + struct device *dev = sensor_to_dev(sensor); >> + >> + dev_dbg(dev, "%s,called\n", __func__); >> + thermal_zone_device_update(sensor->th_dev); > > Are you sure you want to do this here? The above call might sleep. Have used devm_request_threaded_irq() to register the above threaded irq handler. Calling sleep-able calls from the threaded interrupt handler should be OK ? > >> + return IRQ_HANDLED; >> +} [snip] >> +static int st_thermal_notify(struct thermal_zone_device *th, >> + int trip, enum thermal_trip_type type) >> +{ >> + struct st_thermal_sensor *sensor = thzone_to_sensor(th); >> + struct device *dev = sensor_to_dev(sensor); >> + >> + switch (type) { >> + case THERMAL_TRIP_CRITICAL: >> + /* TODO: Send event to user space */ > > It depends on what you mean by that. The core code will attempt to call > the shutdown command, in user space. Will remove the comment in the next version of the patch. > >> + dev_err(dev, "Critical temp reached:Going for shutdown\n"); >> + break; >> + default: >> + return -EINVAL; >> + } >> + return 0; >> +} >> + [snip] >> +module_platform_driver(st_thermal_driver); >> +MODULE_AUTHOR("STMicroelectronics (R&D) Limited"); >> +MODULE_DESCRIPTION("STMicroelectronics STIH41x SOC thermal sensor driver"); >> +MODULE_LICENSE("GPL"); > > GPL v2? OK.Will make it GPLv2 > Thanks Ajit Pal Singh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/