lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Oct 2020 14:38:16 +0300
From:   Roger Quadros <rogerq@...com>
To:     Pawel Laszczak <pawell@...ence.com>,
        "balbi@...nel.org" <balbi@...nel.org>
CC:     "peter.chen@....com" <peter.chen@....com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Rahul Kumar <kurahul@...ence.com>
Subject: Re: [PATCH v2] usb: cdns3: Rids of duplicate error message

Pawel,

On 12/10/2020 14:12, Pawel Laszczak wrote:
> Hi Roger,
> 
> On 12/10/2020 09:42, Pawel Laszczak wrote:
>> On failure, the platform_get_irq_byname prints an error message
>> so, patch removes error message related to this function from
>> core.c file.
>>
>> A change was suggested during reviewing CDNSP driver by Chunfeng Yun.
>>
>> Signed-off-by: Pawel Laszczak <pawell@...ence.com>
>> ---
>> Changelog:
>> v2
>> - simplified code as sugested by Roger Quadros.
>>
>>    drivers/usb/cdns3/core.c | 10 +---------
>>    1 file changed, 1 insertion(+), 9 deletions(-)
>>
>> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
>> index a0f73d4711ae..85ef3025b293 100644
>> --- a/drivers/usb/cdns3/core.c
>> +++ b/drivers/usb/cdns3/core.c
>> @@ -469,22 +469,14 @@ static int cdns3_probe(struct platform_device *pdev)
>>    	if (cdns->dev_irq == -EPROBE_DEFER)
> 
> Shouldn't this be
> 	if (cdns->dev_irq < 0)
> ?
> 
> No, such line will change the original behavior of driver.
> 
> Current patch allows to run driver when we support only host.
> In such case the dev_irq can be < 0 and we still can use host  side.

In that case should we check if we need dev_irq and if so then error out.
i.e. if mode is "peripheral" or "otg"

Also DT binding document says all 3 IRQs are mandatory. Do we need to update that?

cheers,
-roger

> 
> Regards,
> Pawel Laszczak
> 
>>    		return cdns->dev_irq;
>>    
>> -	if (cdns->dev_irq < 0)
>> -		dev_err(dev, "couldn't get peripheral irq\n");
>> -
>>    	regs = devm_platform_ioremap_resource_byname(pdev, "dev");
>>    	if (IS_ERR(regs))
>>    		return PTR_ERR(regs);
>>    	cdns->dev_regs	= regs;
>>    
>>    	cdns->otg_irq = platform_get_irq_byname(pdev, "otg");
>> -	if (cdns->otg_irq == -EPROBE_DEFER)
>> -		return cdns->otg_irq;
>> -
>> -	if (cdns->otg_irq < 0) {
>> -		dev_err(dev, "couldn't get otg irq\n");
>> +	if (cdns->otg_irq < 0)
>>    		return cdns->otg_irq;
>> -	}
>>    
>>    	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "otg");
>>    	if (!res) {
>>
> 

-- 
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ