[Skiboot] [PATCH V2 1/7] xscom: Return OPAL_WRONG_STATE on XSCOM ops if CPU is asleep

Andrew Donnellan andrew.donnellan at au1.ibm.com
Mon Mar 21 12:23:11 AEDT 2016


On 21/03/16 12:00, Russell Currey wrote:
> @@ -175,6 +178,7 @@ static bool xscom_gcid_ok(uint32_t gcid)
>   static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val)
>   {
>   	uint64_t hmer;
> +	int64_t ret;

Why is this int64_t when both xscom_handle_error() and __xscom_read() 
are int?

>
>   	if (!xscom_gcid_ok(gcid)) {
>   		prerror("%s: invalid XSCOM gcid 0x%x\n", __func__, gcid);
> @@ -197,16 +201,18 @@ static int __xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val)
>   		if (!(hmer & SPR_HMER_XSCOM_FAIL))
>   			break;
>
> -		/* Handle error and eventually retry */
> -		if (!xscom_handle_error(hmer, gcid, pcb_addr, false))
> -			return OPAL_HARDWARE;
> +		/* Handle error and possibly eventually retry */
> +		ret = xscom_handle_error(hmer, gcid, pcb_addr, false);
> +		if (ret == OPAL_HARDWARE || ret == OPAL_WRONG_STATE)
> +			return ret;
>   	}
> -	return 0;
> +	return OPAL_SUCCESS;
>   }
>
>   static int __xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val)
>   {
>   	uint64_t hmer;
> +	int64_t ret;

Same here


-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan at au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited



More information about the Skiboot mailing list