linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS
@ 2019-03-30 15:09 Colin King
  2019-03-30 16:38 ` Mukesh Ojha
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Colin King @ 2019-03-30 15:09 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Bjorn Helgaas, Heiko Stuebner, linux-pci,
	linux-rockchip, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel, Shawn Lin

From: Colin Ian King <colin.king@canonical.com>

Currently the bitwise operations on the u16 variable 'status' with
the setting ROCKCHIP_PCIE_EP_CMD_STATUS_IS are incorrect because
ROCKCHIP_PCIE_EP_CMD_STATUS_IS is 1UL<<19 which is wider than the
u16 variable.  Fix this by making status a u32.  (Not tested).

Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/pci/controller/pcie-rockchip-ep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
index a5d799e2dff2..d743b0a48988 100644
--- a/drivers/pci/controller/pcie-rockchip-ep.c
+++ b/drivers/pci/controller/pcie-rockchip-ep.c
@@ -350,7 +350,7 @@ static void rockchip_pcie_ep_assert_intx(struct rockchip_pcie_ep *ep, u8 fn,
 	struct rockchip_pcie *rockchip = &ep->rockchip;
 	u32 r = ep->max_regions - 1;
 	u32 offset;
-	u16 status;
+	u32 status;
 	u8 msg_code;
 
 	if (unlikely(ep->irq_pci_addr != ROCKCHIP_PCIE_EP_PCI_LEGACY_IRQ_ADDR ||
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS
  2019-03-30 15:09 [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS Colin King
@ 2019-03-30 16:38 ` Mukesh Ojha
  2019-04-12  9:51 ` Lorenzo Pieralisi
  2019-04-15 10:03 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 5+ messages in thread
From: Mukesh Ojha @ 2019-03-30 16:38 UTC (permalink / raw)
  To: Colin King, Lorenzo Pieralisi, Bjorn Helgaas, Heiko Stuebner,
	linux-pci, linux-rockchip, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel, Shawn Lin


On 3/30/2019 8:39 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the bitwise operations on the u16 variable 'status' with
> the setting ROCKCHIP_PCIE_EP_CMD_STATUS_IS are incorrect because
> ROCKCHIP_PCIE_EP_CMD_STATUS_IS is 1UL<<19 which is wider than the
> u16 variable.  Fix this by making status a u32.  (Not tested).
>
> Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/pci/controller/pcie-rockchip-ep.c | 2 +-


Looks valid to me.

Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh


>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
> index a5d799e2dff2..d743b0a48988 100644
> --- a/drivers/pci/controller/pcie-rockchip-ep.c
> +++ b/drivers/pci/controller/pcie-rockchip-ep.c
> @@ -350,7 +350,7 @@ static void rockchip_pcie_ep_assert_intx(struct rockchip_pcie_ep *ep, u8 fn,
>   	struct rockchip_pcie *rockchip = &ep->rockchip;
>   	u32 r = ep->max_regions - 1;
>   	u32 offset;
> -	u16 status;
> +	u32 status;
>   	u8 msg_code;
>   
>   	if (unlikely(ep->irq_pci_addr != ROCKCHIP_PCIE_EP_PCI_LEGACY_IRQ_ADDR ||

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS
  2019-03-30 15:09 [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS Colin King
  2019-03-30 16:38 ` Mukesh Ojha
@ 2019-04-12  9:51 ` Lorenzo Pieralisi
  2019-04-15  1:46   ` Shawn Lin
  2019-04-15 10:03 ` Lorenzo Pieralisi
  2 siblings, 1 reply; 5+ messages in thread
From: Lorenzo Pieralisi @ 2019-04-12  9:51 UTC (permalink / raw)
  To: Colin King, Shawn Lin
  Cc: Bjorn Helgaas, Heiko Stuebner, linux-pci, linux-rockchip,
	linux-arm-kernel, kernel-janitors, linux-kernel

On Sat, Mar 30, 2019 at 03:09:10PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the bitwise operations on the u16 variable 'status' with
> the setting ROCKCHIP_PCIE_EP_CMD_STATUS_IS are incorrect because
> ROCKCHIP_PCIE_EP_CMD_STATUS_IS is 1UL<<19 which is wider than the
> u16 variable.  Fix this by making status a u32.  (Not tested).
> 
> Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/pci/controller/pcie-rockchip-ep.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Shawn,

I need your ACK on this patch, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
> index a5d799e2dff2..d743b0a48988 100644
> --- a/drivers/pci/controller/pcie-rockchip-ep.c
> +++ b/drivers/pci/controller/pcie-rockchip-ep.c
> @@ -350,7 +350,7 @@ static void rockchip_pcie_ep_assert_intx(struct rockchip_pcie_ep *ep, u8 fn,
>  	struct rockchip_pcie *rockchip = &ep->rockchip;
>  	u32 r = ep->max_regions - 1;
>  	u32 offset;
> -	u16 status;
> +	u32 status;
>  	u8 msg_code;
>  
>  	if (unlikely(ep->irq_pci_addr != ROCKCHIP_PCIE_EP_PCI_LEGACY_IRQ_ADDR ||
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS
  2019-04-12  9:51 ` Lorenzo Pieralisi
@ 2019-04-15  1:46   ` Shawn Lin
  0 siblings, 0 replies; 5+ messages in thread
From: Shawn Lin @ 2019-04-15  1:46 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Colin King
  Cc: shawn.lin, Bjorn Helgaas, Heiko Stuebner, linux-pci,
	linux-rockchip, linux-arm-kernel, kernel-janitors, linux-kernel


On 2019/4/12 17:51, Lorenzo Pieralisi wrote:
> On Sat, Mar 30, 2019 at 03:09:10PM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Currently the bitwise operations on the u16 variable 'status' with
>> the setting ROCKCHIP_PCIE_EP_CMD_STATUS_IS are incorrect because
>> ROCKCHIP_PCIE_EP_CMD_STATUS_IS is 1UL<<19 which is wider than the
>> u16 variable.  Fix this by making status a u32.  (Not tested).
>>
>> Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/pci/controller/pcie-rockchip-ep.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Shawn,
> 
> I need your ACK on this patch, thanks.

Acked-by: Shawn Lin <shawn.lin@rock-chips.com>

> 
> Lorenzo
> 
>> diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
>> index a5d799e2dff2..d743b0a48988 100644
>> --- a/drivers/pci/controller/pcie-rockchip-ep.c
>> +++ b/drivers/pci/controller/pcie-rockchip-ep.c
>> @@ -350,7 +350,7 @@ static void rockchip_pcie_ep_assert_intx(struct rockchip_pcie_ep *ep, u8 fn,
>>   	struct rockchip_pcie *rockchip = &ep->rockchip;
>>   	u32 r = ep->max_regions - 1;
>>   	u32 offset;
>> -	u16 status;
>> +	u32 status;
>>   	u8 msg_code;
>>   
>>   	if (unlikely(ep->irq_pci_addr != ROCKCHIP_PCIE_EP_PCI_LEGACY_IRQ_ADDR ||
>> -- 
>> 2.20.1
>>
> 
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS
  2019-03-30 15:09 [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS Colin King
  2019-03-30 16:38 ` Mukesh Ojha
  2019-04-12  9:51 ` Lorenzo Pieralisi
@ 2019-04-15 10:03 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Pieralisi @ 2019-04-15 10:03 UTC (permalink / raw)
  To: Colin King
  Cc: Bjorn Helgaas, Heiko Stuebner, linux-pci, linux-rockchip,
	linux-arm-kernel, kernel-janitors, linux-kernel, Shawn Lin

On Sat, Mar 30, 2019 at 03:09:10PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently the bitwise operations on the u16 variable 'status' with
> the setting ROCKCHIP_PCIE_EP_CMD_STATUS_IS are incorrect because
> ROCKCHIP_PCIE_EP_CMD_STATUS_IS is 1UL<<19 which is wider than the
> u16 variable.  Fix this by making status a u32.  (Not tested).
> 
> Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/pci/controller/pcie-rockchip-ep.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to pci/rockchip for v5.2, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c
> index a5d799e2dff2..d743b0a48988 100644
> --- a/drivers/pci/controller/pcie-rockchip-ep.c
> +++ b/drivers/pci/controller/pcie-rockchip-ep.c
> @@ -350,7 +350,7 @@ static void rockchip_pcie_ep_assert_intx(struct rockchip_pcie_ep *ep, u8 fn,
>  	struct rockchip_pcie *rockchip = &ep->rockchip;
>  	u32 r = ep->max_regions - 1;
>  	u32 offset;
> -	u16 status;
> +	u32 status;
>  	u8 msg_code;
>  
>  	if (unlikely(ep->irq_pci_addr != ROCKCHIP_PCIE_EP_PCI_LEGACY_IRQ_ADDR ||
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-15 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-30 15:09 [PATCH] PCI: rockchip: fix bitwise operations on status and ROCKCHIP_PCIE_EP_CMD_STATUS_IS Colin King
2019-03-30 16:38 ` Mukesh Ojha
2019-04-12  9:51 ` Lorenzo Pieralisi
2019-04-15  1:46   ` Shawn Lin
2019-04-15 10:03 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).