From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 0567D18CC12 for ; Tue, 8 Oct 2024 12:06:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728389201; cv=none; b=pa0T515DnZRNAaf8loMRVQbMWElZnCe0/YuQ9/WPetRPahNQOQYlJ62AEz7QvQs3OPa2gqoTc2kSpSy2Piw9CZ9/oHJNOi3LUyvY5hsHQMiG5JlDi06BBcAEn/IxxjvJ6Lrno7UTntqbYgbwmJk8Uz1iXTXaONchxJJQzIR+RdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728389201; c=relaxed/simple; bh=C9cDbrrxtx4ZmBKHBu4HVjd7F8cAetIH8uHWjTs36Dg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HX+55YOmI66FfSOs9diAmyQg6Aq4pikIPb4QCuGPU62fvsetHxhUPMJHdChUL9t6OJAzMPUXX01EmZIj3KiukaHjdkCAIIpMd4BHWm5/Po3FIGEspBlSw0/69q4j+FqkpMaS7LhuQWP3UEE2XvztIKyQpvbHnU/teIJ7oLGWxk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=giwKSVby; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="giwKSVby" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-37d375f1237so13091f8f.2 for ; Tue, 08 Oct 2024 05:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728389198; x=1728993998; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=iGf+BR0KrrmgaGAuaJbmSqaodYMEl3pXPdxzjA7otv0=; b=giwKSVbyk9H6VTjwCtHv0CGAU+7xZYnVIOW5F26lcPJdq622yHrkFHsNdibwgfW4LW Nx0d3vh8ZYX7SqhxkyZ9nm67KV0iy41bk7jWYnmRD4mnq/UeK9Wz3rgT/LftBXMzbSgB T3lUCds5/fFOX7+9IZwaPNiYnuaIcD9o0/5tGMoeIdj5AQoWGV+0MD7NQh8qAOIdIkFI 92e3oXtuYRq8VcfotVkIDLHbQQ7moPUP5FGuZP9mFQn76debE294SmWbjWGmDj8uT4XL nn232khdYpbaAH+L8wk2HGBo9Qj1mSlks+OjI9xCm2naLAs35cE/B86hDx8yEaIAgFAV MbDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728389198; x=1728993998; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iGf+BR0KrrmgaGAuaJbmSqaodYMEl3pXPdxzjA7otv0=; b=C+Qrf0JNDDIGKNjGk6MjGvaeb2OE7QHRI9JF+0boyWzut0P7ST93pty+UaKFbVVtji AshEBEFKM765ls+YJERTIu6bUptIqIPYJbC+RQkUWQiAVz1MhU29DzuosPSNqqPE+2nB 77znxZ9SLDjHtlEZR9Dxc6bxJt6xxiQDKhlUPqRFbMy8yZufA53/Dr5t+tw5LLhMB3jh b542To+i8s3p3febewPQRzoG71PZdQ9iOzaPug4mUN0Pgwv6Ymn870FpwuJTP4XC5/HI Ue0Q2dJIHPVAaTB+DjIBl2ejaySbYZ+OReA9TVPVtSYE4p8xXRhYvLGSwt/oYbSkLkwb UE1A== X-Forwarded-Encrypted: i=1; AJvYcCUJOM56g/s6z3CgYav2d+Ohe0hdT5zRgTHYetQrBaAtT3gsAcDYV55j8//dTfMjkCrP7UEozubOabVu@vger.kernel.org X-Gm-Message-State: AOJu0YxuviMWmPLADRW0J9y1h0ctgIS1K/X/A4ll0glWsSP9lPuRmTiv u4QRmR7bNNuBxXmduxgHkI+qttahI24mlP0BXwFlSLZm0pIV+a1nXh8AzT9BNn0= X-Google-Smtp-Source: AGHT+IETx4zJQG9Gtv9tJl5KEt3s5Nj6WvOe8z1JDWgXuG3lKhsMf0Q8IFdD+xxXTnMptWM+cE+r7g== X-Received: by 2002:a5d:5850:0:b0:37c:ffdd:6d57 with SMTP id ffacd0b85a97d-37d0e6cc8f2mr4354911f8f.1.1728389198183; Tue, 08 Oct 2024 05:06:38 -0700 (PDT) Received: from [192.168.1.20] ([178.197.211.167]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d1695ec1esm8013990f8f.74.2024.10.08.05.06.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2024 05:06:36 -0700 (PDT) Message-ID: <268d0dd0-a65f-4eaa-a317-fe9fcc06e718@linaro.org> Date: Tue, 8 Oct 2024 14:06:35 +0200 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/6] dt-bindings: media: qcom,sc8280xp-camss: Fix interrupt types To: Vladimir Zapolskiy , Bjorn Andersson Cc: Robert Foss , Todor Tomov , Bryan O'Donoghue , Konrad Dybcio , Mauro Carvalho Chehab , Hans Verkuil , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org References: <20240923072827.3772504-1-vladimir.zapolskiy@linaro.org> <20240923072827.3772504-2-vladimir.zapolskiy@linaro.org> <3f87e855-8779-4df3-8f26-e3d2b611d3e9@linaro.org> <313667a6-afcd-44cb-a6f6-0d550e8f68a0@linaro.org> <4bf490cb-228d-4f01-a956-cacbafa94e2a@linaro.org> <5ea36051-1e1b-44ca-b5ef-d6305079201b@linaro.org> <80744e19-71f8-4ae7-b2e8-1dc14e55385c@linaro.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFU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YfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <80744e19-71f8-4ae7-b2e8-1dc14e55385c@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 08/10/2024 14:03, Vladimir Zapolskiy wrote: > > > On 10/8/24 14:45, Krzysztof Kozlowski wrote: >> On 08/10/2024 13:37, Vladimir Zapolskiy wrote: >>> Hi Krzysztof. >>> >>> On 10/8/24 14:15, Krzysztof Kozlowski wrote: >>>> On 08/10/2024 12:02, Vladimir Zapolskiy wrote: >>>>> Hi Bjorn, >>>>> >>>>> On 10/6/24 05:36, Bjorn Andersson wrote: >>>>>> On Mon, Sep 23, 2024 at 10:28:22AM GMT, Vladimir Zapolskiy wrote: >>>>>>> The expected type of all CAMSS interrupts is edge rising, fix it in >>>>>>> the documented example from CAMSS device tree bindings for sc8280xp. >>>>>>> >>>>>> >>>>>> Who/what expects them to be RISING? >>>>> >>>>> I've checked CAMSS device tree bindings in a number of downstream kernels, >>>>> all of them describe interrupt types as edge rising. >>>>> >>>>> $ grep -Hn IRQF_TRIGGER drivers/media/platform/qcom/camss/* >>>>> drivers/media/platform/qcom/camss/camss-csid.c:619: IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, >>>>> drivers/media/platform/qcom/camss/camss-csiphy.c:605: IRQF_TRIGGER_RISING | IRQF_NO_AUTOEN, >>>>> drivers/media/platform/qcom/camss/camss-ispif.c:1164: IRQF_TRIGGER_RISING, ispif->irq_name, ispif); >>>>> drivers/media/platform/qcom/camss/camss-ispif.c:1168: IRQF_TRIGGER_RISING, ispif->irq_name, ispif); >>>>> drivers/media/platform/qcom/camss/camss-vfe.c:1327: IRQF_TRIGGER_RISING, vfe->irq_name, vfe); >>>> >>>> Downstream has a lot of bad code, so I am not sure how good argument >>>> this is. >>>> >>>> I acked the patch because I assumed you *checked in hardware*. >>>> >>>>> >>>>> From runtime point of view it's more important to get re-probed camss >>>>> driver, see an absolutely similar and previously discussed case (in the >>>>> cover letter): >>>>> >>>>> https://lore.kernel.org/lkml/20220530080842.37024-4-manivannan.sadhasivam@linaro.org/ >>>>> >>>>> Now in runtime I get this error, it's easy to check by unbinding/binding any >>>>> camss device: >>>>> >>>>> irq: type mismatch, failed to map hwirq-509 for interrupt-controller@17a00000! >>>>> >>>>> Basically camss devices can not be bound on the second time on the >>>>> number of platforms touched by this changeset. >>>> >>>> This is solveable different way and I do not understand this rationale. >>>> The driver should not request trigger type but use what DTS is >>>> providing, unless of course only one valid trigger is possible. >>> >>> Right at the moment the driver uses rising edge type of interrupts, and >>> it works properly. >>> >>>> But so >>>> far you did not provide any arguments for this. Downstream crappy code? >>> >>> Downstream code works, that's the argument to support the change. >> >> That is not acceptable argument. If downstream has a bug, but somehow >> works, you will implement the same bug upstream? >> >> Downstream is well known of shortcuts, incomplete solutions and crappy >> code, which passes some tests but might not be really correct. >> >> I understand that downstream can be a supportive case, but not for level >> of interrupts! People, not only downstream but it's even worse there, do >> not see the difference between level and edge, between GPIO ACTIVE_HIGH >> and ACTIVE_LOW. >> >>> >>>> Nope. Existing driver? Same. >>> >>> The existing driver works, that's the argument to support the change. >> >> We are not going to get into such discussions. Code might be incorrect, >> but mostly works because race issues are very tricky to spot, yet you >> use that code as argument to say hardware is like that. >> >> No. Hardware is not because driver is written that way. >> >> >>> >>>> Was anything here actually checked with datasheets/hardware? >>> >>> The initially open question is unanswered, why sc8280xp CAMSS does >> >> This is about all CAMSS, not only sc8280xp. >> >>> specify interrupts as level high type, was it actually checked with >>> datasheets/hardware, as you say it? It has never been tested by anyone >>> and anywhere, downstream or upstream wise, only rising edge interrupts >>> were tested, and they do work. >> >> I did not ask about testing. I ask how the manual, hardware engineers >> designed it. >> >>> >>> I don't have access to datasheets or hardware of sc8280xp powered board, >>> someone may either verify, if CAMSS level high type interrupts are> supported/working at all or not (obviously its current presence in dts is >>> insufficient), or check the SoC datasheet. >>> >>> To sum up, the intention of this change: >>> 1) fix the unpleasant runtime issue with no regressions (it's been tested), >> >> Did you test races and all the tricky issues arising when you use >> incorrectly edged interrupts? Or you just checked that "interrupt works"? > > Right from the beginning and any other day CAMSS interrupts are tested as > rising edge interrupts. So, I don't undestand your point here, please > elaborate. So you did not test whether these are correct interrupt types. What to elaborate more? You have very tricky race condition, for example, so you test that it is not possible. > >>> 2) align CAMSS device description in firmware with known to work well >>> IP hardware configuration. >> >> Where is this description in firmware? Where is this IP hardware >> configuration? You just said it is purely on downstream driver. > > CAMSS IP configuration, in particular interrupt type, is done by the > upstream driver, note that the fixes in this changeset is also sent > against the upstream driver, tested on the upstream driver etc. What does it even mean? You said "device description in firmware" and "IP hardware configuration", but now speak about drivers. Best regards, Krzysztof