From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5D882FB0BC for ; Tue, 25 Nov 2025 21:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764105798; cv=none; b=JdGhV5eOUyAkZ4bUWWLO/KHJr75ZmyjzjqDEb0tFArmbPXVz3X4mPIuQRasQs00IA12r/QFtdnIPPLDG/i//PW9KhflfLO2f6x13vn/NU+ocODQgkqhQ/mhni93YYADQG+81c1mg1l8CI4hF5XxunrnDBqn0DEY5GnLDDGGxwBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764105798; c=relaxed/simple; bh=XW8A4SzGkXNACEumt8HO2D04lyJS8Mfw08PkaKSIHl4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LC5WtNR6Z/4me94+paeOv5/s2K2l6J4zToNX4dDdeWpnGqu0GO6zah98ZZjvueUJ+ueeoUF1uodvLe77t6FTnldwsUmnloHoEAoF31lK0Z0C37xTAeEwGTZmNVr9RdnxgYqt8J2fFhNsQov5uDpOBf1wt4YNrLghwxJWhU/bhvI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jxomuv+L; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jxomuv+L" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-b98a619f020so4800680a12.2 for ; Tue, 25 Nov 2025 13:23:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764105796; x=1764710596; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=U4IPiaiC8wPPJ43L5jRER+JtLVLAZIm9IvLWnVk5O64=; b=jxomuv+LDLuWrt8BHvoPK9PCJoKFokds+p7JXcTxp33BbfVa5yluoYVGSy1rqC9dvh MN/6dLjD3TAUVFYjmoK0pxBVvD4e6mxdxKDTBWbFR9IMVAKjXy405uZnaulSSm6tdcaP vSwI6B7yqF0wMnjQGaI8NCi95wYpAiZvUG/66X0kmuoqsdf3YfB5yPk5Q+neT/5/1lCC Yzf+D3FTpt+VGN0kVxbpAIFOsQ9r+nOx6inPnNvdOb/fcw8hJMGw9KvmMFr+/p8CNFib GHut+daAkxA3VtnHPHvLekZoOE3EOsvjR759RUCEzAw9tZjQJ73CIg/SJ8DsIhEA1cWI hTPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764105796; x=1764710596; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=U4IPiaiC8wPPJ43L5jRER+JtLVLAZIm9IvLWnVk5O64=; b=uH5aABdx3ClmofJnpn3qU1/5/xPIcR1rVOQaeatxSWaP9A6DDKxn0z+fiePXXcF1xC 5Uo3F87mlgXQrsuoCI5N/mNIDfpa58tM0ApTNo4Ytdf34GhuE8+m7wSMfXTA93ql52xT nO7kJqTLZANF/hZm2pO/uYf75xK9VskXJ1FjrGAi5on1BMXhjQL0fhqPZdePVi5Bqfku wncqkrTyhKRAqEnDgaCMSu4PpzgBYjFyiuVGS/Ts2b9Lk6UP4UndU48+Ims31rDFUag6 Eg3+7cwt/W0fpcklDbME4h98tTn3p+AvTA+fyFiLckUAKWYk4glnTCHRHD2LL/yiy3LA xvtg== X-Forwarded-Encrypted: i=1; AJvYcCXNmipxKQes98oGp5ZaF66h+WkpT76Hnaw9J4sf0wlTJWADoBjzAiWawLnVK5+6nHgV4MTSlwyth8TWrhA=@vger.kernel.org X-Gm-Message-State: AOJu0YyOboMEox/Vc6UQeM2uiR/6k2I54GPlJcTCWM/fDKaUaaHSZ1GB 3P6f5ECCxoW/q5OeB9tzmLG4pb6fBEE8TNs1RhKxDB3YHgb7Nw7Y1Qze X-Gm-Gg: ASbGncvYwkgQeFt6hmEFp+B+0a9i3irioZdpKY4eJjOwouwJMrat4FErQigdkoxXNYB QmnZr+kpR5lotqRwwss4lI9n9bgH7czN/E9J9TA0CrKACDLOedgeG3DVYGjIsvz1oziL5IMTNar 5OauPCpY3B7WEWqll8ex37rLhD7X2yaRmJdg2UPLEyxXRQeGpJ+LyPO3vjeBP6tuWV2wTaXv6kT 8KRJHLUq6Gj4h0fvd72uLPagqURm1WyRxgoMInAtOKIlQUnTCaduF54S9wwcxXUT/jGkR42TB5F BmQcDsG86M7wdw62Ti74DIvfvlB8Qw47O8M5kupTX1MxWIagxyqERC88vSRJjtyOBsCiN2VY3pT lKFRHCcy9aom10TzzIR2FRNzd5N7kk9PNBZDgv/xOmGxekAEv95ci4CojForTpjZs0wi91Zji1e EzkfAvJY0avE8KGpgrmuYv26+ObfTKR8szCrahCVArTfzNQo1AF3Gb0P7Mfjkn9wlE X-Google-Smtp-Source: AGHT+IF6D8g2wIy+N6TKTf0dz5XOxIIs00ONhYLTRePucR1HQFiuvK+uZSIsc+LE+bc5dfe4y+fV4g== X-Received: by 2002:a05:7301:100a:b0:2a4:3594:72ed with SMTP id 5a478bee46e88-2a7192a78d9mr9719248eec.28.1764105795955; Tue, 25 Nov 2025 13:23:15 -0800 (PST) Received: from [192.168.68.63] (104-12-136-65.lightspeed.irvnca.sbcglobal.net. [104.12.136.65]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2a6fc53169csm63700374eec.4.2025.11.25.13.23.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Nov 2025 13:23:15 -0800 (PST) Message-ID: <61e860e7-fc3b-49ad-bf6a-9745f205d52b@gmail.com> Date: Tue, 25 Nov 2025 13:23:14 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 5/6] iio: accel: Prevent NULL pointer dereference in interrupt setup To: Andy Shevchenko , Konrad Dybcio Cc: Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jonathan Cameron , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org References: <20251124-expressatt_nfc_accel_magn_light-v4-0-9c5686ad67e2@gmail.com> <20251124-expressatt_nfc_accel_magn_light-v4-5-9c5686ad67e2@gmail.com> Content-Language: en-US From: Rudraksha Gupta In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11/25/25 03:14, Andy Shevchenko wrote: > On Tue, Nov 25, 2025 at 11:45:22AM +0100, Konrad Dybcio wrote: >> On 11/25/25 12:35 AM, Rudraksha Gupta via B4 Relay wrote: >>> The bmc150_accel_set_interrupt() function assumes that the interrupt >>> info is provided. However, when no IRQ is provided, the info pointer >>> remains NULL, leading to a kernel oops: >> Hm, are you sure your device really doesn't have a pin connected to >> the IC's interrupt line? > I don't know the actual case here, but in general such a design occurred > in real life. So, shouldn't be a surprise to see another polling only mode > connection like this. > I unfortunately don't have the schematics, so I can only reference the downstream kernel: https://codeberg.org/LogicalErzor/Android_Kernel_Samsung_D2/commits/branch/downstream The above is my kernel tree. This is based on: https://github.com/LineageOS/android_kernel_samsung_d2/tree/cm-14.1 but with a few added commits on top to help me navigate the codebase. Notably, I've removed all .c files that wasn't needed by the downstream kernel, and verified that it works by flashing the kernel with Cyanogenmod running. Based on the device's config: https://codeberg.org/LogicalErzor/Android_Kernel_Samsung_D2/src/branch/downstream/arch/arm/configs/cyanogen_expressatt_defconfig There is no .irq defined for the accelerator: https://codeberg.org/LogicalErzor/Android_Kernel_Samsung_D2/src/branch/downstream/arch/arm/mach-msm/board-express.c#L2100 I also couldn't find a hardcoded irq in the driver code as well: https://codeberg.org/LogicalErzor/Android_Kernel_Samsung_D2/src/branch/downstream/drivers/sensors/accelerometer/yas_acc_driver-bma25x.c https://codeberg.org/LogicalErzor/Android_Kernel_Samsung_D2/src/branch/downstream/drivers/sensors/accelerometer/yas_acc_kernel_driver.c This seems to be confirmed upstream too, where one has an irq: https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/st/ste-ux500-samsung-skomer.dts#L420 and others don't: https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/st/ste-ux500-samsung-kyle.dts#L439 https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/st/ste-ux500-samsung-codina-tmo.dts#L506 Happy to split this patch series into two, just let me know! :)